diff --git a/.gitignore b/.gitignore
new file mode 100644
index 0000000..07e6e47
--- /dev/null
+++ b/.gitignore
@@ -0,0 +1 @@
+/node_modules
diff --git a/style.css b/CSS/index.css
similarity index 91%
rename from style.css
rename to CSS/index.css
index 5227689..0256dc6 100644
--- a/style.css
+++ b/CSS/index.css
@@ -54,7 +54,6 @@
html {
overflow-x: hidden;
- overflow-y: hidden;
}
/* Classes for the warning section*/
@@ -111,7 +110,7 @@ html {
}
/* Classes for the main page */
-.Main {
+.MainBefore {
position: absolute;
top: 0px;
left: 0px;
@@ -119,6 +118,12 @@ html {
visibility: collapse;
}
+.MainAfter {
+ position: absolute;
+ top: 0px;
+ left: 0px;
+}
+
.MainFadeInAnimation {
animation-name: MainFadeIn;
animation-play-state: running;
@@ -187,7 +192,17 @@ html {
}
.PostContent {
-
+ font-size: 1ch;
+}
+
+.Setting {
+ border-style: solid;
+ border-width: 1px;
+}
+
+.Mail {
+ border-style: solid;
+ border-width: 1px;
}
.MainFooter {
@@ -197,5 +212,5 @@ html {
text-align: center;
justify-content: center;
- height: 20vh;
+ height: 15vh;
}
diff --git a/Dockerfile b/Dockerfile
new file mode 100644
index 0000000..868c0c8
--- /dev/null
+++ b/Dockerfile
@@ -0,0 +1,17 @@
+# get a base
+FROM node:22-bookworm
+
+# place the files into the image
+WORKDIR /app
+COPY . /app
+
+# Dependencies
+RUN apt update
+RUN apt install npm -y
+RUN npm install http-server
+
+# Expose the port from docker-compose.yml
+EXPOSE 4000
+
+# Run the thing
+CMD npx http-server /app -o -p 4000
diff --git a/mail.html b/HTML/mail.html
similarity index 100%
rename from mail.html
rename to HTML/mail.html
diff --git a/setting.html b/HTML/setting.html
similarity index 100%
rename from setting.html
rename to HTML/setting.html
diff --git a/JS/ActivityPub.js b/JS/ActivityPub.js
new file mode 100644
index 0000000..c5b389d
--- /dev/null
+++ b/JS/ActivityPub.js
@@ -0,0 +1,8 @@
+export async function GetPublicTimelineContent() {
+ var Timeline = await fetch("https://wetdry.world/api/v1/timelines/public?limit=12")
+ .then((response) => response.json());
+ for (let i in Timeline) {
+ Timeline[i] = Timeline[i].content;
+ }
+ return Timeline;
+}
diff --git a/script.js b/JS/index.js
similarity index 65%
rename from script.js
rename to JS/index.js
index d25f30e..227318b 100644
--- a/script.js
+++ b/JS/index.js
@@ -1,13 +1,17 @@
+import * as ActivityPub from "./ActivityPub.js";
+
// GLOBAL VARS
+// fuck you. I see why website developers use divs so fucking often.
let Warning = document.getElementsByClassName("WarningMessage")[0];
-let Main = document.getElementsByClassName("Main")[0];
+let Main = document.getElementsByClassName("MainBefore")[0];
+let ContainerContainer = document.getElementsByClassName("PostContainerContainer")[0];
let BrowserWidth = window.innerWidth;
let BrowserHeight = window.innerHeight;
-// fuck you. I see why website developers use divs so fucking often.
-let Arrows = document.getElementsByClassName("Arrow");
-let ContainerContainer = document.getElementsByClassName("PostContainerContainer")[0];
+let ArrowsButton = document.getElementsByClassName("Arrow");
+let SettingButton = document.getElementsByClassName("Setting")[0];
+let MailButton = document.getElementsByClassName("Mail")[0];
// Sounds
const ButtonSound = new Audio("Audio/button-305770.mp3");
@@ -37,37 +41,39 @@ function UpdateTime() {
setInterval(UpdateTime, 1000);
-// When the window is resized.
+// When the window is resized
onresize = (event) => {
BrowserWidth = window.innerWidth;
BrowserHeight = window.innerHeight;
- Start();
-};
+ window.dispatchEvent(new Event("load"));
+}
-// When the
tag is done loading all it's elements
-function Start() {
+// When the window finally reloads
+onload = (event) => {
Warning.setAttribute("style", "height: " + BrowserHeight + "px; width: " + BrowserWidth + "px;");
Main.setAttribute("style", "height: " + BrowserHeight + "px; width: " + BrowserWidth + "px;");
- Arrows[1].setAttribute("style", "left: " + (BrowserWidth - 100) + "px;");
+ ArrowsButton[1].setAttribute("style", "left: " + (BrowserWidth - 100) + "px;");
}
// On clicking the warning message
-function WarningFade() {
+Warning.onclick = (event) => {
Warning.classList.add("WarningFadeOutAnimation");
// fixes a damn stupid bug
document.getElementsByClassName("BlinkAnimation")[0].classList.remove("BlinkAnimation");
Main.classList.add("MainFadeInAnimation");
- Main.classList.remove("Main");
+ Main.classList.remove("MainBefore");
WarningClick.play();
setTimeout(() => {
Main.classList.remove("MainFadeInAnimation");
+ Main.classList.add("MainAfter");
BackgroundMusic.play();
}, 5000);
Main = document.getElementsByClassName("MainFadeInAnimation")[0];
+ PosterContainerUpdate();
}
// Clicking the next button
-function Next() {
+ArrowsButton[1].onclick = (event) => {
if (!ContainerContainer.classList.contains("NextAnimation")) {
ContainerContainer.classList.add("NextAnimation");
ButtonSound.play();
@@ -76,10 +82,11 @@ function Next() {
ContainerContainer.classList.remove("NextAnimation");
}, 1000);
}
+ PosterContainerUpdate();
}
// Clicking the back button
-function Back() {
+ArrowsButton[0].onclick = (event) => {
if (!ContainerContainer.classList.contains("BackAnimation")) {
ContainerContainer.classList.add("BackAnimation");
ButtonSound.play();
@@ -88,12 +95,23 @@ function Back() {
ContainerContainer.classList.remove("BackAnimation");
}, 1000);
}
+ PosterContainerUpdate();
}
-function Setting() {
- window.location.href = "setting.html";
+async function PosterContainerUpdate() {
+ var Content = await ActivityPub.GetPublicTimelineContent();
+ var CenterContainer = document.getElementsByClassName("PostContainer")[1].children;
+ for (let i in CenterContainer) {
+ CenterContainer[i].getElementsByClassName("PostContent")[0].innerHTML = Content[i];
+ }
}
-function Mail() {
- window.location.href = "mail.html";
+// Open the settings
+SettingButton.onclick = (event) => {
+ window.location.href = "./HTML/setting.html";
+}
+
+// Open the notifs, private message, favorites, bookmarks
+MailButton.onclick = (event) => {
+ window.location.href = "./HTML/mail.html";
}
diff --git a/docker-compose.yml b/docker-compose.yml
new file mode 100644
index 0000000..f7eaafa
--- /dev/null
+++ b/docker-compose.yml
@@ -0,0 +1,9 @@
+services:
+ channelviewer:
+ restart: unless-stopped
+ build:
+ context: .
+ dockerfile: Dockerfile
+ image: channelviewer:latest
+ ports:
+ - 4000:4000
diff --git a/index.html b/index.html
index 3999634..1c2509b 100644
--- a/index.html
+++ b/index.html
@@ -5,11 +5,15 @@
The Fediverse
-
+
+
+
-
-
+
+
Warning! Care for yourself!
The world might seem like an uncaring place. At a glance, that might seem true. However, that doesn't mean nobody cares. The average person has enough affection to share with you, so please share it back.
@@ -20,7 +24,7 @@