diff --git a/frontend-reactive/app/components/note.hbs b/frontend-reactive/app/components/note.hbs index 81c6cdd..a80562f 100644 --- a/frontend-reactive/app/components/note.hbs +++ b/frontend-reactive/app/components/note.hbs @@ -3,6 +3,7 @@
diff --git a/frontend-reactive/app/components/note/formatter.hbs b/frontend-reactive/app/components/note/formatter.hbs new file mode 100644 index 0000000..f65a5de --- /dev/null +++ b/frontend-reactive/app/components/note/formatter.hbs @@ -0,0 +1,15 @@ +
+{{#if (equals @server "mastodon")}} +{{ @content }}Masto +{{else if (equals @server "misskey")}} + {{ @content }}Misskey +{{else if (equals @server "akoma")}} + {{ @content }}Akoma +{{else if (equals @server "linstrom")}} + {{ @content }}Linstrom +{{else if (equals @server "wafrn")}} + {{ @content }}Wafrn +{{else}} + {{ @content }}Unkown:{{@server}} +{{/if}} +
diff --git a/frontend-reactive/app/components/note/formatter/akoma.hbs b/frontend-reactive/app/components/note/formatter/akoma.hbs new file mode 100644 index 0000000..fb5c4b1 --- /dev/null +++ b/frontend-reactive/app/components/note/formatter/akoma.hbs @@ -0,0 +1 @@ +{{yield}} \ No newline at end of file diff --git a/frontend-reactive/app/components/note/formatter/akoma.ts b/frontend-reactive/app/components/note/formatter/akoma.ts new file mode 100644 index 0000000..ac45df0 --- /dev/null +++ b/frontend-reactive/app/components/note/formatter/akoma.ts @@ -0,0 +1,14 @@ +import Component from '@glimmer/component'; + +export interface NoteFormatterAkomaSignature { + // The arguments accepted by the component + Args: {}; + // Any blocks yielded by the component + Blocks: { + default: []; + }; + // The element to which `...attributes` is applied in the component template + Element: null; +} + +export default class NoteFormatterAkoma extends Component {} diff --git a/frontend-reactive/app/components/note/formatter/linstrom.hbs b/frontend-reactive/app/components/note/formatter/linstrom.hbs new file mode 100644 index 0000000..fb5c4b1 --- /dev/null +++ b/frontend-reactive/app/components/note/formatter/linstrom.hbs @@ -0,0 +1 @@ +{{yield}} \ No newline at end of file diff --git a/frontend-reactive/app/components/note/formatter/linstrom.ts b/frontend-reactive/app/components/note/formatter/linstrom.ts new file mode 100644 index 0000000..727be58 --- /dev/null +++ b/frontend-reactive/app/components/note/formatter/linstrom.ts @@ -0,0 +1,14 @@ +import Component from '@glimmer/component'; + +export interface NoteFormatterLinstromSignature { + // The arguments accepted by the component + Args: {}; + // Any blocks yielded by the component + Blocks: { + default: []; + }; + // The element to which `...attributes` is applied in the component template + Element: null; +} + +export default class NoteFormatterLinstrom extends Component {} diff --git a/frontend-reactive/app/components/note/formatter/mastodon.hbs b/frontend-reactive/app/components/note/formatter/mastodon.hbs new file mode 100644 index 0000000..fb5c4b1 --- /dev/null +++ b/frontend-reactive/app/components/note/formatter/mastodon.hbs @@ -0,0 +1 @@ +{{yield}} \ No newline at end of file diff --git a/frontend-reactive/app/components/note/formatter/mastodon.ts b/frontend-reactive/app/components/note/formatter/mastodon.ts new file mode 100644 index 0000000..93bd0bd --- /dev/null +++ b/frontend-reactive/app/components/note/formatter/mastodon.ts @@ -0,0 +1,14 @@ +import Component from '@glimmer/component'; + +export interface NoteFormatterMastodonSignature { + // The arguments accepted by the component + Args: {}; + // Any blocks yielded by the component + Blocks: { + default: []; + }; + // The element to which `...attributes` is applied in the component template + Element: null; +} + +export default class NoteFormatterMastodon extends Component {} diff --git a/frontend-reactive/app/components/note/formatter/misskey.hbs b/frontend-reactive/app/components/note/formatter/misskey.hbs new file mode 100644 index 0000000..fb5c4b1 --- /dev/null +++ b/frontend-reactive/app/components/note/formatter/misskey.hbs @@ -0,0 +1 @@ +{{yield}} \ No newline at end of file diff --git a/frontend-reactive/app/components/note/formatter/misskey.ts b/frontend-reactive/app/components/note/formatter/misskey.ts new file mode 100644 index 0000000..6408bc0 --- /dev/null +++ b/frontend-reactive/app/components/note/formatter/misskey.ts @@ -0,0 +1,14 @@ +import Component from '@glimmer/component'; + +export interface NoteFormatterMisskeySignature { + // The arguments accepted by the component + Args: {}; + // Any blocks yielded by the component + Blocks: { + default: []; + }; + // The element to which `...attributes` is applied in the component template + Element: null; +} + +export default class NoteFormatterMisskey extends Component {} diff --git a/frontend-reactive/app/components/note/formatter/wafrn.hbs b/frontend-reactive/app/components/note/formatter/wafrn.hbs new file mode 100644 index 0000000..fb5c4b1 --- /dev/null +++ b/frontend-reactive/app/components/note/formatter/wafrn.hbs @@ -0,0 +1 @@ +{{yield}} \ No newline at end of file diff --git a/frontend-reactive/app/components/note/formatter/wafrn.ts b/frontend-reactive/app/components/note/formatter/wafrn.ts new file mode 100644 index 0000000..5a3f40e --- /dev/null +++ b/frontend-reactive/app/components/note/formatter/wafrn.ts @@ -0,0 +1,14 @@ +import Component from '@glimmer/component'; + +export interface NoteFormatterWafrnSignature { + // The arguments accepted by the component + Args: {}; + // Any blocks yielded by the component + Blocks: { + default: []; + }; + // The element to which `...attributes` is applied in the component template + Element: null; +} + +export default class NoteFormatterWafrn extends Component {} diff --git a/frontend-reactive/app/components/note/user-header.hbs b/frontend-reactive/app/components/note/user-header.hbs index e7f0bf3..b75d04b 100644 --- a/frontend-reactive/app/components/note/user-header.hbs +++ b/frontend-reactive/app/components/note/user-header.hbs @@ -3,7 +3,8 @@

Pfp

-

{{@displayname}}

+ +

{{@handle}}

\ No newline at end of file diff --git a/frontend-reactive/app/components/timeline.hbs b/frontend-reactive/app/components/timeline.hbs index a43e192..ba12500 100644 --- a/frontend-reactive/app/components/timeline.hbs +++ b/frontend-reactive/app/components/timeline.hbs @@ -1,5 +1,6 @@
{{#each @notes as |note|}} +
{{/each}}
\ No newline at end of file diff --git a/frontend-reactive/app/helpers/equals.ts b/frontend-reactive/app/helpers/equals.ts new file mode 100644 index 0000000..6655fbe --- /dev/null +++ b/frontend-reactive/app/helpers/equals.ts @@ -0,0 +1,6 @@ +import { helper } from '@ember/component/helper'; + +export default helper(function equals(args) { + if (args.length != 2) return false; + return args[0] == args[1]; +}); diff --git a/frontend-reactive/app/routes/application.ts b/frontend-reactive/app/routes/application.ts index a8f4733..e7996a2 100644 --- a/frontend-reactive/app/routes/application.ts +++ b/frontend-reactive/app/routes/application.ts @@ -19,6 +19,7 @@ export default class ApplicationRoute extends Route { content: 'lorem ipsum', createdAt: Date.now() - 360000, editedAt: Date.now() - 60000, + servertype: 'mastodon', }, { displayname: 'Melody', @@ -27,6 +28,7 @@ export default class ApplicationRoute extends Route { content: 'Grapple keel reef fathom haul wind bilge rat swing the lead belay line pink. Man-of-war mizzenmast killick lookout yo-ho-ho Sail ho gabion careen sutler stern. Draught wherry lookout schooner prow hail-shot spanker Letter of Marque lateen sail strike colors.\n\nLad heave to topgallant scallywag scuppers Spanish Main poop deck spike hulk broadside. Snow take a caulk hornswaggle gaff swab quarter lugger spanker bilge provost. Man-of-war measured fer yer chains lugger cable loaded to the gunwalls prow piracy snow doubloon furl.\n\nDead men tell no tales jib chase guns gunwalls Gold Road smartly nipperkin topsail bilge water Pirate Round. Gaff gunwalls bilged on her anchor bilge water scourge of the seven seas parley ho sheet chase guns squiffy. Scuppers fathom ho quarter gally heave to yardarm coxswain red ensign pink.', createdAt: Date.now() - 3600, + servertype: 'linstrom', }, { displayname: 'alice', @@ -35,6 +37,7 @@ export default class ApplicationRoute extends Route { content: 'lorem ipsum', createdAt: Date.now() - 360000, editedAt: Date.now() - 60000, + servertype: 'wafrn', }, { displayname: 'Melody', @@ -43,6 +46,7 @@ export default class ApplicationRoute extends Route { content: 'Grapple keel reef fathom haul wind bilge rat swing the lead belay line pink. Man-of-war mizzenmast killick lookout yo-ho-ho Sail ho gabion careen sutler stern. Draught wherry lookout schooner prow hail-shot spanker Letter of Marque lateen sail strike colors.\n\nLad heave to topgallant scallywag scuppers Spanish Main poop deck spike hulk broadside. Snow take a caulk hornswaggle gaff swab quarter lugger spanker bilge provost. Man-of-war measured fer yer chains lugger cable loaded to the gunwalls prow piracy snow doubloon furl.\n\nDead men tell no tales jib chase guns gunwalls Gold Road smartly nipperkin topsail bilge water Pirate Round. Gaff gunwalls bilged on her anchor bilge water scourge of the seven seas parley ho sheet chase guns squiffy. Scuppers fathom ho quarter gally heave to yardarm coxswain red ensign pink.', createdAt: Date.now() - 3600, + servertype: 'unknown', }, ], }; diff --git a/frontend-reactive/app/services/authentication.ts b/frontend-reactive/app/services/authentication.ts deleted file mode 100644 index 27fb3ee..0000000 --- a/frontend-reactive/app/services/authentication.ts +++ /dev/null @@ -1,13 +0,0 @@ -import Service from '@ember/service' - -export default class AuthenticationService extends Service {} - -// Don't remove this declaration: this is what enables TypeScript to resolve -// this service using `Owner.lookup('service:authentication')`, as well -// as to check when you pass the service name as an argument to the decorator, -// like `@service('authentication') declare altName: AuthenticationService;`. -declare module '@ember/service' { - interface Registry { - authentication: AuthenticationService - } -} diff --git a/frontend-reactive/app/styles/app.css b/frontend-reactive/app/styles/app.css index 65ad598..7631e2d 100644 --- a/frontend-reactive/app/styles/app.css +++ b/frontend-reactive/app/styles/app.css @@ -1,7 +1,10 @@ /* Ember supports plain CSS out of the box. More info: https://cli.emberjs.com/release/advanced-use/stylesheets/ */ + +/* @import url("debug.css"); */ @import url("fonts.css"); @import url("colors.css"); @import url("notes.css"); @import url("util.css"); @import url("svgs.css"); @import url("timeline.css"); +@import url("auth.css"); diff --git a/frontend-reactive/app/styles/auth.css b/frontend-reactive/app/styles/auth.css new file mode 100644 index 0000000..e69de29 diff --git a/frontend-reactive/app/styles/debug.css b/frontend-reactive/app/styles/debug.css new file mode 100644 index 0000000..386047b --- /dev/null +++ b/frontend-reactive/app/styles/debug.css @@ -0,0 +1,3 @@ +* { + border: red 1px dashed; +} diff --git a/frontend-reactive/app/styles/notes.css b/frontend-reactive/app/styles/notes.css index ae160a0..eb6aa0a 100644 --- a/frontend-reactive/app/styles/notes.css +++ b/frontend-reactive/app/styles/notes.css @@ -6,12 +6,12 @@ height: fit-content; /* align-items: center; */ - border: 1px dashed red; /* max-width: 50em; */ padding: 0.5em; background-color: var(--background-100); color: var(--text); + border-radius: 1em; } .note-user-header { @@ -23,7 +23,6 @@ } .note-user-pfp { - border: 1px dashed red; width: 3em; height: 3em; padding-bottom: 0.1em; @@ -44,7 +43,7 @@ } .note-user-handle { - /* font-size: 85%; */ + font-size: 0.8em; color: #555; margin: 0; } @@ -55,7 +54,7 @@ } .note-timestamp { - /* font-size: 0.8em; */ + font-size: 0.8em; margin: -0.1em; color: var(--text-700); } @@ -65,11 +64,9 @@ flex-direction: column; width: fit-content; align-items: center; - border: 1px dashed red; } .note-content-text { - border: 1px dashed red; margin-top: -0.08em; margin-bottom: -0.08em; padding: 0.2em; @@ -80,7 +77,7 @@ margin-bottom: 0.3em; cursor: pointer; background-color: var(--secondary-300); - padding: 0.1em 0.3em 0.2em; + padding: 0.1em 0.3em; border-radius: 8px; border: 1px solid #aaa; } @@ -93,7 +90,7 @@ display: flex; flex-direction: row; align-items: center; - border-top: 1px solid black; + border-top: 1px solid var(--text-300); padding-top: 0.5em; } diff --git a/frontend-reactive/app/styles/timeline.css b/frontend-reactive/app/styles/timeline.css index 79374b6..619c8e7 100644 --- a/frontend-reactive/app/styles/timeline.css +++ b/frontend-reactive/app/styles/timeline.css @@ -5,3 +5,7 @@ scroll-behavior: smooth; overflow-y: scroll; } + +.timeline-separator { + color: var(--text-400); +} diff --git a/frontend-reactive/bun.lockb b/frontend-reactive/bun.lockb index ba06749..df6f626 100755 Binary files a/frontend-reactive/bun.lockb and b/frontend-reactive/bun.lockb differ diff --git a/frontend-reactive/tests/integration/components/note/formatter-test.ts b/frontend-reactive/tests/integration/components/note/formatter-test.ts new file mode 100644 index 0000000..194ac9e --- /dev/null +++ b/frontend-reactive/tests/integration/components/note/formatter-test.ts @@ -0,0 +1,26 @@ +import { module, test } from 'qunit'; +import { setupRenderingTest } from 'frontend-reactive/tests/helpers'; +import { render } from '@ember/test-helpers'; +import { hbs } from 'ember-cli-htmlbars'; + +module('Integration | Component | note/formatter', function (hooks) { + setupRenderingTest(hooks); + + test('it renders', async function (assert) { + // Set any properties with this.set('myProperty', 'value'); + // Handle any actions with this.set('myAction', function(val) { ... }); + + await render(hbs``); + + assert.dom().hasText(''); + + // Template block usage: + await render(hbs` + + template block text + + `); + + assert.dom().hasText('template block text'); + }); +}); diff --git a/frontend-reactive/tests/integration/components/note/formatter/akoma-test.ts b/frontend-reactive/tests/integration/components/note/formatter/akoma-test.ts new file mode 100644 index 0000000..1b2852e --- /dev/null +++ b/frontend-reactive/tests/integration/components/note/formatter/akoma-test.ts @@ -0,0 +1,26 @@ +import { module, test } from 'qunit'; +import { setupRenderingTest } from 'frontend-reactive/tests/helpers'; +import { render } from '@ember/test-helpers'; +import { hbs } from 'ember-cli-htmlbars'; + +module('Integration | Component | note/formatter/akoma', function (hooks) { + setupRenderingTest(hooks); + + test('it renders', async function (assert) { + // Set any properties with this.set('myProperty', 'value'); + // Handle any actions with this.set('myAction', function(val) { ... }); + + await render(hbs``); + + assert.dom().hasText(''); + + // Template block usage: + await render(hbs` + + template block text + + `); + + assert.dom().hasText('template block text'); + }); +}); diff --git a/frontend-reactive/tests/integration/components/note/formatter/linstrom-test.ts b/frontend-reactive/tests/integration/components/note/formatter/linstrom-test.ts new file mode 100644 index 0000000..c8fb533 --- /dev/null +++ b/frontend-reactive/tests/integration/components/note/formatter/linstrom-test.ts @@ -0,0 +1,26 @@ +import { module, test } from 'qunit'; +import { setupRenderingTest } from 'frontend-reactive/tests/helpers'; +import { render } from '@ember/test-helpers'; +import { hbs } from 'ember-cli-htmlbars'; + +module('Integration | Component | note/formatter/linstrom', function (hooks) { + setupRenderingTest(hooks); + + test('it renders', async function (assert) { + // Set any properties with this.set('myProperty', 'value'); + // Handle any actions with this.set('myAction', function(val) { ... }); + + await render(hbs``); + + assert.dom().hasText(''); + + // Template block usage: + await render(hbs` + + template block text + + `); + + assert.dom().hasText('template block text'); + }); +}); diff --git a/frontend-reactive/tests/integration/components/note/formatter/mastodon-test.ts b/frontend-reactive/tests/integration/components/note/formatter/mastodon-test.ts new file mode 100644 index 0000000..2b2f35d --- /dev/null +++ b/frontend-reactive/tests/integration/components/note/formatter/mastodon-test.ts @@ -0,0 +1,26 @@ +import { module, test } from 'qunit'; +import { setupRenderingTest } from 'frontend-reactive/tests/helpers'; +import { render } from '@ember/test-helpers'; +import { hbs } from 'ember-cli-htmlbars'; + +module('Integration | Component | note/formatter/mastodon', function (hooks) { + setupRenderingTest(hooks); + + test('it renders', async function (assert) { + // Set any properties with this.set('myProperty', 'value'); + // Handle any actions with this.set('myAction', function(val) { ... }); + + await render(hbs``); + + assert.dom().hasText(''); + + // Template block usage: + await render(hbs` + + template block text + + `); + + assert.dom().hasText('template block text'); + }); +}); diff --git a/frontend-reactive/tests/integration/components/note/formatter/misskey-test.ts b/frontend-reactive/tests/integration/components/note/formatter/misskey-test.ts new file mode 100644 index 0000000..62c9fa7 --- /dev/null +++ b/frontend-reactive/tests/integration/components/note/formatter/misskey-test.ts @@ -0,0 +1,26 @@ +import { module, test } from 'qunit'; +import { setupRenderingTest } from 'frontend-reactive/tests/helpers'; +import { render } from '@ember/test-helpers'; +import { hbs } from 'ember-cli-htmlbars'; + +module('Integration | Component | note/formatter/misskey', function (hooks) { + setupRenderingTest(hooks); + + test('it renders', async function (assert) { + // Set any properties with this.set('myProperty', 'value'); + // Handle any actions with this.set('myAction', function(val) { ... }); + + await render(hbs``); + + assert.dom().hasText(''); + + // Template block usage: + await render(hbs` + + template block text + + `); + + assert.dom().hasText('template block text'); + }); +}); diff --git a/frontend-reactive/tests/integration/components/note/formatter/wafrn-test.ts b/frontend-reactive/tests/integration/components/note/formatter/wafrn-test.ts new file mode 100644 index 0000000..9677707 --- /dev/null +++ b/frontend-reactive/tests/integration/components/note/formatter/wafrn-test.ts @@ -0,0 +1,26 @@ +import { module, test } from 'qunit'; +import { setupRenderingTest } from 'frontend-reactive/tests/helpers'; +import { render } from '@ember/test-helpers'; +import { hbs } from 'ember-cli-htmlbars'; + +module('Integration | Component | note/formatter/wafrn', function (hooks) { + setupRenderingTest(hooks); + + test('it renders', async function (assert) { + // Set any properties with this.set('myProperty', 'value'); + // Handle any actions with this.set('myAction', function(val) { ... }); + + await render(hbs``); + + assert.dom().hasText(''); + + // Template block usage: + await render(hbs` + + template block text + + `); + + assert.dom().hasText('template block text'); + }); +}); diff --git a/frontend-reactive/tests/integration/helpers/equals-test.ts b/frontend-reactive/tests/integration/helpers/equals-test.ts new file mode 100644 index 0000000..4df0e5d --- /dev/null +++ b/frontend-reactive/tests/integration/helpers/equals-test.ts @@ -0,0 +1,17 @@ +import { module, test } from 'qunit'; +import { setupRenderingTest } from 'frontend-reactive/tests/helpers'; +import { render } from '@ember/test-helpers'; +import { hbs } from 'ember-cli-htmlbars'; + +module('Integration | Helper | equals', function (hooks) { + setupRenderingTest(hooks); + + // TODO: Replace this with your real tests. + test('it renders', async function (assert) { + this.set('inputValue', '1234'); + + await render(hbs`{{equals this.inputValue}}`); + + assert.dom().hasText('1234'); + }); +});