Skip to content

Commit

Permalink
docs
Browse files Browse the repository at this point in the history
  • Loading branch information
strukturart committed Oct 2, 2024
1 parent 046c52b commit 02f24d5
Show file tree
Hide file tree
Showing 79 changed files with 6,514 additions and 45 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ Now it is also possible to load mastodon content, in the settings of the app you
- open rss feedlink
- offline use (caching)

![feedolin_mockup](/images/feedolin_mockup.png)
![feedolin_mockup](/image/mockup.png)

## Installation

Expand Down
16 changes: 16 additions & 0 deletions application/assets/css/main.css
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,9 @@ body {
max-width: 100vw;
overflow: hidden;
background: white;

background-image: radial-gradient(circle, #e2dddd 10%, transparent 11%);
background-size: 5px 5px;
}

#app {
Expand Down Expand Up @@ -279,6 +282,8 @@ div#intro img {

article {
min-width: 100%;
background-image: radial-gradient(circle, #e2dddd 10%, transparent 11%);
background-size: 5px 5px;
}

#start {
Expand Down Expand Up @@ -355,6 +360,8 @@ article {
.text {
word-break: break-all; /* Breaks the URL at any character */
padding: 0px 0px 50px 0px;
background-image: radial-gradient(circle, #e2dddd 10%, transparent 11%);
background-size: 5px 5px;
}

#optionsView {
Expand Down Expand Up @@ -679,6 +686,9 @@ video {
max-width: 100vw;
overflow: hidden;
background: white;

background-image: radial-gradient(circle, #e2dddd 10%, transparent 11%);
background-size: 5px 5px;
}

#wrapper {
Expand Down Expand Up @@ -742,6 +752,9 @@ video {
max-width: 100vw;
overflow: hidden;
background: white;

background-image: radial-gradient(circle, #e2dddd 10%, transparent 11%);
background-size: 5px 5px;
}

h2 {
Expand Down Expand Up @@ -772,6 +785,9 @@ video {

#article {
padding: 0px;

background-image: radial-gradient(circle, #e2dddd 10%, transparent 11%);
background-size: 25px 25px;
}

#start article {
Expand Down
87 changes: 45 additions & 42 deletions application/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -137,45 +137,45 @@ let mastodon_connect = () => {
var currentUrl = window.location.href;
const params = new URLSearchParams(currentUrl.split("?")[1]);
const code = params.get("code");
if (!code) return false;

let result = code.split("#")[0];
if (code) {
localforage.setItem("mastodon_code", result);
var myHeaders = new Headers();
myHeaders.append("Content-Type", "application/x-www-form-urlencoded");

var urlencoded = new URLSearchParams();
urlencoded.append("code", result);
urlencoded.append("scope", "read");

urlencoded.append("grant_type", "authorization_code");
urlencoded.append("redirect_uri", process.env.redirect);
urlencoded.append("client_id", process.env.clientId);
urlencoded.append("client_secret", process.env.clientSecret);

var requestOptions = {
method: "POST",
headers: myHeaders,
body: urlencoded,
redirect: "follow",
};
let result = code.split("#")[0];
if (code) {
localforage.setItem("mastodon_code", result);
var myHeaders = new Headers();
myHeaders.append("Content-Type", "application/x-www-form-urlencoded");

var urlencoded = new URLSearchParams();
urlencoded.append("code", result);
urlencoded.append("scope", "read");

urlencoded.append("grant_type", "authorization_code");
urlencoded.append("redirect_uri", process.env.redirect);
urlencoded.append("client_id", process.env.clientId);
urlencoded.append("client_secret", process.env.clientSecret);

var requestOptions = {
method: "POST",
headers: myHeaders,
body: urlencoded,
redirect: "follow",
};

fetch(settings.mastodon_server_url + "/oauth/token", requestOptions)
.then((response) => response.json()) // Parse the JSON once
.then((data) => {
console.log(data); // Log the parsed data
fetch(settings.mastodon_server_url + "/oauth/token", requestOptions)
.then((response) => response.json()) // Parse the JSON once
.then((data) => {
console.log(data); // Log the parsed data

settings.mastodon_token = data.access_token; // Access the token
localforage.setItem("settings", settings);
m.route.set("/start?index=0");
settings.mastodon_token = data.access_token; // Access the token
localforage.setItem("settings", settings);
m.route.set("/start?index=0");

side_toaster("Successfully connected", 10000);
})
.catch((error) => {
console.error("Error:", error);
side_toaster("Connection failed");
});
side_toaster("Successfully connected", 10000);
})
.catch((error) => {
console.error("Error:", error);
side_toaster("Connection failed");
});
}
}
});
};
Expand Down Expand Up @@ -897,17 +897,22 @@ var article = {
},
},
[
m("time", dayjs(h.isoDate).format("DD MMM YYYY")),
m(
"h2",
"time",
{
id: "top",
oncreate: () => {
setTimeout(() => {
document.querySelector("#top").scrollIntoView();
}, 1000);
},
},
dayjs(h.isoDate).format("DD MMM YYYY")
),
m(
"h2",
{
id: "top",
},
h.title
),
m("div", { class: "text" }, [m.trust(clean(h.content))]),
Expand Down Expand Up @@ -2091,9 +2096,7 @@ document.addEventListener("DOMContentLoaded", function (e) {

case "Backspace":
if (r.startsWith("/article")) {
history.back();
const index = m.route.param("index"); // Get 'index' param from the current URL
console.log(index);
const index = m.route.param("index");
m.route.set("/start?index=" + index);
}

Expand Down Expand Up @@ -2174,7 +2177,7 @@ document.addEventListener("DOMContentLoaded", function (e) {
}

document.addEventListener("visibilitychange", () => {
if (document.visibilityState === "visible") {
if (document.visibilityState === "visible" && settings.last_update) {
status.visibility = true;
let dif = new Date() / 1000 - settings.last_update / 1000;
if (dif > 36000) {
Expand Down
2 changes: 1 addition & 1 deletion application/sw.js
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ self.onsystemmessage = (evt) => {
} catch (e) {}
};

const CACHE_NAME = "pwa-cache-v0.1014";
const CACHE_NAME = "pwa-cache-v0.1016";
const urlsToCache = [
"/assets/icons/link.svg",
"/assets/icons/option.svg",
Expand Down
Binary file added docs/Roboto-Regular.4f1a9903.ttf
Binary file not shown.
Binary file added docs/assets/fonts/Roboto-Regular.ttf
Binary file not shown.
56 changes: 56 additions & 0 deletions docs/assets/icons/2-5.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
81 changes: 81 additions & 0 deletions docs/assets/icons/23EF.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
56 changes: 56 additions & 0 deletions docs/assets/icons/25B6.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading

0 comments on commit 02f24d5

Please sign in to comment.