diff --git a/CSS/theme-options/organizr-dark.css b/CSS/theme-options/organizr-dark.css deleted file mode 100644 index e4935c9c..00000000 --- a/CSS/theme-options/organizr-dark.css +++ /dev/null @@ -1 +0,0 @@ -@import url("https://develop.theme-park.dev/CSS/variables/organizr.css"); \ No newline at end of file diff --git a/Resources/landing-page/assets/img/organizr-dark-small.jpg b/Resources/landing-page/assets/img/organizr-small.jpg similarity index 100% rename from Resources/landing-page/assets/img/organizr-dark-small.jpg rename to Resources/landing-page/assets/img/organizr-small.jpg diff --git a/Resources/landing-page/assets/img/organizr-dark.png b/Resources/landing-page/assets/img/organizr.png similarity index 100% rename from Resources/landing-page/assets/img/organizr-dark.png rename to Resources/landing-page/assets/img/organizr.png diff --git a/Resources/landing-page/assets/img/overseer-small.jpg b/Resources/landing-page/assets/img/overseerr-small.jpg similarity index 100% rename from Resources/landing-page/assets/img/overseer-small.jpg rename to Resources/landing-page/assets/img/overseerr-small.jpg diff --git a/Resources/landing-page/assets/img/overseer.png b/Resources/landing-page/assets/img/overseerr.png similarity index 100% rename from Resources/landing-page/assets/img/overseer.png rename to Resources/landing-page/assets/img/overseerr.png diff --git a/Resources/landing-page/css/custom.css b/Resources/landing-page/css/custom.css index d651b934..5c27e48b 100644 --- a/Resources/landing-page/css/custom.css +++ b/Resources/landing-page/css/custom.css @@ -348,7 +348,7 @@ p { background: radial-gradient(ellipse at center, rgba(87, 108, 117, 1) 0%, rgba(37, 50, 55, 1) 100.2%); } -#portfolio [class*="container-"] .portfolio-box .portfolio-box-caption.organizr-dark-hover { +#portfolio [class*="container-"] .portfolio-box .portfolio-box-caption.organizr-hover { background: #1f1f1f; } @@ -364,7 +364,7 @@ p { background: #282a36; } -#portfolio [class*="container-"] .portfolio-box .portfolio-box-caption.overseer-hover { +#portfolio [class*="container-"] .portfolio-box .portfolio-box-caption.overseerr-hover { background: linear-gradient(360deg, hsl(221, 39%, 11%) 65%, hsl(215, 28%, 17%) 100%); } diff --git a/Resources/landing-page/js/scripts.js b/Resources/landing-page/js/scripts.js index 11d9b26a..5295df0e 100644 --- a/Resources/landing-page/js/scripts.js +++ b/Resources/landing-page/js/scripts.js @@ -6,29 +6,6 @@ (function ($) { "use strict"; // Start of use strict - // Smooth scrolling using anime.js - $('a.js-scroll-trigger[href*="#"]:not([href="#"])').on('click', function () { - if ( - location.pathname.replace(/^\//, "") == - this.pathname.replace(/^\//, "") && - location.hostname == this.hostname - ) { - var target = $(this.hash); - target = target.length ? - target : - $("[name=" + this.hash.slice(1) + "]"); - if (target.length) { - anime({ - targets: 'html, body', - scrollTop: target.offset().top - 72, - duration: 1000, - easing: 'easeInOutExpo' - }); - return false; - } - } - }); - // Closes responsive menu when a scroll trigger link is clicked $('.js-scroll-trigger').click(function () { $('.navbar-collapse').collapse('hide'); @@ -71,17 +48,14 @@ })(jQuery); // End of use strict -const themes = ["aquamarine","hotline","dark","organizr-dark","dracula","overseerr", -"plex","space-gray","hotpink","onedark","nord"]; -var random = themes[~~(Math.random() * themes.length)]; -// load a random css stylesheet + function injectTheme(theme,container="head") { if (container === "head") { html_element = document.head; } else html_element = document.body; let themeOption = document.getElementById("theme-option") let link = themeOption ? themeOption : document.createElement("link"); - url = "/CSS/variables/" + url = "/CSS/theme-options/" link.type = "text/css"; link.rel = "stylesheet"; link.href = `${url}/${theme.toLowerCase()}.css`; @@ -92,6 +66,7 @@ function injectTheme(theme,container="head") { // Add theme data and set theme vars var apps; var themeOptions; + function addThemeData() { let themeJsonUrl = "/themes.json" fetch(themeJsonUrl) @@ -105,27 +80,45 @@ function injectTheme(theme,container="head") { document.getElementById("app-count").innerHTML = ` theme.park contains ${appCount} themed applications, with css addons on certain themes.` - document.getElementById("theme-count").innerHTML = `Choose between ${Object.keys(json.themes).length} different - styles! With the possibility to easily create your own themes using the defined ${Object.keys(json.themes).length} official + styles, and ${Object.keys(json["community-themes"]).length} community styles! With the possibility to easily create your own themes using the defined variables.` - createApps(apps) + createApps(apps,themeOptions) + smoothScroll() + let randomTheme = Object.keys(themeOptions)[~~(Math.random() * Object.keys(themeOptions).length)] + injectTheme(randomTheme) }) } -function createApps(apps) { +function createApps(apps,themeOptions) { let allAppsDiv = document.getElementById("all-apps") - sorted = Object.keys(apps).sort() - for (let app in sorted) { + let allThemesDiv = document.getElementById("all-themes") + sortedApps = Object.keys(apps).sort() + sortedThemes = Object.keys(themeOptions).sort() + for (let app in sortedApps) { let newApp = ` - -

-

${sorted[app][0].toUpperCase() + sorted[app].slice(1)}

+
+

+

${sortedApps[app][0].toUpperCase() + sortedApps[app].slice(1)}

` allAppsDiv.innerHTML += newApp } + for (let option in sortedThemes) { + let newApp = ` +
+ + ... +
+
Theme
+
${sortedThemes[option][0].toUpperCase() + sortedThemes[option].slice(1)}
+
+
+
` + allThemesDiv.innerHTML += newApp + } } -function fadeOutIn(speed ) { +function fadeOutIn(speed) { let theme = Object.keys(themeOptions)[~~(Math.random() * Object.keys(themeOptions).length)] if (!document.body.style.opacity) { document.body.style.opacity = 1; @@ -146,7 +139,29 @@ function fadeOutIn(speed ) { } -injectTheme(random); +// Smooth scrolling using anime.js +function smoothScroll() {$('a.js-scroll-trigger[href*="#"]:not([href="#"])').on('click', function () { + if ( + location.pathname.replace(/^\//, "") == + this.pathname.replace(/^\//, "") && + location.hostname == this.hostname + ) { + var target = $(this.hash); + target = target.length ? + target : + $("[name=" + this.hash.slice(1) + "]"); + if (target.length) { + anime({ + targets: 'html, body', + scrollTop: target.offset().top - 120, + duration: 1000, + easing: 'easeInOutExpo' + }); + return false; + } + } +})}; + addThemeData(); document.getElementById("switch-theme").addEventListener("click", () => { fadeOutIn(350); diff --git a/docker-mods/bazarr/root/etc/cont-init.d/98-themepark b/docker-mods/bazarr/root/etc/cont-init.d/98-themepark index e46bc255..ab83d01e 100644 --- a/docker-mods/bazarr/root/etc/cont-init.d/98-themepark +++ b/docker-mods/bazarr/root/etc/cont-init.d/98-themepark @@ -8,6 +8,7 @@ echo '---------------------------' echo -e "Variables set:\\n\ 'TP_DOMAIN'=${TP_DOMAIN}\\n\ 'TP_ADDON'=${TP_ADDON}\\n\ +'TP_COMMUNITY_THEME'=${TP_COMMUNITY_THEME}\\n\ 'TP_THEME'=${TP_THEME}\\n" APP_FILEPATH='/app/bazarr/bin/frontend/build/index.html' @@ -16,6 +17,11 @@ if [ "${TP_HOTIO}" = true ]; then APP_FILEPATH='/app/bin/frontend/build/index.html' fi +THEME_TYPE='theme-options' +if [ "${TP_COMMUNITY_THEME}" = true ]; then + THEME_TYPE='community-theme-options' +fi + # Set default if [[ -z ${TP_DOMAIN} ]]; then echo 'No domain set, defaulting to theme-park.dev' @@ -39,8 +45,8 @@ if ! grep -q "${TP_DOMAIN}" "${APP_FILEPATH}"; then echo '---------------------------' echo '| Adding the stylesheet |' echo '---------------------------' - sed -i "s/<\/head>/<\/head> /g" "${APP_FILEPATH}" - sed -i "s/<\/head>/<\/head> /g" "${APP_FILEPATH}" + sed -i "s/<\/head>/<\/head> /g" "${APP_FILEPATH}" + sed -i "s/<\/head>/<\/head> /g" "${APP_FILEPATH}" printf 'Stylesheet set to %s\n' "${TP_THEME}" if [[ -n ${TP_ADDON} ]]; then for addon in $(echo "$TP_ADDON" | tr "|" " "); do diff --git a/index.html b/index.html index f5ae4ab5..b9e38ca7 100644 --- a/index.html +++ b/index.html @@ -21,7 +21,7 @@ - + @@ -99,7 +99,6 @@
- ...
@@ -174,98 +173,7 @@
-
@@ -290,7 +198,7 @@ - +