Mattias Bodlund 1 week ago
parent
commit
047979eab6
5 changed files with 46 additions and 16 deletions
  1. +12
    -8
      _layouts/default.html
  2. +22
    -5
      config/nginx.conf
  3. +10
    -1
      css/application.css
  4. +2
    -1
      js/dice.js
  5. +0
    -1
      js/lottie-player.js

+ 12
- 8
_layouts/default.html View File

@ -17,21 +17,25 @@
<script src="/js/lottie-player.js"></script>
<script src="/js/dice.js" defer></script>
<!-- Privacy-friendly analytics by Plausible -->
<script async src="https://plausible.io/js/pa-rgmue79oXEcI_j3ZqVYa4.js"></script>
<script>
window.plausible=window.plausible||function(){(plausible.q=plausible.q||[]).push(arguments)},plausible.init=plausible.init||function(i){plausible.o=i||{}};
plausible.init()
</script>
</head>
<body>
<header>
<header>
{% include ikea-foundation-203x22.svg %}
</header>
{% include inter-ikea-systems.svg %}
{% include ikea-foundation-203x22.svg %}
</header>
{% include inter-ikea-systems.svg %}
<main>
<button id="dice"></button>
<lottie-player src="/images/IF_Icon_Press.json" background="transparent" speed="1" style="width:120px;height:120px" loop autoplay></lottie-player>
</main>
</body>
</html>

+ 22
- 5
config/nginx.conf View File

@ -1,7 +1,7 @@
# http > https
server {
listen 80;
server_name ikea-foundation-dice.onc.dk;
server_name dice.ikeafoundation.org ikea-foundation-dice.onc.dk;
root /home/mattias/www/ikea-foundation-dice/public;
@ -11,10 +11,27 @@ server {
}
location / {
return 301 https://ikea-foundation-dice.onc.dk$request_uri;
return 301 https://dice.ikeafoundation.org$request_uri;
}
}
# https
server {
listen 443 ssl;
http2 on;
server_name ikea-foundation-dice.onc.dk;
ssl_certificate /etc/letsencrypt/live/ikea-foundation-dice.onc.dk/fullchain.pem; # managed by Certbot
ssl_certificate_key /etc/letsencrypt/live/ikea-foundation-dice.onc.dk/privkey.pem; # managed by Certbot
include /etc/letsencrypt/options-ssl-nginx.conf; # managed by Certbot
ssl_dhparam /etc/letsencrypt/ssl-dhparams.pem; # managed by Certbot
location / {
return 301 https://dice.ikeafoundation.org$request_uri;
}
}
# https
@ -22,10 +39,10 @@ server {
listen 443 ssl;
http2 on;
server_name ikea-foundation-dice.onc.dk;
server_name dice.ikeafoundation.org;
ssl_certificate /etc/letsencrypt/live/ikea-foundation-dice.onc.dk/fullchain.pem; # managed by Certbot
ssl_certificate_key /etc/letsencrypt/live/ikea-foundation-dice.onc.dk/privkey.pem; # managed by Certbot
ssl_certificate /etc/letsencrypt/live/dice.ikeafoundation.org/fullchain.pem; # managed by Certbot
ssl_certificate_key /etc/letsencrypt/live/dice.ikeafoundation.org/privkey.pem; # managed by Certbot
include /etc/letsencrypt/options-ssl-nginx.conf; # managed by Certbot
ssl_dhparam /etc/letsencrypt/ssl-dhparams.pem; # managed by Certbot


+ 10
- 1
css/application.css View File

@ -68,13 +68,22 @@ header {
main {
position: relative;
display: flex;
flex-direction: column;
min-height: 100vh;
min-height: 100svh;
align-items: center;
justify-content: center;
gap: 3rem;
}
main lottie-player {
position: absolute;
left: 50%;
/* Dice is 11rem tall and vertically centered, so its bottom sits at
50% + 5.5rem; place the lottie just below with a small gap. */
top: calc(50% + 5.5rem + 2rem);
transform: translateX(-50%);
}
button#dice {


+ 2
- 1
js/dice.js View File

@ -36,7 +36,8 @@
setTimeout(showValue, SPIN_MS / 2);
};
dice.addEventListener('click', () => roll());
// A click anywhere on the page rolls the dice.
document.addEventListener('click', () => roll());
dice.addEventListener('animationend', () => dice.classList.remove('is-rolling'));
roll(false); // show a starting value without animating


+ 0
- 1
js/lottie-player.js
File diff suppressed because it is too large
View File


Loading…
Cancel
Save