aboutsummaryrefslogtreecommitdiff
path: root/static/pages/main
diff options
context:
space:
mode:
Diffstat (limited to 'static/pages/main')
-rw-r--r--static/pages/main/index.css70
-rw-r--r--static/pages/main/index.js98
2 files changed, 0 insertions, 168 deletions
diff --git a/static/pages/main/index.css b/static/pages/main/index.css
deleted file mode 100644
index 21d5022..0000000
--- a/static/pages/main/index.css
+++ /dev/null
@@ -1,70 +0,0 @@
-
-:host {
- display: grid;
- height: 100%;
- width: 100%;
- background: var(--page-background);
-}
-
-#bar {
- position: fixed;
- bottom: 5px;
- left: 5px;
- right: 5px;
- background: #fff9;
- box-shadow: #223223aa 1px 1px 4px;
- display: grid;
- grid-template-columns: 1fr 1fr 1fr 1fr 1fr ;
- height: 50px;
- backdrop-filter: blur(10px);
- border-radius: var(--border-radius);
- transition: bottom 0.2s ease;
- max-width: 600px;
- margin: 0 auto;
-}
-
-#bar.hidden {
- bottom: -200px;
-}
-
-.menu-button {
- color: var(--fg-disabled);
- width: 18px;
- height: 18px;
- border-radius: 100%;
- margin: auto;
- cursor: pointer;
- user-select: none;
- align-content: center;
- text-align: center;
-}
-
-.menu-button.add {
- width: 60px;
- height: 60px;
- margin-top: -20px;
- background: var(--primary);
- color: var(--card-background);
- font-weight: bold;
- font-size: 2em;
-}
-
-.menu-button.add .icon {
- width: 30px;
- height: 30px;
- display: grid;
- margin: auto;
-}
-
-.menu-button.add .icon .bi-house-fill {
- width: 20px;
- height: 20px;
- margin: auto;
-}
-
-.menu-button .icon {
- width: 100%;
- height: 100%;
- display: grid;
- margin: auto;
-}
diff --git a/static/pages/main/index.js b/static/pages/main/index.js
deleted file mode 100644
index b0a13f6..0000000
--- a/static/pages/main/index.js
+++ /dev/null
@@ -1,98 +0,0 @@
-import icons from 'icons';
-import * as sfw from 'sfw';
-const { Div, Input } = sfw.element.native;
-
-import stylesheet from './index.css';
-
-const css = await sfw.css.sheet(stylesheet);
-
-export default class MainView extends sfw.element.Container {
- #active_kind
- #active_button
- #active_view
- #bar
-
- static Kind = Object.freeze({
- 'upload': 0,
- 'home': 1,
- });
-
- constructor() {
- super({ css });
-
- this.onsearch = () => {}
- this.onmonth = () => {}
- this.onupload = () => {}
- this.onshuffle = () => {}
- this.onhome = () => {}
-
- this.body.append(
- this.#active_view = Div.new({ id: 'main' }),
-
- this.#bar = Div.new({
- id: 'bar',
- children: [
- Div.new({
- className: 'menu-button',
- children: [ icons.search ],
- onclick: (e) => {
- e.stopPropagation();
- this.onsearch();
- }
- }),
-
- Div.new({
- className: 'menu-button',
- children: [ icons.calendar ],
- onclick: () => this.onmonth(),
- }),
-
- this.#active_button = Div.new({
- className: 'menu-button add',
- children: [ icons.add ],
- onclick: () => this.onupload()
- }),
-
- Div.new({
- className: 'menu-button',
- children: [ icons.shuffle ],
- onclick: () => this.onshuffle(),
- }),
-
- Div.new({
- className: 'menu-button',
- children: [ icons.settings ],
- onclick: () => this.onsettings(),
- }),
- ],
- }),
- );
- }
-
- hide() {
- this.#bar.classList.add('hidden');
- }
-
- show() {
- this.#bar.classList.remove('hidden');
- }
-
- set active_view(element) {
- this.#active_view.innerHTML = '';
- this.#active_view.append(element);
- }
-
- set active_kind(kind) {
- if (kind == MainView.Kind.home) {
- this.#active_button.innerHTML = '';
- this.#active_button.append(icons.home);
- this.#active_button.onclick = () => this.onhome();
- } else if (kind == MainView.Kind.upload) {
- this.#active_button.innerHTML = '';
- this.#active_button.append(icons.add);
- this.#active_button.onclick = () => this.onupload();
- } else {
- console.error(`invalid kind ${kind}`);
- }
- }
-}