Skip to content

Commit

Permalink
Update Fella
Browse files Browse the repository at this point in the history
  • Loading branch information
starscouts committed Nov 17, 2024
1 parent d1fca76 commit a609eaa
Show file tree
Hide file tree
Showing 10 changed files with 22 additions and 146 deletions.
5 changes: 3 additions & 2 deletions client/admin/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>Administrator Tools | Floofi Voice Generator</title>
<link rel="stylesheet" href="https://fella.floo.fi/0.3.4/fella.min.css" integrity="sha384-CgGuCRnfADK2xVr1prHidzyuBRNFac8DehAwfqBx2kIXjLZ0Zsq/DTcFysSrRySg" crossorigin="anonymous">
<link rel="stylesheet" href="https://fella.floo.fi/fella.min.css" crossorigin="anonymous">
<link rel="shortcut icon" href="/assets/favicon.png" type="image/svg+xml">
<script src="/assets/src/config.js"></script>
<script defer data-domain="voice.floo.fi" src="https://insights.floo.fi/js/script.file-downloads.hash.outbound-links.js"></script>
Expand Down Expand Up @@ -87,6 +87,7 @@ <h2 class="fella-title">Administrator Tools</h2>
</section>
</div>

<script src="https://fella.floo.fi/fella.min.js"></script>
<script src="/assets/src/navbar.js"></script>
<script>
(async () => {
Expand All @@ -112,7 +113,7 @@ <h2 class="fella-title">Administrator Tools</h2>
if (allowed) {
await prepareNavbar();
await load();
document.getElementById("loader").style.display = "none";
completeLoad();
document.getElementById("prompt").style.display = "";
} else {
location.href = "/app";
Expand Down
3 changes: 2 additions & 1 deletion client/app/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>Floofi Voice Generator</title>
<link rel="stylesheet" href="https://fella.floo.fi/0.3.4/fella.min.css" integrity="sha384-CgGuCRnfADK2xVr1prHidzyuBRNFac8DehAwfqBx2kIXjLZ0Zsq/DTcFysSrRySg" crossorigin="anonymous">
<link rel="stylesheet" href="https://fella.floo.fi/fella.min.css" crossorigin="anonymous">
<link rel="stylesheet" href="/assets/custom.css">
<link rel="shortcut icon" href="/assets/favicon.png" type="image/svg+xml">
<script src="/assets/src/config.js"></script>
Expand Down Expand Up @@ -122,6 +122,7 @@
</footer>
</div>

<script src="https://fella.floo.fi/fella.min.js"></script>
<script src="/assets/src/main.js"></script>
<script src="/assets/src/navbar.js"></script>

Expand Down
2 changes: 1 addition & 1 deletion client/assets/src/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -409,7 +409,7 @@
configureRefresh();
await prepareNavbar();

document.getElementById("loader").style.display = "none";
completeLoad();
document.getElementById("app").style.display = "";
})();

Expand Down
133 changes: 1 addition & 132 deletions client/assets/src/navbar.js
Original file line number Diff line number Diff line change
@@ -1,15 +1,3 @@
window.onscroll = () => {
updateScroll();
}

function updateScroll() {
if (window.scrollY === 0) {
document.getElementById("navbar").classList.add("fella-nav-no-border");
} else {
document.getElementById("navbar").classList.remove("fella-nav-no-border");
}
}

async function prepareNavbar() {
let isAdministrator = (await (await fetch(window.SERVER + "/api/v2/admin/available", {
credentials: "include",
Expand Down Expand Up @@ -100,123 +88,4 @@ async function prepareNavbar() {
`;

loadNavigation();
}

function loadNavigation() {
window.categoryNavigationItem = null;
window.categorySection = null;
window.lastPosition = -1;

Array.from(document.getElementsByClassName("fella-nav-navigation-item")).map(i => {
i.onmouseenter = (e) => {
if (document.getElementById("navbar").classList.contains("fella-nav-mobile-open")) return;
if (e.target.getAttribute("data-category-id")) {
let category = document.getElementById("navbar-category-base-" + e.target.getAttribute("data-category-id"));
document.getElementById("navbar-category").style.width = category.clientWidth + "px";
document.getElementById("navbar-category").style.height = category.clientHeight + "px";

if (window.categoryNavigationItem) { // noinspection JSCheckFunctionSignatures
document.getElementById("navbar-category-outer").onmouseleave({
_switching: true
});
}

category.classList.remove("hide");
category.classList.add("show");
window.categorySection = category;
} else {
// noinspection JSCheckFunctionSignatures
document.getElementById("navbar-category-outer").onmouseleave({});
}

document.getElementById("navbar-tabs").style.left = e.target.getBoundingClientRect().left + "px";
document.getElementById("navbar-category-indicator").style.left = (e.target.getBoundingClientRect().left + e.target.clientWidth / 3) + "px";
document.getElementById("navbar-tabs").style.width = e.target.clientWidth + "px";
document.getElementById("navbar-tabs").style.opacity = "1";
e.target.classList.add("open");
if (window.categoryNavigationItem) {
window.categoryNavigationItem.classList.remove("open");
}
window.categoryNavigationItem = e.target;
};

i.onmouseleave = (e) => {
if (document.getElementById("navbar").classList.contains("fella-nav-mobile-open")) return;
if (e.target.classList.contains("fella-nav-navigation-item-with-category")) return;
e.target.classList.remove("open");
}
});

document.getElementById("navbar-category-outer").onmouseleave = document.body.onmouseleave = (e) => {
if (document.getElementById("navbar").classList.contains("fella-nav-mobile-open")) return;
if (window.categoryNavigationItem) {
window.categoryNavigationItem.classList.remove("open");
window.categoryNavigationItem = null;
}
if (window.categorySection) {
window.categorySection.classList.remove("show");
Array.from(document.getElementsByClassName("fella-nav-category-base")).map(i => i.classList.remove("hide"));
window.categorySection.classList.add("hide");
window.categorySection = null;
}
if (!e._switching) document.getElementById("navbar-navigation").onmouseleave(null);
}

document.getElementById("navbar-inner-left").onmouseleave = () => {
document.getElementById("navbar-tabs").style.transition = "opacity 150ms ease";
}

document.getElementById("navbar-navigation").onmousemove = (e) => {
if (document.getElementById("navbar").classList.contains("fella-nav-mobile-open")) return;
document.getElementById("navbar-category-outer").onmousemove(e);
document.getElementById("navbar-category").style.transition = "width 150ms ease, height 150ms ease";
document.getElementById("navbar-tabs").style.transition = "left 250ms ease, width 250ms ease, opacity 150ms ease";
document.getElementById("navbar-category-indicator").style.transition = "left 250ms ease";
};

document.getElementById("navbar-navigation").onmouseleave = (e) => {
if (document.getElementById("navbar").classList.contains("fella-nav-mobile-open")) return;
if (window.categoryNavigationItem && window.categoryNavigationItem.classList.contains("fella-nav-navigation-item-with-category")) return;
document.getElementById("navbar-tabs").style.opacity = "0";
if (e) document.getElementById("navbar-tabs").style.transition = "opacity 150ms ease";
document.getElementById("navbar-category").style.transition = "";
document.getElementById("navbar-category-indicator").style.transition = "";
document.getElementById("navbar-tabs").style.left = "0";
document.getElementById("navbar-tabs").style.width = "0";
};

document.getElementById("navbar-category-outer").onmousemove = (e) => {
document.getElementById("navbar-inner-left").classList.remove("navigating");
if (document.getElementById("navbar").classList.contains("fella-nav-mobile-open")) return;
if (window.lastPosition === -1) {
window.lastPosition = e.clientX;
}

if (e.clientX - window.lastPosition < -2) {
Array.from(document.getElementsByClassName("fella-nav-category-base")).map(i => i.classList.add("reverse"));
} else if (e.clientX - window.lastPosition > 2) {
Array.from(document.getElementsByClassName("fella-nav-category-base")).map(i => i.classList.remove("reverse"));
}

window.lastPosition = e.clientX;
}

document.getElementById("navbar-tabs").style.opacity = "0";
document.getElementById("navbar-tabs").style.transition = "opacity 150ms ease";
document.getElementById("navbar-tabs").style.left = "0";
document.getElementById("navbar-tabs").style.width = "0";

window.onresize = () => {
if (window.innerWidth > 900) {
document.getElementById("navbar").classList.remove("fella-nav-mobile-open");
}
}
}

function mobileNavbar() {
if (document.getElementById("navbar").classList.contains("fella-nav-mobile-open")) {
document.getElementById("navbar").classList.remove("fella-nav-mobile-open");
} else {
document.getElementById("navbar").classList.add("fella-nav-mobile-open");
}
}
}
5 changes: 3 additions & 2 deletions client/banned/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>Floofi Voice Generator</title>
<link rel="stylesheet" href="https://fella.floo.fi/0.3.4/fella.min.css" integrity="sha384-CgGuCRnfADK2xVr1prHidzyuBRNFac8DehAwfqBx2kIXjLZ0Zsq/DTcFysSrRySg" crossorigin="anonymous">
<link rel="stylesheet" href="https://fella.floo.fi/fella.min.css" crossorigin="anonymous">
<link rel="shortcut icon" href="/assets/favicon.png" type="image/svg+xml">
<script src="/assets/src/config.js"></script>
<script defer data-domain="voice.floo.fi" src="https://insights.floo.fi/js/script.file-downloads.hash.outbound-links.js"></script>
Expand Down Expand Up @@ -82,6 +82,7 @@
</div>
</div>

<script src="https://fella.floo.fi/fella.min.js"></script>
<script>
(async () => {
let code = (await (await fetch(window.SERVER + "/api/v2/status", {
Expand All @@ -94,7 +95,7 @@
if (code === 401) {
location.href = "/";
} else if (code === 403) {
document.getElementById("loader").style.display = "none";
completeLoad();
document.getElementById("prompt").style.display = "";
} else {
location.href = "/app";
Expand Down
5 changes: 3 additions & 2 deletions client/blocked/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>Floofi Voice Generator</title>
<link rel="stylesheet" href="https://fella.floo.fi/0.3.4/fella.min.css" integrity="sha384-CgGuCRnfADK2xVr1prHidzyuBRNFac8DehAwfqBx2kIXjLZ0Zsq/DTcFysSrRySg" crossorigin="anonymous">
<link rel="stylesheet" href="https://fella.floo.fi/fella.min.css" crossorigin="anonymous">
<link rel="shortcut icon" href="/assets/favicon.png" type="image/svg+xml">
<script src="/assets/src/config.js"></script>
<script defer data-domain="voice.floo.fi" src="https://insights.floo.fi/js/script.file-downloads.hash.outbound-links.js"></script>
Expand Down Expand Up @@ -102,6 +102,7 @@ <h2 class="fella-title">Please keep your content family-friendly</h2>
</section>
</div>

<script src="https://fella.floo.fi/fella.min.js"></script>
<script src="/assets/src/navbar.js"></script>
<script>
(async () => {
Expand All @@ -118,7 +119,7 @@ <h2 class="fella-title">Please keep your content family-friendly</h2>
location.href = "/banned";
} else {
await prepareNavbar();
document.getElementById("loader").style.display = "none";
completeLoad();
document.getElementById("prompt").style.display = "";
}
})();
Expand Down
3 changes: 2 additions & 1 deletion client/handoff/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>Floofi Voice Generator</title>
<link rel="stylesheet" href="https://fella.floo.fi/0.3.4/fella.min.css" integrity="sha384-CgGuCRnfADK2xVr1prHidzyuBRNFac8DehAwfqBx2kIXjLZ0Zsq/DTcFysSrRySg" crossorigin="anonymous">
<link rel="stylesheet" href="https://fella.floo.fi/fella.min.css" crossorigin="anonymous">
<link rel="shortcut icon" href="/assets/favicon.png" type="image/svg+xml">
<script src="/assets/src/config.js"></script>
<script defer data-domain="voice.floo.fi" src="https://insights.floo.fi/js/script.file-downloads.hash.outbound-links.js"></script>
Expand Down Expand Up @@ -73,6 +73,7 @@
</svg>
</div>

<script src="https://fella.floo.fi/fella.min.js"></script>
<script>
(async () => {
window.handoffToken = location.hash.substring(1);
Expand Down
5 changes: 3 additions & 2 deletions client/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>Floofi Voice Generator</title>
<link rel="stylesheet" href="https://fella.floo.fi/0.3.4/fella.min.css" integrity="sha384-CgGuCRnfADK2xVr1prHidzyuBRNFac8DehAwfqBx2kIXjLZ0Zsq/DTcFysSrRySg" crossorigin="anonymous">
<link rel="stylesheet" href="https://fella.floo.fi/fella.min.css" crossorigin="anonymous">
<link rel="shortcut icon" href="/assets/favicon.png" type="image/svg+xml">
<script src="/assets/src/config.js"></script>
<script defer data-domain="voice.floo.fi" src="https://insights.floo.fi/js/script.file-downloads.hash.outbound-links.js"></script>
Expand Down Expand Up @@ -81,6 +81,7 @@
</div>
</div>

<script src="https://fella.floo.fi/fella.min.js"></script>
<script>
(async () => {
document.getElementById("login").href = window.SERVER + "/auth/init";
Expand All @@ -93,7 +94,7 @@
})).json()).error?.code;

if (code === 401) {
document.getElementById("loader").style.display = "none";
completeLoad();
document.getElementById("prompt").style.display = "";
document.getElementById("login").href += "?origin=" + encodeURIComponent(location.origin);
} else if (code === 403) {
Expand Down
5 changes: 3 additions & 2 deletions client/terms/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>Acceptable Use Policy | Floofi Voice Generator</title>
<link rel="stylesheet" href="https://fella.floo.fi/0.3.4/fella.min.css" integrity="sha384-CgGuCRnfADK2xVr1prHidzyuBRNFac8DehAwfqBx2kIXjLZ0Zsq/DTcFysSrRySg" crossorigin="anonymous">
<link rel="stylesheet" href="https://fella.floo.fi/fella.min.css" crossorigin="anonymous">
<link rel="shortcut icon" href="/assets/favicon.png" type="image/svg+xml">
<script src="/assets/src/config.js"></script>
<script defer data-domain="voice.floo.fi" src="https://insights.floo.fi/js/script.file-downloads.hash.outbound-links.js"></script>
Expand Down Expand Up @@ -170,6 +170,7 @@ <h3>5. Modifications</h3>
</section>
</div>

<script src="https://fella.floo.fi/fella.min.js"></script>
<script src="/assets/src/navbar.js"></script>
<script>
(async () => {
Expand All @@ -186,7 +187,7 @@ <h3>5. Modifications</h3>
location.href = "/banned";
} else {
await prepareNavbar();
document.getElementById("loader").style.display = "none";
completeLoad();
document.getElementById("prompt").style.display = "";
}
})();
Expand Down
2 changes: 1 addition & 1 deletion client/version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
4.2.4
4.3.0

0 comments on commit a609eaa

Please sign in to comment.