refactor: move all HTTP-Website code into www subdirectory
Some checks failed
/ phplint (push) Failing after 4s

This commit is contained in:
David Bailey 2023-10-19 21:54:37 +02:00
parent 502ddd1ad9
commit 5bcba0b689
25 changed files with 33 additions and 67 deletions

9
www/static/.htaccess Normal file
View file

@ -0,0 +1,9 @@
Allow from all
<filesMatch ".(flv|gif|ico|jpg|jpeg|mp4|mpeg|png|svg|swf|webp)$">
Header set Cache-Control "max-age=315360, public"
</filesMatch>
<filesMatch ".(js)$">
Header set Cache-Control "max-age=315360, public"
</filesMatch>

69
www/static/banner.js Normal file
View file

@ -0,0 +1,69 @@
const banner_show_time = 600 * 1000.0
const banner_animated_style = "opacity 0.8s linear, transform 0.1s linear"
var banner_current_src = localStorage.getItem('main_banner_img')
function getBannerTime() {
return (new Date()).getTime() / banner_show_time
}
function getBannerSrc() {
return "/static/banner/" + Math.floor(getBannerTime() + 1000/banner_show_time) % 2 + ".png"
}
function update_banner_top(banner, banner_container) {
const banner_top_max = 0
const banner_top_min = -banner.clientHeight + banner_container.clientHeight
const banner_top = (1-(getBannerTime()%1)) * banner_top_min
banner.style.transform = "translateY(" + banner_top + 'px' + ")"
}
let banner_update_src = banner_current_src
function update_banner(banner, banner_container) {
image_select = getBannerSrc()
update_banner_top(banner, banner_container)
if(image_select != banner_update_src) {
banner.style.opacity = 0
setTimeout(() => {
banner.src = image_select
}, 1000)
banner_update_src = image_select
localStorage.setItem('main_banner_img', image_select)
document.getElementById("main_banner_img_link").href = "/gallery/test"
}
}
const banner_container = document.getElementById("main_header")
const banner = document.getElementById("main_banner_img")
banner.addEventListener('load', () => {
update_banner_top(banner, banner_container)
const next_banner_src = getBannerSrc()
if(banner_current_src != next_banner_src) {
banner.style.transition = banner_animated_style
setTimeout(() => banner.style.opacity = 0.3, 1000)
}
else {
banner.style.opacity = 0.3
setTimeout(() => banner.style.transition = banner_animated_style, 0)
}
banner_current_src = next_banner_src
})
document.addEventListener("DOMContentLoaded", function () {
banner.src = getBannerSrc()
document.getElementById("main_banner_img_link").href = "/gallery/test"
})
setInterval(() => update_banner(banner, banner_container), 100)
addEventListener("resize", () => update_banner(banner, banner_container));

BIN
www/static/banner/0.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 527 KiB

BIN
www/static/banner/1.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.4 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 66 KiB

134
www/static/dergstyle.css Normal file
View file

@ -0,0 +1,134 @@
* {
box-sizing: border-box;
margin: 0;
padding: 0;
}
body {
color: #B0B0B0;
background: #201c2a;
margin: 0px;
position: relative;
min-height: 100vh;
padding-bottom: 4em;
}
:link {
color: cyan;
font-style: italic;
text-decoration: none;
transition: color 0.2s;
}
a:visited {
color: cyan;
}
a:hover {
color: lightblue;
}
#main_header {
overflow: hidden;
position: relative;
padding-bottom: 0.7em;
}
#main_banner_img {
position: absolute;
left: 0px;
right: 0px;
width: 100vw;
z-index: -1;
opacity: 0;
top: 0px;
}
#main_banner_img_link {
position: absolute;
right: 2vw;
bottom: 0.5em;
font-size: 0.8em;
}
#nav_bar {
display: flex;
flex-direction: row;
justify-content: center;
list-style-type: none;
margin-top: 1em;
padding: 0px;
}
#nav_bar li {
padding: 0em 0.3em 0em 0.3em;
}
#big_title {
text-align: center;
font-size: 2.5em;
margin-bottom: 0.2em;
}
#main_header h2 {
text-align: center;
font-size: 2em;
margin-bottom: 0.2em;
}
#title_separator {
height: 1.5px;
background-color: #ddd;
opacity: 0.5;
margin-left: 2em;
margin-right: 2em;
}
#main_content_wrapper {
padding: 3vmin 1em 1em 1em;
width: auto;
margin-left: max(0.75em, min(max(20vmin, 50vw - 30rem), 50vw - 25rem));
margin-right: max(0.75em, min(max(20vmin, 50vw - 30rem), 50vw - 25rem));
min-height: 100%;
background: #3e355479;
}
#main_content_wrapper article {
background: #3e3554;
color: #c6c3c3;
border-radius: 0.3em;
box-shadow: 3px 7px 7px 0px #00000040;
padding: 0.75em;
}
#main_content_wrapper article h1 {
text-align: left;
padding-left: 3vmin;
margin-bottom: 0.2em;
border-bottom: solid 1px darkgrey;
}
#main_footer {
display: flex;
height: 2.5em;
text-align: center;
background-color: #3a3a3a;
margin: 0px;
position: absolute;
bottom: 0px;
width: 100%;
}
#main_footer span {
align-self: flex-end;
width: 100%;
}

View file

@ -0,0 +1,26 @@
article {
margin-top: 0.8em;
margin-left: 10%;
margin-right: 10%;
}
figcaption {
text-align: center;
border-bottom: solid 3px darkgrey;
font-size: 2em;
margin-bottom: 0.3em;
}
#gallery_image {
display: block;
max-width: 100%;
max-height: 80vh;
margin-left: auto;
margin-right: auto;
}

BIN
www/static/icon.jpeg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 66 KiB

13
www/static/rrrorstyle.css Normal file
View file

@ -0,0 +1,13 @@
#rrr_header {
font-size: 2em;
border-bottom: 1px solid grey;
padding-bottom: 0.2em;
margin-bottom: 0.3em;
}
#rrr_code {
font-size: 1.5em;
}