Skip to content

Commit

Permalink
refactor: Hero mit Titel und Slogan als eigenes Component
Browse files Browse the repository at this point in the history
  • Loading branch information
SachsenspieltCoding committed Jul 30, 2023
1 parent 79e0953 commit fcfa2fa
Show file tree
Hide file tree
Showing 5 changed files with 43 additions and 32 deletions.
17 changes: 17 additions & 0 deletions src/components/Common/HeroWithTitleAndSlogan.svelte
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
<script lang="ts">
import Hero from "../Hero/Hero.svelte";
export let img: string;
</script>

<Hero {img}}>
<div class="dshadow text-center leading-[2rem] md:leading-[3rem] lg:leading-[4rem]">
<h1 class="uppercase tracking-[.3em]">
<slot />
</h1>
<h3>
Quadratisch<span class="text-accent">.</span> Praktisch<span class="text-accent">.</span>
Gut<span class="text-accent">.</span>
</h3>
</div>
</Hero>
24 changes: 8 additions & 16 deletions src/routes/+page.svelte
Original file line number Diff line number Diff line change
@@ -1,26 +1,18 @@
<script>
import Hero from '../components/Hero/Hero.svelte';
import { generateTitle } from '$lib/titleGenerator';
import SectionWithImageAndText from '../components/Common/SectionWithImageAndText.svelte';
import SectionSpacer from '../components/Common/SectionSpacer.svelte';
import { page } from '$app/stores';
import ArticlePreview from '../components/News/ArticlePreview.svelte';
import AboutTimeline from '../components/Timeline/AboutTimeline.svelte';
import { generateTitle } from "$lib/titleGenerator";
import SectionWithImageAndText from "../components/Common/SectionWithImageAndText.svelte";
import SectionSpacer from "../components/Common/SectionSpacer.svelte";
import { page } from "$app/stores";
import ArticlePreview from "../components/News/ArticlePreview.svelte";
import AboutTimeline from "../components/Timeline/AboutTimeline.svelte";
import HeroWithTitleAndSlogan from "../components/Common/HeroWithTitleAndSlogan.svelte";
</script>

<svelte:head>
<title>{generateTitle('Home')}</title>
</svelte:head>

<Hero img="/img/home/hero.png">
<div class="dshadow text-center leading-[2rem] md:leading-[3rem] lg:leading-[4rem]">
<h1 class="tracking-[.3em]">CUBYX NETWORK</h1>
<h3>
Quadratisch<span class="text-accent">.</span> Praktisch<span class="text-accent">.</span>
Gut<span class="text-accent">.</span>
</h3>
</div>
</Hero>
<HeroWithTitleAndSlogan img="/img/home/hero.png">Cubyx Network</HeroWithTitleAndSlogan>

<div class="my-12 text-center leading-tight">
<h2>Herzlich Willkommen</h2>
Expand Down
24 changes: 8 additions & 16 deletions src/routes/news/+page.svelte
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
<script lang="ts">
import ArticlePreview from '../../components/News/ArticlePreview.svelte';
import { page } from '$app/stores';
import Hero from '../../components/Hero/Hero.svelte';
import { generateTitle } from '$lib/titleGenerator';
import { filter } from '$lib/stores/newsStore';
import { onMount } from 'svelte';
import TagDisplay from '../../components/News/TagDisplay.svelte';
import ArticlePreview from "../../components/News/ArticlePreview.svelte";
import { page } from "$app/stores";
import { generateTitle } from "$lib/titleGenerator";
import { filter } from "$lib/stores/newsStore";
import { onMount } from "svelte";
import TagDisplay from "../../components/News/TagDisplay.svelte";
import HeroWithTitleAndSlogan from "../../components/Common/HeroWithTitleAndSlogan.svelte";
let articles = [];
Expand Down Expand Up @@ -35,15 +35,7 @@
<title>{generateTitle('Neuigkeiten')}</title>
</svelte:head>

<Hero img="/img/news/hero.jpg">
<div class="dshadow text-center leading-[2rem] md:leading-[3rem] lg:leading-[4rem]">
<h1 class="uppercase tracking-[.3em]">Aktuelle Neuigkeiten</h1>
<h3>
Quadratisch<span class="text-accent">.</span> Praktisch<span class="text-accent">.</span>
Gut<span class="text-accent">.</span>
</h3>
</div>
</Hero>
<HeroWithTitleAndSlogan img="/img/news/hero.jpg">Aktuelle Neuigkeiten</HeroWithTitleAndSlogan>

<div
class="mx-auto my-8 w-full flex-col items-center justify-center gap-4 px-2 md:w-[80%] lg:w-1/2"
Expand Down
10 changes: 10 additions & 0 deletions src/routes/team/+page.svelte
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
<script>
import { generateTitle } from "$lib/titleGenerator";
import HeroWithTitleAndSlogan from "../../components/Common/HeroWithTitleAndSlogan.svelte";
</script>

<svelte:head>
<title>{generateTitle("Das Team")}</title>
</svelte:head>

<HeroWithTitleAndSlogan img="/img/team/hero.jpg">Das Cubyx Team</HeroWithTitleAndSlogan>
Binary file added static/img/team/hero.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit fcfa2fa

Please sign in to comment.