From: Ben Beltran Date: Sun, 22 Dec 2019 23:24:21 +0000 (+0100) Subject: Add svelte frontend X-Git-Url: https://git.r.bdr.sh/rbdr/forum/commitdiff_plain/890274a7b3ac70848ba9973ef33d53ed58ff88a8?ds=sidebyside;hp=49d43aa3ace56dc28d4d2b30cafcd064e53a42d9 Add svelte frontend --- diff --git a/app/application.js b/app/application.js new file mode 100644 index 0000000..6f44869 --- /dev/null +++ b/app/application.js @@ -0,0 +1,10 @@ +import Forum from './forum.svelte'; + +const forum = new Forum({ + target: document.body, + props: { + greeting: 'yooo' + } +}); + +export default forum; diff --git a/app/components/forum_list/forum_list.svelte b/app/components/forum_list/forum_list.svelte new file mode 100644 index 0000000..905421e --- /dev/null +++ b/app/components/forum_list/forum_list.svelte @@ -0,0 +1,21 @@ + + + diff --git a/app/components/header/header.svelte b/app/components/header/header.svelte new file mode 100644 index 0000000..15b75b8 --- /dev/null +++ b/app/components/header/header.svelte @@ -0,0 +1,11 @@ +
+ +
diff --git a/app/css/style.css b/app/css/style.css new file mode 100644 index 0000000..e69de29 diff --git a/app/forum.svelte b/app/forum.svelte new file mode 100644 index 0000000..99ce5a8 --- /dev/null +++ b/app/forum.svelte @@ -0,0 +1,35 @@ + + +
+

Is this really what the forum looks like?

+

+ Posted on Interaction. + 3 days remaining. +

+

+ Tags: + question(5) + meta(34) + carrots(1) + tpbo(2) +

+
+
+ + +

So, I’m new here and I had heard a lot about the forums.

Is this really it??

It has barely any features, also I think I accidentaally created a post without a board? what’s up with that??

+
+
+
+
+ + + diff --git a/app/index.html b/app/index.html new file mode 100644 index 0000000..7dad472 --- /dev/null +++ b/app/index.html @@ -0,0 +1,16 @@ + + + + + + + + Forum. + + + + + + + + diff --git a/app/models/forums.js b/app/models/forums.js new file mode 100644 index 0000000..211181e --- /dev/null +++ b/app/models/forums.js @@ -0,0 +1,85 @@ +import { writable } from 'svelte/store'; + +const internals = {}; + +internals.forums = [ + { + id: 'life', + kanji: '命', + label: 'Life' + }, + { + id: 'the-world', + kanji: '世', + label: 'The World' + }, + { + id: 'online', + kanji: '直結', + label: 'Online' + }, + { + id: 'experience', + kanji: '体験', + label: 'Experience' + }, + { + id: 'belief', + kanji: '信念', + label: 'Belief' + }, + { + id: 'movement', + kanji: '動', + label: 'Movement' + }, + { + id: 'emotion', + kanji: '情', + label: 'Emotion' + }, + { + id: 'interaction', + kanji: '交流', + label: 'Interaction' + }, + { + id: 'structure', + kanji: '構造', + label: 'Structure' + }, + { + id: 'sound', + kanji: '音', + label: 'Sound' + }, + { + id: 'words', + kanji: '言葉', + label: 'Words' + }, + { + id: 'us', + kanji: '一同', + label: 'Us' + }, + { + id: 'everything', + kanji: '何事も', + label: 'Everything' + } +]; + +export const forums = writable(internals.forums); + +export function addForum() { + const id = Math.random(); + + forums.update((forums) => ([...forums, + { + id, + kanji: 'の', + label: `Woah ${id}` + } + ])); +};