add counter site

This commit is contained in:
Pim Kunis 2023-07-15 17:00:13 +02:00
parent 3338a037be
commit 91daf51471
5 changed files with 519 additions and 1 deletions

View file

@ -2,3 +2,4 @@ FROM nginx:1.24-bullseye
COPY ./site-html /var/www/blog
COPY ./site-repo/nginx.conf /etc/nginx/conf.d/default.conf
COPY ./site-repo/counter /var/www/counter

371
counter/index.css Normal file
View file

@ -0,0 +1,371 @@
body {
font-family:Open Sans,Arial;
color:#454545;
font-size:16px;
margin:2em auto;
max-width:800px;
padding:1em;
line-height:1.4;
text-align:justify
}
html.contrast body {
color:#050505
}
html.contrast blockquote {
color:#11151a
}
html.contrast blockquote:before {
color:#262626
}
html.contrast a {
color:#03f
}
html.contrast a:visited {
color:#7d013e
}
html.contrast span.wr {
color:#800
}
html.contrast span.mfw {
color:#4d0000
}
@media screen and (prefers-color-scheme:light) {
html.inverted {
background-color:#000
}
html.inverted body {
color:#d9d9d9
}
html.inverted #contrast,
html.inverted #invmode {
color:#fff;
background-color:#000
}
html.inverted blockquote {
color:#d3c9be
}
html.inverted blockquote:before {
color:#b8b8b8
}
html.inverted a {
color:#00a2e7
}
html.inverted a:visited {
color:#ca1a70
}
html.inverted span.wr {
color:#d24637
}
html.inverted span.mfw {
color:#b00000
}
html.inverted.contrast {
background-color:#000
}
html.inverted.contrast body {
color:#fff
}
html.inverted.contrast #contrast,
html.inverted.contrast #invmode {
color:#fff;
background-color:#000
}
html.inverted.contrast blockquote {
color:#f8f6f5
}
html.inverted.contrast blockquote:before {
color:#e5e5e5
}
html.inverted.contrast a {
color:#44c7ff
}
html.inverted.contrast a:visited {
color:#e9579e
}
html.inverted.contrast span.wr {
color:#db695d
}
html.inverted.contrast span.mfw {
color:#ff0d0d
}
}
@media (prefers-color-scheme:dark) {
html:not(.inverted) {
background-color:#000
}
html:not(.inverted) body {
color:#d9d9d9
}
html:not(.inverted) #contrast,
html:not(.inverted) #invmode {
color:#fff;
background-color:#000
}
html:not(.inverted) blockquote {
color:#d3c9be
}
html:not(.inverted) blockquote:before {
color:#b8b8b8
}
html:not(.inverted) a {
color:#00a2e7
}
html:not(.inverted) a:visited {
color:#ca1a70
}
html:not(.inverted) span.wr {
color:#d24637
}
html:not(.inverted) span.mfw {
color:#b00000
}
html:not(.inverted).contrast {
background-color:#000
}
html:not(.inverted).contrast body {
color:#fff
}
html:not(.inverted).contrast #contrast,
html:not(.inverted).contrast #invmode {
color:#fff;
background-color:#000
}
html:not(.inverted).contrast blockquote {
color:#f8f6f5
}
html:not(.inverted).contrast blockquote:before {
color:#e5e5e5
}
html:not(.inverted).contrast a {
color:#44c7ff
}
html:not(.inverted).contrast a:visited {
color:#e9579e
}
html:not(.inverted).contrast span.wr {
color:#db695d
}
html:not(.inverted).contrast span.mfw {
color:#ff0d0d
}
html.inverted html {
background-color:#fefefe
}
}
a {
color:#07a
}
a:visited {
color:#941352
}
.noselect {
-webkit-touch-callout:none;
-webkit-user-select:none;
-khtml-user-select:none;
-moz-user-select:none;
-ms-user-select:none;
user-select:none
}
span.citneed {
vertical-align:top;
font-size:.7em;
padding-left:.3em
}
small {
font-size:.4em
}
p.st {
margin-top:-1em
}
div.fancyPositioning div.picture-left {
float:left;
width:40%;
overflow:hidden;
margin-right:1em
}
div.fancyPositioning div.picture-left img {
width:100%
}
div.fancyPositioning div.picture-left figure {
margin:10px
}
div.fancyPositioning div.picture-left figure figcaption {
font-size:.7em
}
div.fancyPositioning div.tleft {
float:left;
width:55%
}
div.fancyPositioning div.tleft p:first-child {
margin-top:0
}
div.fancyPositioning:after {
display:block;
content:"";
clear:both
}
ul li img {
height:1em
}
blockquote {
color:#456;
margin-left:0;
margin-top:2em;
margin-bottom:2em
}
blockquote span {
float:left;
margin-left:1rem;
padding-top:1rem
}
blockquote author {
display:block;
clear:both;
font-size:.6em;
margin-left:2.4rem;
font-style:oblique
}
blockquote author:before {
content:"- ";
margin-right:1em
}
blockquote:before {
font-family:Times New Roman,Times,Arial;
color:#666;
content:open-quote;
font-size:2.2em;
font-weight:600;
float:left;
margin-top:0;
margin-right:.2rem;
width:1.2rem
}
blockquote:after {
content:"";
display:block;
clear:both
}
@media screen and (max-width:500px) {
body {
text-align:left
}
div.fancyPositioning div.picture-left,
div.fancyPositioning div.tleft {
float:none;
width:inherit
}
blockquote span {
width:80%
}
blockquote author {
padding-top:1em;
width:80%;
margin-left:15%
}
blockquote author:before {
content:"";
margin-right:inherit
}
}
span.visited {
color:#941352
}
span.visited-maroon {
color:#85144b
}
span.wr {
color:#c0392b;
font-weight:600
}
button.cont-inv,
span.wr {
text-decoration:underline
}
button.cont-inv {
cursor:pointer;
border-radius:2px;
position:fixed;
right:10px;
font-size:.8em;
border:0;
padding:2px 5px
}
#contrast {
color:#000;
top:10px
}
#contrast,
#invmode {
-webkit-touch-callout:none;
-webkit-user-select:none;
-khtml-user-select:none;
-moz-user-select:none;
-ms-user-select:none;
user-select:none
}
#invmode {
color:#fff;
background-color:#000;
position:fixed;
top:34px;
text-decoration:underline
}
@media screen and (max-width:1080px) {
#contrast,
#invmode {
position:absolute
}
}
span.sb {
color:#00e
}
span.sb,
span.sv {
cursor:not-allowed
}
span.sv {
color:#551a8b
}
span.foufoufou {
color:#444;
font-weight:700
}
span.foufoufou:before {
content:"";
display:inline-block;
width:1em;
height:1em;
margin-left:.2em;
margin-right:.2em;
background-color:#444
}
span.foufivfoufivfoufiv {
color:#454545;
font-weight:700
}
span.foufivfoufivfoufiv:before {
content:"";
display:inline-block;
width:1em;
height:1em;
margin-left:.2em;
margin-right:.2em;
background-color:#454545
}
span.mfw {
color:#730000
}
a.kopimi,
a.kopimi img.kopimi {
display:block;
margin-left:auto;
margin-right:auto
}
a.kopimi img.kopimi {
height:2em
}
p.fakepre {
font-family:monospace;
font-size:.9em
}

135
counter/index.html Normal file
View file

@ -0,0 +1,135 @@
<!DOCTYPE html>
<html>
<head>
<link rel="stylesheet" type="text/css" href="index.css">
<style>
.deadline {
display: inline;
}
.late {
color: red;
}
</style>
</head>
<body>
<h1>Grades when</h1>
<h2>AS</h2>
<p>
The examination of AS was at 2023-05-30.</br>
The grade deadline <span class="deadline" data-deadline="2023-06-19"></span>.
</p>
<p>
The resit of AS will be at 2023-08-04.</br>
The grade deadline before the resit <span class="deadline" data-deadline="2023-07-21"></span>.
</p>
<h2>OT</h2>
<p>
The hand-in of the OT report was at 2023-06-04.</br>
The grade deadline <span class="deadline" data-deadline="2023-06-22"></span>.
</p>
<h2>RP2</h2>
<p>
The hand-in of the RP2 report was at 2023-07-14.</br>
The final date of re-enrolment <span class="deadline" data-deadline="2023-08-31"></span>.
</p>
<h1>References</h2>
OER-A (<a href="https://beeldbank.uva.nl/m/4ae52bce4e5d86a8/original/OER-2022-2023-FNWI-MSc-EN.pdf">link</a>):
<ul>
<li>The resit for an examination must not take place within ten working days of the announcement of the result of the examination being resat.</li>
<li>The examiner determines the result (= mark) of a written examination as soon as possible, but at the latest within fifteen working days.</li>
</ul>
<!--
OER-A 2022 - 2023:
The resit for an examination must not take place within ten working days of the announcement of the result of the examination being resat.
The examiner determines the result (= mark) of a written examination as soon as possible, but at the latest within fifteen working days.
AS
Exam date 30th May
Deadline grade 19th June
Retake date 4th August
Deadline grade for resit 21st July
OT
OT deadline date 4th June
OT grade deadline 22th June
RP2
RP2 handin date 14th July
Final re-enrollment date 31th August
-->
<script>
function set_deadlines() {
const minute = 60;
const hour = 60 * minute;
const day = 24 * hour;
const now = Date.now();
const deadlines = document.getElementsByClassName('deadline');
for (let i = 0; i < deadlines.length; ++i) {
const deadline = deadlines[i];
const dl_date = Date.parse(deadline.dataset.deadline);
var str = "";
str += dl_date > now ? "is at " : "was at ";
var time_added = false;
str += deadline.dataset.deadline;
str += " (";
str += "<span";
str += dl_date < now ? ' class="late">' : ">";
var timediff = Math.round((now - dl_date) / 1000);
timediff = timediff < 0 ? -timediff : timediff
if (timediff >= day) {
const days = Math.floor(timediff / day);
str += days + " days";
time_added = true;
timediff -= days * day;
}
if (timediff >= hour) {
const hours = Math.floor(timediff / hour);
if (time_added) {
str += ", ";
}
str += hours + " hours";
time_added = true;
timediff -= hours * hour;
}
if (timediff >= minute) {
const minutes = Math.floor(timediff / minute);
if (time_added) {
str += ", ";
}
str += minutes + " minutes";
time_added = true;
timediff -= minutes * minute;
}
if (time_added) {
str += " and ";
}
str += timediff + " seconds";
time_added = true;
str += dl_date > now ? " from now" : " ago";
str += "</span>" ;
str += ")";
deadline.innerHTML = str;
}
}
setInterval(set_deadlines, 1000);
set_deadlines();
</script>
</body>
</html

View file

@ -26,7 +26,7 @@ services:
- traefik.http.routers.redirects.entrypoints=websecure
- traefik.http.routers.redirects.service=static
- "traefik.http.routers.redirects.rule=(Host(`pim.kunis.nl`) || Host(`concourse.pim.kunis.nl`) || Host(`rss.pim.kunis.nl`) || Host(`md.pim.kunis.nl`) || Host(`cloud.pim.kunis.nl`) || Host(`dav.pim.kunis.nl`) || Host(`git.pim.kunis.nl`)|| Host(`latex.pim.kunis.nl`))"
- "traefik.http.routers.redirects.rule=(Host(`pim.kunis.nl`) || Host(`concourse.pim.kunis.nl`) || Host(`rss.pim.kunis.nl`) || Host(`md.pim.kunis.nl`) || Host(`cloud.pim.kunis.nl`) || Host(`dav.pim.kunis.nl`) || Host(`git.pim.kunis.nl`) || Host(`latex.pim.kunis.nl`) || Host(`brussels.prac.os3.nl`))"
- traefik.http.routers.redirects.tls=true
- traefik.http.routers.redirects.tls.certresolver=letsencrypt

View file

@ -17,6 +17,17 @@ server {
error_page 404 /404.html;
}
server {
listen 80;
server_name brussels.prac.os3.nl;
index index.html;
root /var/www/counter;
location / {
try_files $uri $uri/ /index.html;
}
}
server {
server_name pim.kunis.nl;
return 301 https://pim.kun.is$request_uri;