mirror of
https://github.com/System-End/site.git
synced 2026-04-19 20:55:09 +00:00
Add expiring warning
This commit is contained in:
parent
9a1150c008
commit
ce3b6b1821
1 changed files with 11 additions and 1 deletions
12
pages/bin.js
12
pages/bin.js
|
|
@ -154,6 +154,15 @@ function crunch() {
|
|||
audio.play()
|
||||
}
|
||||
|
||||
const ExpiresAt = ({ children, expirationDate = new Date() - 1 }) => {
|
||||
console.log(expirationDate, new Date())
|
||||
if (expirationDate > new Date()) {
|
||||
return children
|
||||
} else {
|
||||
return null
|
||||
}
|
||||
}
|
||||
|
||||
function spinIt(el) {
|
||||
el.classList.add("spin");
|
||||
setTimeout(() => el.classList.remove("spin"), 500);
|
||||
|
|
@ -182,14 +191,15 @@ export default function Bin() {
|
|||
<Box sx={{ background: 'url(https://cloud-jxq5r0yyp-hack-club-bot.vercel.app/0bg.png)', backgroundSize: 'cover', py: '3em' }}>
|
||||
<Container sx={{ position: 'relative' }}>
|
||||
<Box as="section" sx={{ textAlign: 'center', pt: '4em', overflow: 'hidden' }}>
|
||||
<ExpiresAt expirationDate={new Date(2024, 3, 13)}>
|
||||
<Box sx={{ mt: 3 }}>
|
||||
|
||||
<Announcement
|
||||
copy="Please pardon our dust!"
|
||||
caption="You found us a little early! We're still building this page, but you can RSVP early."
|
||||
iconLeft="welcome"
|
||||
/>
|
||||
</Box>
|
||||
</ExpiresAt>
|
||||
<Box sx={{
|
||||
'@media (prefers-reduced-motion: no-preference)': {
|
||||
animation: `${wobble} 0.5s ease-in-out infinite alternate`
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue