Skip to content

Commit

Permalink
feat: Add the footer to the homepage (#273)
Browse files Browse the repository at this point in the history
  • Loading branch information
Ushie authored Feb 3, 2025
1 parent 2ef9fbc commit 87ce20f
Show file tree
Hide file tree
Showing 4 changed files with 63 additions and 24 deletions.
36 changes: 20 additions & 16 deletions src/layout/Footer/FooterHost.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@
import { RV_DMCA_GUID } from '$env/static/public';
import { onMount } from 'svelte';
export let showDivider = true;
const aboutQuery = createQuery(['about'], queries.about);
let location: string;
Expand All @@ -22,22 +24,24 @@
</script>

<!-- squiggly divider line -->
<svg
aria-hidden="true"
width="100%"
height="8"
fill="none"
xmlns="http://www.w3.org/2000/svg"
in:fly={{ y: 10, easing: quintOut, duration: 750 }}
>
<pattern id="a" width="91" height="8" patternUnits="userSpaceOnUse">
<path
d="M114 4c-5.067 4.667-10.133 4.667-15.2 0S88.667-.667 83.6 4 73.467 8.667 68.4 4 58.267-.667 53.2 4 43.067 8.667 38 4 27.867-.667 22.8 4 12.667 8.667 7.6 4-2.533-.667-7.6 4s-10.133 4.667-15.2 0S-32.933-.667-38 4s-10.133 4.667-15.2 0-10.133-4.667-15.2 0-10.133 4.667-15.2 0-10.133-4.667-15.2 0-10.133 4.667-15.2 0-10.133-4.667-15.2 0-10.133 4.667-15.2 0-10.133-4.667-15.2 0-10.133 4.667-15.2 0-10.133-4.667-15.2 0-10.133 4.667-15.2 0-10.133-4.667-15.2 0-10.133 4.667-15.2 0-10.133-4.667-15.2 0-10.133 4.667-15.2 0-10.133-4.667-15.2 0-10.133 4.667-15.2 0-10.133-4.667-15.2 0-10.133 4.667-15.2 0-10.133-4.667-15.2 0-10.133 4.667-15.2 0-10.133-4.667-15.2 0-10.133 4.667-15.2 0-10.133-4.667-15.2 0-10.133 4.667-15.2 0"
stroke-linecap="square"
/>
</pattern>
<rect width="100%" height="100%" fill="url(#a)" />
</svg>
{#if showDivider}
<svg
aria-hidden="true"
width="100%"
height="8"
fill="none"
xmlns="http://www.w3.org/2000/svg"
in:fly={{ y: 10, easing: quintOut, duration: 750 }}
>
<pattern id="a" width="91" height="8" patternUnits="userSpaceOnUse">
<path
d="M114 4c-5.067 4.667-10.133 4.667-15.2 0S88.667-.667 83.6 4 73.467 8.667 68.4 4 58.267-.667 53.2 4 43.067 8.667 38 4 27.867-.667 22.8 4 12.667 8.667 7.6 4-2.533-.667-7.6 4s-10.133 4.667-15.2 0S-32.933-.667-38 4s-10.133 4.667-15.2 0-10.133-4.667-15.2 0-10.133 4.667-15.2 0-10.133-4.667-15.2 0-10.133 4.667-15.2 0-10.133-4.667-15.2 0-10.133 4.667-15.2 0-10.133-4.667-15.2 0-10.133 4.667-15.2 0-10.133-4.667-15.2 0-10.133 4.667-15.2 0-10.133-4.667-15.2 0-10.133 4.667-15.2 0-10.133-4.667-15.2 0-10.133 4.667-15.2 0-10.133-4.667-15.2 0-10.133 4.667-15.2 0-10.133-4.667-15.2 0-10.133 4.667-15.2 0-10.133-4.667-15.2 0-10.133 4.667-15.2 0-10.133-4.667-15.2 0-10.133 4.667-15.2 0-10.133-4.667-15.2 0-10.133 4.667-15.2 0"
stroke-linecap="square"
/>
</pattern>
<rect width="100%" height="100%" fill="url(#a)" />
</svg>
{/if}
<footer in:fly={{ y: 10, easing: quintOut, duration: 750 }}>
<div class="footer-top">
<section class="main-content">
Expand Down
2 changes: 1 addition & 1 deletion src/layout/Hero/HeroImage.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
}
@media (max-width: 1700px) {
.hero-img {
position: fixed;
position: absolute;
height: 100vh;
top: 115px;
right: 6rem;
Expand Down
2 changes: 1 addition & 1 deletion src/lib/components/Wave.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

<style>
svg {
position: fixed;
position: absolute;
z-index: -999;
bottom: 0;
height: 35vh;
Expand Down
47 changes: 41 additions & 6 deletions src/routes/+page.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,17 @@
import Home from '$layout/Hero/HeroSection.svelte';
import SocialHost from '$layout/Hero/SocialHost.svelte';
import Wave from '$lib/components/Wave.svelte';
import Footer from '$layout/Footer/FooterHost.svelte';
import Head from '$lib/components/Head.svelte';
let scrollY = 0;
let footerVisible = false;
$: footerVisible = scrollY >= 10;
</script>

<svelte:window bind:scrollY />

<Head
schemas={[
{
Expand Down Expand Up @@ -117,22 +125,45 @@
]}
/>

<main>
<main style={footerVisible ? '' : `height: 100vh;`} class:hidden={footerVisible}>
<div class="wrap">
<div class="wrappezoid">
<Home />
<div id="heroimg"><HeroImage /></div>
</div>
</div>
<SocialHost />
<div class="hide-on-scroll" class:hidden={footerVisible}>
<Wave />
<SocialHost />
</div>
</main>
<Wave />
<div class="footer">
<Footer showDivider={footerVisible ? true : false} />
</div>

<style>
<style lang="scss">
.hide-on-scroll {
transition: opacity 0.5s var(--bezier-one);
z-index: -999;
&.hidden {
height: 0;
opacity: 0;
}
}
main {
display: flex;
flex-direction: column;
gap: 1.5rem;
margin-bottom: 3rem;
transition:
gap 0.5s var(--bezier-one),
margin-bottom 0.5s var(--bezier-one);
&.hidden {
gap: 0rem;
margin-bottom: 0rem;
}
}
.wrap {
margin-inline: auto;
Expand All @@ -142,11 +173,15 @@
.wrappezoid {
height: calc(100vh - 225px);
display: flex;
flex-direction: row;
justify-content: center;
gap: 22rem;
align-items: center;
gap: 22rem;
}
.footer {
background-color: var(--background-one);
}
@media (max-width: 1700px) {
.wrappezoid {
justify-content: space-between;
Expand Down

0 comments on commit 87ce20f

Please sign in to comment.