diff --git a/VERSION b/VERSION new file mode 100644 index 0000000..626799f --- /dev/null +++ b/VERSION @@ -0,0 +1 @@ +v1 diff --git a/css/main.css b/css/main.css index f8a374d..df3aa6a 100644 --- a/css/main.css +++ b/css/main.css @@ -38,6 +38,18 @@ header .page { font-weight: 500; } +footer { + position: absolute; + left: 0px; + right: 0px; + bottom: 0px; + text-align: center; + color: #f0f; + padding: 6px 0; + font-size: 0.75em; + font-weight: 500; +} + #page-label { font-weight: 500; font-size: 1.25em; diff --git a/index.html b/index.html index 8fc2931..801d895 100644 --- a/index.html +++ b/index.html @@ -28,5 +28,6 @@
+ diff --git a/js/app.js b/js/app.js index e2d423f..ed5f642 100644 --- a/js/app.js +++ b/js/app.js @@ -9,6 +9,8 @@ class App { this.themes = { default: Theme.default() } this.sections = [] + this.retrieveVersion() + this.retrieveThemes() .then(()=>this.retrieveConfig()) .then(config=>this.parseConfig(config)) @@ -30,6 +32,18 @@ class App { }) }) }//}}} + retrieveVersion() {//{{{ + return fetch('/VERSION') + .then(res=>{ + if(res.ok) + return res.text() + throw `Error when fetching /${page}.yaml: ${res.status} ${res.statusText}` + }) + .then(version=>{ + this.version = version + document.querySelector('footer').innerHTML = `Dashie ${version}` + }) + }//}}} retrieveConfig() {//{{{ const urlParams = new URLSearchParams(window.location.search); let page = urlParams.get('page') @@ -103,6 +117,12 @@ class App { let sectionHTML = this.sections.map(s=>s.html()) document.getElementById('sections').innerHTML = sectionHTML.join('') + + // Footer + let footer = document.querySelector('footer') + footer.style.display = t.colors.page.footer.show ? 'block' : 'none'; + footer.style.color = t.colors.page.footer.text + footer.style.backgroundColor = t.colors.page.footer.background }//}}} setTheme(theme) {//{{{ this.theme = theme @@ -159,7 +179,12 @@ class Theme { page: { text: '#fff', header: '#333', - background: '#fff' + background: '#fff', + footer: { + show: true, + text: "#aaa", + background: "#eee" + } }, page_select: {