From dee38835374839eb62e56f0ede64df0ac0b7fd09 Mon Sep 17 00:00:00 2001 From: octospacc Date: Sat, 22 Apr 2023 10:06:31 +0200 Subject: [PATCH] Upd --- Source/ApiTransform.js | 5 +++-- Source/FakeApi.js | 4 ++++ Source/Main.js | 30 ++++++++++++++---------------- Source/Style.css | 14 +++++++++++++- 4 files changed, 34 insertions(+), 19 deletions(-) diff --git a/Source/ApiTransform.js b/Source/ApiTransform.js index 40c249c..6d6e88d 100644 --- a/Source/ApiTransform.js +++ b/Source/ApiTransform.js @@ -66,10 +66,11 @@ ApiSchema.Channel = CopyObj(ApiSchema.__Account__); var TransParsers = { Mastodon: { - /* Account(Data) { - return JsonTransformA(Data, TransSchemas.Mastodon.Author, TransSchemas.Mastodon); + //return JsonTransformA(Data, TransSchemas.Mastodon.Author, TransSchemas.Mastodon); + return JsonTransformB(Data, ApiSchema, ApiSchema.Author, 'Mastodon'); }, + /* Instance(Data) { return JsonTransformA(Data, TransSchemas.Mastodon.Instance, TransSchemas.Mastodon); }, diff --git a/Source/FakeApi.js b/Source/FakeApi.js index 531ae13..80dece3 100644 --- a/Source/FakeApi.js +++ b/Source/FakeApi.js @@ -14,11 +14,13 @@ FakeApi.Friendiiverse.Featured.Featured.push({ Banner: "https://picsum.photos/seed/Testing.Banner/320/180", Icon: "https://picsum.photos/seed/Testing.Icon/64", Name: "Testing Channel", + Url: "https://lemmy.example.com/c/Testing", }); FakeApi.Friendiiverse.Featured.Categories.push({ Banner: "https://picsum.photos/seed/fediverse.Banner/320/180", Icon: "https://picsum.photos/seed/fediverse.Icon/64", Name: "#fediverse", + Url: "https://mastodon.example.com/hashtag/fediverse", }); FakeApi.Mastodon.Account = { @@ -27,6 +29,8 @@ FakeApi.Mastodon.Account = { header: "https://picsum.photos/seed/Tester.Banner/320/180", url: "https://mastodon.example.com/@Tester", }; +FakeApi.Friendiiverse.Featured.Featured.push( + TransParsers.Mastodon.Account(FakeApi.Mastodon.Account)); FakeApi.Mastodon.Status = { account: FakeApi.Mastodon.Account, diff --git a/Source/Main.js b/Source/Main.js index c2a8255..ad7328a 100644 --- a/Source/Main.js +++ b/Source/Main.js @@ -108,20 +108,18 @@ function MakeWindow(Attrs) { }; function DisplayChannel(Channel) { - //DoAsync(FetchMastodon, FillTimeline); - ChannelView.innerHTML = ` -
- -
- -
-
- - ${Channel.Name} -
-
-
- `; + var Window = MakeWindow({className: "Channel"}); + Window.innerHTML += `
+ +
+ +
+
+ + ${Channel.Name} +
+
+
`; }; function FetchMastodon(Proc) { @@ -163,7 +161,7 @@ function FillFeatured(Categories) { Object.values(Categories).forEach(function(Channels){ Channels.forEach(function(Channel){ Window.innerHTML += `
- +
@@ -201,4 +199,4 @@ PlazasView.innerHTML = ` */ DoAsync(FetchFeatured, FillFeatured); - +CoverView.remove(); diff --git a/Source/Style.css b/Source/Style.css index 96adecb..577435f 100644 --- a/Source/Style.css +++ b/Source/Style.css @@ -3,7 +3,7 @@ img, video { } #Root { - margin-bottom: 2em; + /*margin-bottom: 2em;*/ } #Bottom { @@ -20,6 +20,18 @@ img, video { white-space: break-spaces; } +.Window { + background: white; + position: absolute; + + width: 100%; + max-width: 100%; + min-width: 100%; + + min-height: calc(100% - 4em); + padding-bottom: 2em; +} + .View.Note { border: 4px solid purple; margin: 12px;