From 3df29a3cf38d123beacd4f49377d2b2d21169c38 Mon Sep 17 00:00:00 2001
From: fef
Date: Fri, 16 Dec 2022 02:05:06 +0100
Subject: [PATCH] web: add dummy timeline
---
src/web/app.ts | 82 ++++++++++++++++++-
.../components/{header-bar.ts => nav-bar.ts} | 40 ++++++---
src/web/components/tl-note.ts | 27 ++++++
src/web/data/types.ts | 18 ++++
src/web/features/timed-line.ts | 32 ++++++++
src/web/layout/scroll-list.ts | 5 +-
6 files changed, 184 insertions(+), 20 deletions(-)
rename src/web/components/{header-bar.ts => nav-bar.ts} (83%)
create mode 100644 src/web/components/tl-note.ts
create mode 100644 src/web/data/types.ts
create mode 100644 src/web/features/timed-line.ts
diff --git a/src/web/app.ts b/src/web/app.ts
index 8c2ee89..2dc3bae 100644
--- a/src/web/app.ts
+++ b/src/web/app.ts
@@ -5,11 +5,13 @@ import {msg, str} from "@lit/localize";
import {aboutURL, sourceURL, version} from "./config";
import withSharedStyles from "./theme";
-import "./components/header-bar";
+import "./components/nav-bar";
import "./features/compose-form";
+import "./features/timed-line";
import "./layout/column-layout";
import "./layout/scroll-list";
import "./layout/side-panel";
+import {Account, Note} from "./data/types";
@customElement("nyano-blog")
export default class NyanoBlog extends LitElement {
@@ -30,8 +32,10 @@ export default class NyanoBlog extends LitElement {
-
-
+
@@ -66,6 +70,78 @@ export default class NyanoBlog extends LitElement {
footer a, footer a:visited {
color: var(--text-faint-color);
}
+
+ #main-container {
+ display: block;
+ max-width: 600px;
+ margin: auto;
+ }
+
+ @media(min-width: 1400px) {
+ .flex-spacer, #nav {
+ flex: 1;
+ }
+ #main-container {
+ display: flex;
+ flex-direction: row;
+ max-width: unset;
+ }
+ #tl {
+ width: 600px;
+ margin-left: 20px;
+ }
+ }
`);
}
}
+
+const testAccount: Account = {
+ id: "1",
+ name: "fef",
+ domain: "localhost",
+ created_at: new Date(),
+ updated_at: new Date(),
+};
+
+const testNotes: Note[] = [
+ {
+ id: "1",
+ account: testAccount,
+ content: "Lorem ipsum dolor sit amet",
+ sensitive: false,
+ created_at: new Date(),
+ updated_at: new Date(),
+ },
+ {
+ id: "2",
+ account: testAccount,
+ content: "The quick brown fox jumped over the lazy dog.",
+ sensitive: false,
+ created_at: new Date(),
+ updated_at: new Date(),
+ },
+ {
+ id: "3",
+ account: testAccount,
+ content: "hi i'm gay uwu",
+ sensitive: false,
+ created_at: new Date(),
+ updated_at: new Date(),
+ },
+ {
+ id: "4",
+ account: testAccount,
+ content: "are there any #Homosexuals #OnHere?",
+ sensitive: false,
+ created_at: new Date(),
+ updated_at: new Date(),
+ },
+ {
+ id: "5",
+ account: testAccount,
+ content: "test note 1",
+ sensitive: false,
+ created_at: new Date(),
+ updated_at: new Date(),
+ },
+];
diff --git a/src/web/components/header-bar.ts b/src/web/components/nav-bar.ts
similarity index 83%
rename from src/web/components/header-bar.ts
rename to src/web/components/nav-bar.ts
index 9b351ae..738b6d8 100644
--- a/src/web/components/header-bar.ts
+++ b/src/web/components/nav-bar.ts
@@ -6,46 +6,46 @@ import withSharedStyles from "../theme";
import "./svg-icon";
-@customElement("header-bar")
-export default class HeaderBar extends LitElement {
+@customElement("nav-bar")
+export default class NavBar extends LitElement {
protected render() {
return html`