Skip to content

Commit

Permalink
Dec 15 (#1297)
Browse files Browse the repository at this point in the history
* Dec 15

* Update announcement-banner.tsx

* Update announcement-banner.tsx

* Update announcement-banner.tsx

* Update announcement-banner.tsx

* Update announcement-banner.tsx

* Update announcement-banner.tsx

---------

Co-authored-by: Sheepy3 <[email protected]>
  • Loading branch information
jianmin-chen and Sheepy3 authored Dec 15, 2023
1 parent 7652e60 commit 60c9d11
Show file tree
Hide file tree
Showing 6 changed files with 203 additions and 68 deletions.
125 changes: 83 additions & 42 deletions src/components/navbar-main.tsx
Original file line number Diff line number Diff line change
@@ -1,59 +1,100 @@
import { IoAdd, IoLogoGithub, IoOpenOutline } from 'react-icons/io5'
import Button from './design-system/button'
import styles from './navbar.module.css'
import { SessionInfo } from '../lib/game-saving/account'
import { isDark } from '../lib/state'

import { IoAdd, IoLogoGithub, IoOpenOutline } from "react-icons/io5";
import Button from "./design-system/button";
import styles from "./navbar.module.css";
import { SessionInfo } from "../lib/game-saving/account";
import { isDark } from "../lib/state";
import AnnouncementBanner from "./popups-etc/announcement-banner";
interface MainNavbarProps {
session: SessionInfo | null
transparent?: boolean
goldLogo?: boolean
session: SessionInfo | null;
transparent?: boolean;
goldLogo?: boolean;
}

export default function MainNavbar(props: MainNavbarProps) {
return (
<nav class={`${styles.container} ${props.transparent ? styles.transparent : ''}`}>
<nav
class={`${styles.container} ${
props.transparent ? styles.transparent : ""
}`}
>
<div class={styles.mobile}>
<AnnouncementBanner />
</div>
<ul class={styles.navlinks}>
<li class={styles.logo}>
<a href='/'>
<img class={styles.longImg} src={`/spriglogotext-${props.goldLogo ? 'gold' : 'white'}.png`} height={30} width={87} alt='Sprig Logo' />
<a href="/">
<img
class={styles.longImg}
src={`/spriglogotext-${
props.goldLogo ? "gold" : "white"
}.png`}
height={30}
width={87}
alt="Sprig Logo"
/>
</a>
</li>
{props.session?.session.full ? (
<li>
<a href='/~'>Your Games</a>
<a href="/~">Your Games</a>
</li>
) : null}
<li><a href='/gallery'>Gallery</a></li>
<li><a href='/get'>Get a Sprig</a></li>
<li>
<a href="/gallery">Gallery</a>
</li>
<li>
<a href="/get">Get a Sprig</a>
</li>
</ul>
<div class={styles.desktop}>
<AnnouncementBanner />
</div>
<ul class={styles.rightActions}>
{props.session?.session.full ? (<>
<li class={styles.actionIcon}>
<a href='https://github.com/hackclub/sprig/' target='_blank'>
<IoLogoGithub />
</a>
</li>
<li>
<a href='/~/new'><Button icon={IoAdd}>New Game</Button></a>
</li>
</>) : (<>
<li class={styles.plainLink}>
<a href='https://github.com/hackclub/sprig/' target='_blank'>
GitHub{' '}
<span style={{ verticalAlign: 'middle', lineHeight: 1 }}>
<IoOpenOutline />
</span>
</a>
</li>
<li class={styles.plainLink}>
<a href='/login'>Log In</a>
</li>
<li>
<a href='/editor'><Button>Open Editor</Button></a>
</li>
</>)}
{props.session?.session.full ? (
<>
<li class={styles.actionIcon}>
<a
href="https://github.com/hackclub/sprig/"
target="_blank"
>
<IoLogoGithub />
</a>
</li>
<li>
<a href="/~/new">
<Button icon={IoAdd}>New Game</Button>
</a>
</li>
</>
) : (
<>
<li class={styles.plainLink}>
<a
href="https://github.com/hackclub/sprig/"
target="_blank"
>
GitHub{" "}
<span
style={{
verticalAlign: "middle",
lineHeight: 1,
}}
>
<IoOpenOutline />
</span>
</a>
</li>
<li class={styles.plainLink}>
<a href="/login">Log In</a>
</li>
<li>
<a href="/editor">
<Button>Open Editor</Button>
</a>
</li>
</>
)}
</ul>
</nav>
)
}
);
}
17 changes: 14 additions & 3 deletions src/components/navbar.module.css
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
align-items: center;
position: relative;
text-align: center;
justify-content: space-between;
}

.container ul {
Expand All @@ -28,7 +29,6 @@

/* Navlinks */
.navlinks {
flex: 1;
gap: 4px;
}

Expand Down Expand Up @@ -102,7 +102,8 @@
}

/* Logo */
.logo a, .logo button {
.logo a,
.logo button {
font-weight: bold;
gap: 6px;
padding: 0 10px;
Expand Down Expand Up @@ -210,6 +211,12 @@
}

/* responsive design */
@media (min-width: 600px) {
.mobile {
display: none;
}
}

@media (max-width: 700px) {
.logoText {
display: none;
Expand All @@ -223,6 +230,10 @@
gap: 0;
padding-top: 4px;
}

.desktop {
display: none;
}
}

@media (max-width: 420px) {
Expand All @@ -235,4 +246,4 @@
.logo button {
padding: 0 8px;
}
}
}
32 changes: 32 additions & 0 deletions src/components/popups-etc/announcement-banner.module.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
.banner {
color: white;
cursor: pointer;
margin-top: 14px;
display: flex;
justify-content: center;
}

.banner > a {
color: inherit;
align-items: center;
display: flex;
gap: 14px;
background-color: rgba(255, 255, 255, 0.2);
border-radius: 1rem;
width: fit-content;
padding: 0 1rem;
transition: all 0.1s;
max-width: 400px;
}

.banner:hover {
transform: scale(101%);
}

.banner > a:hover {
color: inherit;
}

.icon {
font-size: 5rem;
}
15 changes: 15 additions & 0 deletions src/components/popups-etc/announcement-banner.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
import styles from "./announcement-banner.module.css";

export default function AnnouncementBanner() {
return (
<div class={styles.banner}>
<a href="/drop">
<img src="https://cloud-1h9ytxva8-hack-club-bot.vercel.app/0whitesnoman.png" alt="Lil Snoman" width="64" height="75" />
<p>
SHAWN X SPRIG winter case drops dec-15! click here to learn
more about how you can get one!
</p>
</a>
</div>
);
}
81 changes: 58 additions & 23 deletions src/global.css
Original file line number Diff line number Diff line change
@@ -1,12 +1,25 @@
*, *::before, *::after { box-sizing: inherit; }
html, body { height: 100%; }
html { box-sizing: border-box; overflow: hidden; }
body { overflow: auto; }
*,
*::before,
*::after {
box-sizing: inherit;
}
html,
body {
height: 100%;
}
html {
box-sizing: border-box;
overflow: hidden;
}
body {
overflow: auto;
overflow-x: hidden;
}

:root {
--font-text: 'Inter', sans-serif;
--font-code: 'Fira Mono', monospace;
--font-text: "Inter", sans-serif;
--font-code: "Fira Mono", monospace;

--bg-base: #fafed7;
--bg-dark: #2f2f2f;
--bg-overlay: #000000cf;
Expand All @@ -15,16 +28,16 @@ body { overflow: auto; }
--bg-surface: #f8f9fa;
--bg-overflow: #dee2e6;
--bg-btn-inactive: #434343;
--bg-btn-inactive-dark: #2e2e2e;
--bg-btn-inactive-dark: #2e2e2e;

--fg-muted: #9d9d9d;
--fg-muted-on-accent: #8fcabb;
--error: #e03131;
--accent: #078969;
--accent-light: #80c3a0;
--accent-dark: #136853;
--fg-switch-low: #515151;
--fg-switch-high: #f3f3f3;
--fg-switch-high: #f3f3f3;

--cursor-interactive: default;
--line-height-copy: 1.5;
Expand All @@ -47,19 +60,41 @@ a:hover {
}

@keyframes shake {
0% { transform: translate(2px, 1px) rotate(0deg); }
10% { transform: translate(-1px, -2px) rotate(-1deg); }
20% { transform: translate(-3px, 0px) rotate(1deg); }
30% { transform: translate(0px, 2px) rotate(0deg); }
40% { transform: translate(1px, -1px) rotate(1deg); }
50% { transform: translate(-1px, 2px) rotate(-1deg); }
60% { transform: translate(-3px, 1px) rotate(0deg); }
70% { transform: translate(2px, 1px) rotate(-1deg); }
80% { transform: translate(-1px, -1px) rotate(1deg); }
90% { transform: translate(2px, 2px) rotate(0deg); }
100% { transform: translate(1px, -2px) rotate(-1deg); }
0% {
transform: translate(2px, 1px) rotate(0deg);
}
10% {
transform: translate(-1px, -2px) rotate(-1deg);
}
20% {
transform: translate(-3px, 0px) rotate(1deg);
}
30% {
transform: translate(0px, 2px) rotate(0deg);
}
40% {
transform: translate(1px, -1px) rotate(1deg);
}
50% {
transform: translate(-1px, 2px) rotate(-1deg);
}
60% {
transform: translate(-3px, 1px) rotate(0deg);
}
70% {
transform: translate(2px, 1px) rotate(-1deg);
}
80% {
transform: translate(-1px, -1px) rotate(1deg);
}
90% {
transform: translate(2px, 2px) rotate(0deg);
}
100% {
transform: translate(1px, -2px) rotate(-1deg);
}
}

.shake {
animation-name: shake;
animation-duration: 0.5s;
Expand All @@ -85,4 +120,4 @@ a:hover {

.grecaptcha-badge {
visibility: hidden;
}
}
1 change: 1 addition & 0 deletions src/pages/index.astro
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ if (session && session.session.full) {
<title>Sprig</title>
</head>
<body>

<Navbar transparent goldLogo session={session} />

<div class='magic' id='m'>
Expand Down

1 comment on commit 60c9d11

@vercel
Copy link

@vercel vercel bot commented on 60c9d11 Dec 15, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Successfully deployed to the following URLs:

sprig – ./

gamelab.hackclub.com
sprig-git-main.hackclub.dev
sprig.hackclub.com
sprig-beta.hackclub.dev

Please sign in to comment.