Compare commits

...

5 Commits

Author SHA1 Message Date
cb6654aeee Bumped to v2 2023-07-25 12:32:36 +00:00
7942350599 Better mobile view 2023-07-25 12:32:21 +00:00
3e3f40b80e Gruvbox theme 2023-07-25 12:08:31 +00:00
cd23679d8b Added the subdued and colorful themes 2023-07-25 11:49:03 +00:00
6b286431b7 Added version 2023-07-25 11:48:25 +00:00
5 changed files with 188 additions and 4 deletions

1
VERSION Normal file
View File

@ -0,0 +1 @@
v2

View File

@ -11,13 +11,13 @@ html, body {
} }
body { body {
position: relative;
min-height: 100vh;
font-size: 14pt; font-size: 14pt;
font-family: 'Roboto', sans-serif; font-family: 'Roboto', sans-serif;
} }
header { header {
position: relative;
display: grid; display: grid;
grid-template-columns: min-content min-content 1fr min-content; grid-template-columns: min-content min-content 1fr min-content;
grid-gap: 16px; grid-gap: 16px;
@ -38,6 +38,45 @@ header .page {
font-weight: 500; font-weight: 500;
} }
@media only screen and (max-width: 700px) {
header {
display: flex;
flex-flow: wrap;
justify-content: center;
}
header #page-label {
width: 100%;
text-align: center;
}
header #pages {
display: flex;
flex-flow: wrap;
justify-content: center;
}
header #theme {
display: flex;
justify-content: center;
width: 100%;
}
.spacer { display: none; }
}
footer {
position: absolute;
left: 0px;
right: 0px;
bottom: 0px;
padding: 6px 0;
color: #f0f;
text-align: center;
font-size: 0.75em;
font-weight: 500;
}
#page-label { #page-label {
font-weight: 500; font-weight: 500;
font-size: 1.25em; font-size: 1.25em;
@ -61,7 +100,7 @@ header .page {
justify-content: center; justify-content: center;
gap: 32px; gap: 32px;
margin-top: 32px; margin-top: 32px;
padding: 32px; padding: 32px 32px 96px 32px;
} }
.section { .section {
@ -133,3 +172,5 @@ header .page {
font-weight: 300; font-weight: 300;
font-size: 0.85em; font-size: 0.85em;
} }
/* vim: ts=8 sw=8 noexpandtab */

View File

@ -28,5 +28,6 @@
<div id="theme"></div> <div id="theme"></div>
</header> </header>
<div id="sections"></div> <div id="sections"></div>
<footer></footer>
</body> </body>
</html> </html>

View File

@ -9,6 +9,8 @@ class App {
this.themes = { default: Theme.default() } this.themes = { default: Theme.default() }
this.sections = [] this.sections = []
this.retrieveVersion()
this.retrieveThemes() this.retrieveThemes()
.then(()=>this.retrieveConfig()) .then(()=>this.retrieveConfig())
.then(config=>this.parseConfig(config)) .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() {//{{{ retrieveConfig() {//{{{
const urlParams = new URLSearchParams(window.location.search); const urlParams = new URLSearchParams(window.location.search);
let page = urlParams.get('page') let page = urlParams.get('page')
@ -103,6 +117,12 @@ class App {
let sectionHTML = this.sections.map(s=>s.html()) let sectionHTML = this.sections.map(s=>s.html())
document.getElementById('sections').innerHTML = sectionHTML.join('') 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) {//{{{ setTheme(theme) {//{{{
this.theme = theme this.theme = theme
@ -159,7 +179,12 @@ class Theme {
page: { page: {
text: '#fff', text: '#fff',
header: '#333', header: '#333',
background: '#fff' background: '#fff',
footer: {
show: true,
text: "#aaa",
background: "#eee"
}
}, },
page_select: { page_select: {

116
themes.yaml Normal file
View File

@ -0,0 +1,116 @@
# Colorful
# ========
colorful:
page:
text: "#fff"
background: "#2f3542"
header: "#1e232b"
footer:
show: true
text: "#56647a"
background: "#1e232b"
page_select:
text: "#fff"
background: "#2f3542"
theme_select:
text: "#9db0d9"
background: "#2f3542"
border: "#3e4556"
section:
background: "#252932"
borders:
- ["#ffb932", "#222"]
- ["#ff58ae", "#222"]
- ["#e65272", "#222"]
- ["#68e2ff", "#222"]
- ["#33b3b6", "#222"]
- ["#1a66cc", "#222"]
- ["#883fbb", "#222"]
- ["#4da769", "#222"]
item:
label:
background: "#333a48"
description: "#9db0d9"
url: "#8393b6"
icon:
hover: brighter
# Subdued
# =======
subdued:
page:
text: "#ccc"
background: "#f4f0ee"
header: "#545454"
footer:
show: true
text: "#c1aba0"
background: "#ebe4e0"
page_select:
text: "#3c3c3c"
background: "#888"
theme_select:
text: "#ccc"
background: "#545454"
border: "#888"
section:
background: "#f4f0ee"
borders:
- ["#bd9391", "#333"]
- ["#adbabd", "#333"]
- ["#91b7c7", "#333"]
- ["#6c4b5e", "#bbb"]
item:
label: "#6c4b5e"
background: "#ece4e1"
description: "#9d828f"
url: "#9d828f"
icon: "#9d828f"
hover: brighter
# Gruvbox
# =======
gruvbox:
page:
text: "#bdae93"
background: "#282828"
header: "#504945"
footer:
show: true
text: "#a89984"
background: "#504945"
page_select:
text: "#bdae93"
background: "#3c3836"
theme_select:
text: "#bdae93"
background: "#3c3c36"
border: "#665c54"
section:
background: "#504945"
borders:
- ["#fb4934", "#eee"]
- ["#b8bb26", "#333"]
- ["#fabd2f", "#333"]
- ["#458588", "#eee"]
- ["#fe8019", "#333"]
- ["#689d6a", "#333"]
item:
label:
background: "#282828"
description: "#d5c4a1"
url: "#a89984"
icon:
hover: brighter