diff --git a/jsdoc.json b/jsdoc.json
index 3ae04dbe..4c56dd44 100644
--- a/jsdoc.json
+++ b/jsdoc.json
@@ -1,22 +1,26 @@
{
"source": {
"includePattern": ".+\\.js(doc|x)?$",
- "include": ["./client/src/services/Api.js", "./backend/services/api.js", "package.json", "README.md"],
+ "include": ["./client/src/services/Api.js", "./backend/services/api.js", "package.json", "DOCS.md"],
"exclude": ["node_modules"]
},
"plugins": ["plugins/markdown"],
"recurseDepth": 10,
"opts": {
"encoding": "utf8",
- "readme": "./README.md",
+ "readme": "./DOCS.md",
"destination": "docs/",
"recurse": true,
"verbose": true,
"template": "node_modules/clean-jsdoc-theme",
+ "tutorials": "./tutorials",
"theme_opts": {
"default_theme": "dark",
"homepageTitle": "Dragonroll API",
- "title": "
"
+ "title": "
",
+ "static_dir": ["./static"],
+ "include_js": ["./static/scripts/themeWatch.js"],
+ "favicon": "static/media/logo.png"
}
},
"markdown": {
diff --git a/media/logo-splash-light.png b/static/media/logo-splash-light.png
similarity index 100%
rename from media/logo-splash-light.png
rename to static/media/logo-splash-light.png
diff --git a/media/logo-splash.png b/static/media/logo-splash.png
similarity index 100%
rename from media/logo-splash.png
rename to static/media/logo-splash.png
diff --git a/static/media/logo.png b/static/media/logo.png
new file mode 100644
index 00000000..5a2e59fc
Binary files /dev/null and b/static/media/logo.png differ
diff --git a/static/scripts/themeWatch.js b/static/scripts/themeWatch.js
new file mode 100644
index 00000000..774e89a8
--- /dev/null
+++ b/static/scripts/themeWatch.js
@@ -0,0 +1,27 @@
+function updateLogoThemes(){
+ let theme = localStorage.getItem('theme')
+ let darkLogos = document.getElementsByClassName('logo-splash-dark');
+ let lightLogos = document.getElementsByClassName('logo-splash-light');
+ if(theme == 'dark'){
+ for(let i = 0; i < darkLogos.length; i++) darkLogos[i].style.display = "unset";
+ for(let i = 0; i < lightLogos.length; i++) lightLogos[i].style.display = "none";
+ } else {
+ for(let i = 0; i < darkLogos.length; i++) darkLogos[i].style.display = "none";
+ for(let i = 0; i < lightLogos.length; i++) lightLogos[i].style.display = "unset";
+ }
+}
+
+document.addEventListener("DOMContentLoaded", (event) => {
+
+ const attrObserver = new MutationObserver((mutations) => {
+ mutations.forEach(mu => {
+ if (mu.type !== "attributes" && mu.attributeName !== "class") return;
+ updateLogoThemes();
+ });
+ });
+
+ const ELS_test = document.querySelectorAll("body");
+ ELS_test.forEach(el => attrObserver.observe(el, {attributes: true}));
+
+ updateLogoThemes();
+});
diff --git a/tutorials/Test.md b/tutorials/Test.md
new file mode 100644
index 00000000..f0de4041
--- /dev/null
+++ b/tutorials/Test.md
@@ -0,0 +1,2 @@
+# Hola
+hola test
\ No newline at end of file
diff --git a/tutorials/tutorials.json b/tutorials/tutorials.json
new file mode 100644
index 00000000..48579229
--- /dev/null
+++ b/tutorials/tutorials.json
@@ -0,0 +1,5 @@
+{
+ "test": {
+ "title": "Test tutorial"
+ }
+}
\ No newline at end of file