Skip to content

Commit

Permalink
Tweaks
Browse files Browse the repository at this point in the history
  • Loading branch information
suhanw committed Jan 9, 2025
1 parent d2c37b2 commit 5d8c436
Show file tree
Hide file tree
Showing 8 changed files with 57 additions and 17 deletions.
2 changes: 1 addition & 1 deletion components/app-loader/style.less
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@
height: 100%;
width: 0;
background: #81cd2e;
animation: prog 25s ease-out infinite;
animation: prog 30s ease-out infinite;
}
}

Expand Down
1 change: 0 additions & 1 deletion components/bottom-menu/index.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import { useEffect, useState } from "react";
import cn from "classnames";
import { useShowElementOnUpScroll } from "utils";

Expand Down
1 change: 1 addition & 0 deletions components/bottom-menu/style.less
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
justify-content: center;
align-items: center;
background-color: #f9f9f9;
border-top: 1px solid #333;
transform: translateY(100%);
transition: transform 300ms ease-out;

Expand Down
20 changes: 20 additions & 0 deletions components/bottom-pill/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
import cn from "classnames";
import { useShowElementOnUpScroll } from "utils";

import style from "./style";

function BottomPill({ children }) {
const { showElement } = useShowElementOnUpScroll();

return (
<nav
className={cn(style.bottomPill, {
[style.show]: showElement,
})}
>
{children}
</nav>
);
}

export default BottomPill;
17 changes: 17 additions & 0 deletions components/bottom-pill/style.less
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
.bottomPill {
z-index: 1;
position: fixed;
bottom: 24px;
left: 50%;
padding: 12px 24px;
background-color: #f9f9f9;
border-radius: 24px;
border: 1px solid #333;
transform: translate(-50%, 200%);
transition: transform 300ms ease-out;

&.show {
transform: translate(-50%, 0);
transition: transform 300ms ease-out;
}
}
11 changes: 6 additions & 5 deletions pages/auteur-preview/index.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
import { useEffect } from "react";
import Head from "next/head";
import style from "./style";
import BottomMenu from "components/bottom-menu";
import Layout from "components/layout";
import BottomPill from "components/bottom-pill";

export default () => {
useEffect(() => {
Expand All @@ -13,7 +14,7 @@ export default () => {
}, []);

return (
<>
<Layout>
<Head>
<title>Auteur Preview</title>
</Head>
Expand Down Expand Up @@ -121,12 +122,12 @@ export default () => {
<img src="/images/auteur-responsive.gif" />
</figure>
</article>
<BottomMenu mobileOnly={false}>
<BottomPill>
<a className={style.cta} href="/auteur">
<span>Auteur</span>
<img src="/icons/external-link.svg" />
</a>
</BottomMenu>
</>
</BottomPill>
</Layout>
);
};
11 changes: 6 additions & 5 deletions pages/mapmycruise-preview/index.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
import Head from "next/head";
import style from "./style";
import BottomMenu from "components/bottom-menu";
import BottomPill from "components/bottom-pill";
import Layout from "components/layout";

export default () => {
return (
<>
<Layout>
<Head>
<title>MapMyCruise Preview</title>
</Head>
Expand Down Expand Up @@ -106,12 +107,12 @@ export default () => {
<img src="https://github.com/suhanw/map_my_cruise/raw/master/docs/README_gifs/notifications.gif" />
</figure>
</article>
<BottomMenu mobileOnly={false}>
<BottomPill>
<a className={style.cta} href="/mapmycruise">
<span>MapMyCruise</span>
<img src="/icons/external-link.svg" />
</a>
</BottomMenu>
</>
</BottomPill>
</Layout>
);
};
11 changes: 6 additions & 5 deletions pages/tmnt-preview/index.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
import Head from "next/head";
import style from "./style";
import BottomMenu from "components/bottom-menu";
import BottomPill from "components/bottom-pill";
import Layout from "components/layout";

export default () => {
return (
<>
<Layout>
<Head>
<title>TMNT React Preview</title>
</Head>
Expand Down Expand Up @@ -103,12 +104,12 @@ export default () => {
<img src="/images/tmnt-preview/turtle-attack.gif" />
</figure>
</article>
<BottomMenu mobileOnly={false}>
<BottomPill>
<a className={style.cta} href="/tmnt">
<span>TMNT React</span>
<img src="/icons/external-link.svg" />
</a>
</BottomMenu>
</>
</BottomPill>
</Layout>
);
};

0 comments on commit 5d8c436

Please sign in to comment.