mirror of
https://github.com/pldubouilh/gossa.git
synced 2026-08-27 20:36:33 -04:00
theme
This commit is contained in:
@@ -8,6 +8,7 @@ embed:
|
||||
cp src/main.go gossa.go
|
||||
perl -pe 's/template_will_be_here/`cat src\/page.tmpl`/ge' -i gossa.go
|
||||
perl -pe 's/css_will_be_here/`cat src\/style.css`/ge' -i gossa.go
|
||||
perl -pe 's/theme_will_be_here/`cat src\/theme.css`/ge' -i gossa.go
|
||||
perl -pe 's/js_will_be_here/`cat src\/script.js`/ge' -i gossa.go
|
||||
perl -pe 's/favicon_will_be_here/`base64 -w0 src\/favicon.png`/ge' -i gossa.go
|
||||
|
||||
|
||||
+9
-1
@@ -5,8 +5,16 @@
|
||||
<meta name="viewport" content="width=device-width">
|
||||
<title>{{.Title}}</title>
|
||||
<link href="data:image/png;base64,favicon_will_be_here" rel="icon" type="image/png" />
|
||||
<script>window.onload = function () { js_will_be_here }</script>
|
||||
<style type="text/css">css_will_be_here</style>
|
||||
<style type="text/css" id="theme">theme_will_be_here</style>
|
||||
<script>
|
||||
const theme = document.getElementById('theme')
|
||||
const themeNow = () => localStorage.getItem('theme')
|
||||
const setTheme = () => { theme.disabled = themeNow() === 'regular' }
|
||||
const toggleTheme = () => localStorage.setItem('theme', (themeNow() === 'regular' ? 'alt' : 'regular')) || setTheme()
|
||||
setTheme()
|
||||
</script>
|
||||
<script>window.onload = function () { js_will_be_here }</script>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
|
||||
+11
-6
@@ -163,6 +163,11 @@ const setBackgroundLinks = t => { t.style.backgroundColor = 'rgba(123, 123, 123,
|
||||
|
||||
const getLink = e => e.target.parentElement.querySelectorAll('a.list-links')[0]
|
||||
|
||||
upGrid.ondragleave = e => {
|
||||
cancelDefault(e)
|
||||
upGrid.style.display = 'none'
|
||||
}
|
||||
|
||||
document.ondragenter = e => {
|
||||
if (isPicMode()) { return }
|
||||
cancelDefault(e)
|
||||
@@ -181,10 +186,7 @@ document.ondragenter = e => {
|
||||
}
|
||||
}
|
||||
|
||||
upGrid.ondragleave = e => {
|
||||
cancelDefault(e)
|
||||
upGrid.style.display = 'none'
|
||||
}
|
||||
document.ondragend = e => resetBackgroundLinks()
|
||||
|
||||
document.ondragover = e => {
|
||||
cancelDefault(e)
|
||||
@@ -402,7 +404,7 @@ document.body.addEventListener('keydown', e => {
|
||||
return prevent(e) || picsNav(false) || prevPage()
|
||||
|
||||
case 'Escape':
|
||||
return prevent(e) || picsOff()
|
||||
return prevent(e) || resetBackgroundLinks() || picsOff()
|
||||
}
|
||||
|
||||
// Ctrl keys
|
||||
@@ -426,11 +428,14 @@ document.body.addEventListener('keydown', e => {
|
||||
|
||||
case 'KeyD':
|
||||
return prevent(e) || isPicMode() || window.mkdirBtn()
|
||||
|
||||
case 'KeyB':
|
||||
return prevent(e) || toggleTheme()
|
||||
}
|
||||
}
|
||||
|
||||
// text search
|
||||
if (e.code.includes('Key')) {
|
||||
if (e.code.includes('Key') && !e.ctrlKey && !e.metaKey) {
|
||||
typedPath += e.code.replace('Key', '').toLocaleLowerCase()
|
||||
clearTimeout(typedToken)
|
||||
typedToken = setTimeout(() => { typedPath = '' }, 1000)
|
||||
|
||||
+7
-4
@@ -1,3 +1,9 @@
|
||||
a {
|
||||
text-decoration: none;
|
||||
background-color: transparent !important;
|
||||
/* border-bottom: .01em solid #dfe6e9; */
|
||||
}
|
||||
|
||||
.icon {
|
||||
display: block;
|
||||
height: 16px;
|
||||
@@ -75,7 +81,6 @@ h1 {
|
||||
}
|
||||
|
||||
#progress {
|
||||
background-color: white;
|
||||
width: 99%;
|
||||
left: 0.5%;
|
||||
right: 0.5%;
|
||||
@@ -83,7 +88,6 @@ h1 {
|
||||
bottom: 0px;
|
||||
padding-bottom: 10px;
|
||||
max-height: 50%;
|
||||
overflow-y: scroll;
|
||||
overflow-x: hidden;
|
||||
}
|
||||
|
||||
@@ -118,10 +122,9 @@ h1 {
|
||||
text-align: center;
|
||||
font-size: 4em;
|
||||
font-family: Helvetica;
|
||||
background-color: white;
|
||||
color: green;
|
||||
opacity: 0.8;
|
||||
backdrop-filter: grayscale(100%);
|
||||
background-color: rgba(123, 123, 123, 0.2)
|
||||
}
|
||||
|
||||
#pics {
|
||||
|
||||
@@ -0,0 +1,7 @@
|
||||
html, a {
|
||||
background-color: #2d3436; color: #dfe6e9;
|
||||
}
|
||||
|
||||
.arrow, .icon-large-images {
|
||||
filter: invert(100%) !important;
|
||||
}
|
||||
Reference in New Issue
Block a user