diff options
Diffstat (limited to 'static/pages/login')
| -rw-r--r-- | static/pages/login/index.css | 129 | ||||
| -rw-r--r-- | static/pages/login/index.js | 48 |
2 files changed, 177 insertions, 0 deletions
diff --git a/static/pages/login/index.css b/static/pages/login/index.css new file mode 100644 index 0000000..8a59d83 --- /dev/null +++ b/static/pages/login/index.css @@ -0,0 +1,129 @@ +#container { + background: var(--page-background); + overflow: hidden; + width: 100%; + height: 100%; +} + +#box { + position: absolute; + top: 50%; + left: 50%; + transform: translate(-50%, -50%); + max-width: 300px; + width: 100%; + padding: 20px; + box-shadow: #223223aa 1px 1px 4px; + border-radius: var(--border-radius); + background: #ffffff99; + backdrop-filter: blur(10px); + z-index: 2000; +} + +#title { + font-family: 'Pacifico'; + position: absolute; + width: 100%; + height: 100%; + text-align: center; + top: 0px; + padding-top: 50px; + font-size: 2.5em; + z-index: 1000; + text-shadow: -1px -1px 0 var(--page-background), + 1px 1px 0 var(--page-background), + 1px -1px 0 var(--page-background), + -1px 1px 0 var(--page-background); + overflow: hidden; +} + +@keyframes left-bubble { + from { + width: 0px; + height: 0px; + } + to { + width: 100vw; + height: 100vw; + } +} + +#title:before { + content: ''; + display: block; + position: absolute; + top: -30px; + left: 0px; + background: var(--primary); + transform: translate(-50%, -50%); + border-radius: 100%; + z-index: -1; + animation: left-bubble 1s normal forwards ease; + width: 100vw; + height: 100vw; +} + +@keyframes right-bubble { + from { + width: 0px; + height: 0px; + } + to { + width: 200vw; + height: 200vw; + } +} + +#title:after { + content: ''; + display: block; + position: absolute; + bottom: 55%; + right: 0px; + width: 200vw; + height: 200vw; + transform: translate(50%, 50%); + background: var(--fg); + border-radius: 100%; + z-index: -2; + animation: right-bubble 1s normal forwards ease; +} + +#form { + display: grid; + grid-template-columns: 100px auto; + max-width: 300px; + width: 100%; + margin: 0; + margin-bottom: 20px; + border-radius: 3px; + gap: 10px; +} + +#form input { + width: 100%; +} + +#form label { + margin: auto 0px; + font-weight: bold; +} + +button { + width: 100%; +} + +#subtitle { + position: absolute; + bottom: 50px; + left: 50%; + transform: translate(-50%, 0); + white-space: nowrap; + font-family: 'Pacifico'; + color: #69717d; + z-index: 1000; + text-shadow: -1px -1px 0 var(--page-background), + 1px 1px 0 var(--page-background), + 1px -1px 0 var(--page-background), + -1px 1px 0 var(--page-background); +} diff --git a/static/pages/login/index.js b/static/pages/login/index.js new file mode 100644 index 0000000..fc14dbf --- /dev/null +++ b/static/pages/login/index.js @@ -0,0 +1,48 @@ +import * as sfw from 'sfw'; +const { Div, Label, H1: Title, Input, Button } = sfw.element.native; + +const css = await sfw.css(import.meta.url, './index.css'); + +export default class LoginView extends sfw.element.Container { + #user + #password + + constructor() { + super({ css }); + + this.onlogin = () => {}; + + this.body.append( + Div.new({ + id: 'container', + children: [ + Div.new({ id: 'title', innerText: 'Memora' }), + Div.new({ + id: 'box', + children: [ + + Div.new({ + id: 'form', + children: [ + Label.new({ innerText: 'User' }), + this.#user = Input.new({ }), + + Label.new({ innerText: 'Password' }), + this.#password = Input.new({ type: 'password' }), + ] + }), + Button.new({ + innerText: 'Login', + onclick: () => this.onlogin(this.#user.value, this.#password.value), + }), + ] + }), + Div.new({ + id: 'subtitle', + innerText: 'Where nostalgia is home.', + }), + ] + }) + ); + } +} |