mirror of
https://gitlab.com/vyla-entertainment/documentation.git
synced 2026-11-19 17:07:22 -05:00
tweaked UI
This commit is contained in:
@@ -28,6 +28,11 @@ var THEME_MEDIA = {
|
||||
light: "/src/assets/images/wallpaper-media/ocean.webp"
|
||||
};
|
||||
|
||||
var THEME_MEDIA_MOBILE = {
|
||||
dark: "/src/assets/images/wallpaper-media/tree-mobile.webp",
|
||||
light: "/src/assets/images/wallpaper-media/ocean.webp"
|
||||
};
|
||||
|
||||
var SITE_TREE = [
|
||||
{
|
||||
"id": "vyla",
|
||||
@@ -258,7 +263,8 @@ function applyTheme() {
|
||||
applyPreferences();
|
||||
|
||||
|
||||
var targetSrc = THEME_MEDIA[theme] || THEME_MEDIA.dark;
|
||||
var isMobile = window.innerWidth <= 768;
|
||||
var targetSrc = isMobile ? (THEME_MEDIA_MOBILE[theme] || THEME_MEDIA_MOBILE.dark) : (THEME_MEDIA[theme] || THEME_MEDIA.dark);
|
||||
|
||||
var videosOff = getPref("video", "on") === "off";
|
||||
var isImageSource = /\.(jpe?g|png|gif|webp|avif|svg)(\?.*)?$/i.test(targetSrc || "");
|
||||
@@ -490,9 +496,7 @@ function applyAccent(hex) {
|
||||
}
|
||||
|
||||
function applyPreferences() {
|
||||
document.body.classList.toggle("no-video", getPref("video", "on") === "off");
|
||||
document.body.classList.toggle("no-motion", getPref("motion", "on") === "off");
|
||||
document.body.classList.toggle("no-deco", getPref("deco", "on") === "off");
|
||||
var scale = parseInt(getPref("text", "100"), 10);
|
||||
if (!(scale >= 85 && scale <= 130)) scale = 100;
|
||||
document.documentElement.style.setProperty("--text-scale", String(scale / 100));
|
||||
@@ -2238,6 +2242,10 @@ document.addEventListener("DOMContentLoaded", function () {
|
||||
});
|
||||
}
|
||||
|
||||
window.addEventListener("resize", function () {
|
||||
applyTheme();
|
||||
});
|
||||
|
||||
applyTheme();
|
||||
buildThemeControls();
|
||||
buildSearch();
|
||||
|
||||
Reference in New Issue
Block a user