This commit is contained in:
octospacc 2023-04-22 10:06:31 +02:00
parent 841fe95450
commit dee3883537
4 changed files with 34 additions and 19 deletions

View File

@ -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);
},

View File

@ -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,

View File

@ -108,20 +108,18 @@ function MakeWindow(Attrs) {
};
function DisplayChannel(Channel) {
//DoAsync(FetchMastodon, FillTimeline);
ChannelView.innerHTML = `
<div class="" style="display: inline-block;">
<a href="${Channel.Url}">
<div>
<img class="" src="${Channel.Banner}"/>
</div>
<div>
<img class="" src="${Channel.Icon}"/>
${Channel.Name}
</div>
</a>
</div>
`;
var Window = MakeWindow({className: "Channel"});
Window.innerHTML += `<div class="" style="display: inline-block;">
<a href="${Channel.Url}">
<div>
<img class="" src="${Channel.Banner}"/>
</div>
<div>
<img class="" src="${Channel.Icon}"/>
${Channel.Name}
</div>
</a>
</div>`;
};
function FetchMastodon(Proc) {
@ -163,7 +161,7 @@ function FillFeatured(Categories) {
Object.values(Categories).forEach(function(Channels){
Channels.forEach(function(Channel){
Window.innerHTML += `<div data-data="${B64Obj(Channel)}">
<a href="${Channel.Url}" onclick="DisplayChannel(UnB64Obj(this.parentNode.dataset.data).Author); return false;">
<a href="${Channel.Url}" onclick="DisplayChannel(UnB64Obj(this.parentNode.dataset.data)); return false;">
<div>
<img src="${Channel.Banner}"/>
</div>
@ -201,4 +199,4 @@ PlazasView.innerHTML = `
*/
DoAsync(FetchFeatured, FillFeatured);
CoverView.remove();

View File

@ -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;