diff --git a/docs/.vitepress/theme/custom.css b/docs/.vitepress/theme/custom.css index 9abb209f..624c3ff4 100644 --- a/docs/.vitepress/theme/custom.css +++ b/docs/.vitepress/theme/custom.css @@ -29,14 +29,85 @@ font-weight: 600; } -#email-address { +.gui-toast-group { + position: fixed; + z-index: 1; + inset-block-end: 0; + inset-inline: 0; + padding-block-end: 5vh; +} + +.gui-toast-group { + display: grid; + justify-items: center; + justify-content: center; + gap: 1vh; +} + +.gui-toast { + max-inline-size: min(25ch, 90vw); + padding-block: .5ch; + padding-inline: 1ch; + border-radius: 3px; + font-size: 1rem; +} + +.gui-toast-group { + pointer-events: none; +} + +.gui-toast { + --_bg-lightness: 90%; + + color: black; + background: hsl(0 0% var(--_bg-lightness) / 90%); +} + +:root.dark .gui-toast { + color: white; + --_bg-lightness: 20%; +} + +@keyframes fade-in { + from { opacity: 0 } +} + +@keyframes fade-out { + to { opacity: 0 } +} + +@keyframes slide-in { + from { transform: translateY(var(--_travel-distance, 10px)) } +} + +.gui-toast { + --_duration: 3s; + --_travel-distance: 0; + + will-change: transform; + animation: + fade-in .3s ease, + slide-in .3s ease, + fade-out .3s ease var(--_duration); +} + +@media (prefers-reduced-motion: no-preference) { + .gui-toast { + --_travel-distance: 5vh; + } +} + +#email { font-size: 1rem; margin: 1rem 3rem 3rem 3rem; border-radius: 1rem; padding: 0.8rem; - background-color: rgb(22, 22, 24); + background-color: rgb(220, 220, 220); } +:root.dark #email { + background-color: rgb(22, 22, 24); +} #call-to-action { font-size: 1.5rem; diff --git a/docs/index.md b/docs/index.md index 46c1e3d7..13b448fe 100644 --- a/docs/index.md +++ b/docs/index.md @@ -56,10 +56,15 @@ async function subscribe(e) { if (json.error) { throw new Error(json.error); } - obj.value = {type: 'Success', message : 'Subscribed'}; - setTimeout(() => acknowledge(), 3000); + if (json.message) { + obj.value = {type: 'Success', message : json.message}; + } else { + obj.value = {type: 'Success', message : "Noted, You'll receive an email to confirm your subscription"}; + } } catch (e) { obj.value = { type: 'Error', message: e.message || '' + e }; + } finally { + setTimeout(() => acknowledge(), 5000); } } @@ -67,32 +72,29 @@ async function subscribe(e) {
-
-

- Subscribe for updates on Stratagems! + +

+ {{obj.message}} + {{obj.message}} +
+ + + +

+ Subscribe for updates on Stratagems and more from Etherplay!

-
- - + + + - -
-
+ +
+