Merge branch 'main' of git.rensoliemans.nl:rens/slitdecision

main
Rens Oliemans 3 weeks ago
commit 484312070e
Signed by: rens
GPG Key ID: CD37836E088B896B
  1. 9
      README.md
  2. 12
      src/assets/gitea-icon.svg
  3. 69
      src/assets/gitlab-icon-rgb.svg
  4. 7
      src/choices.css
  5. 17
      src/index.html
  6. 5
      src/main.css
  7. 4
      src/main.js
  8. 4
      src/sw.js

@ -5,16 +5,15 @@
Een website die, wanneer je twee opties geeft, bepaalt welke je moet doen. De
keuze wordt gebaseerd op een Quantum Random Number Generator
(van [qrng.anu.edu.au](https://qrng.anu.edu.au/)).
(van [quantumnumbers.anu.edu.au](https://quantumnumbers.anu.edu.au/)).
Dit betekent dat, volgens de
[Veel-werelden-interpretatie](https://nl.wikipedia.org/wiki/Veel-werelden-interpretatie)
van kwantummechanica, er een universum zal zijn waarin je optie 1 doet, en een
universum zal zijn waar je optie 2 zal doen, aangezien jij je keuze laat
afhangen van een kwantummeting.
afhangen van een kwantummeting. Neem dit niet al te serieus
Dit is een fork van
[slitdecision](https://gitlab.com/RensOliemans/slitdecision), dit leek mij de
meest eenvoudige manier om verschillende talen te hebben en alsnog GitLab pages
te kunnen gebruiken.
meest eenvoudige manier om verschillende talen te hebben en die eenvoudig te
hosten op meerdere websites.

@ -0,0 +1,12 @@
<?xml version="1.0" encoding="UTF-8"?>
<svg version="1.1" id="main_outline" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" viewBox="0 0 640 640" style="enable-background:new 0 0 640 640;" xml:space="preserve">
<g>
<path id="teabag" style="fill:#FFFFFF" d="M395.9,484.2l-126.9-61c-12.5-6-17.9-21.2-11.8-33.8l61-126.9c6-12.5,21.2-17.9,33.8-11.8 c17.2,8.3,27.1,13,27.1,13l-0.1-109.2l16.7-0.1l0.1,117.1c0,0,57.4,24.2,83.1,40.1c3.7,2.3,10.2,6.8,12.9,14.4 c2.1,6.1,2,13.1-1,19.3l-61,126.9C423.6,484.9,408.4,490.3,395.9,484.2z"/>
<g>
<g>
<path style="fill:#609926" d="M622.7,149.8c-4.1-4.1-9.6-4-9.6-4s-117.2,6.6-177.9,8c-13.3,0.3-26.5,0.6-39.6,0.7c0,39.1,0,78.2,0,117.2 c-5.5-2.6-11.1-5.3-16.6-7.9c0-36.4-0.1-109.2-0.1-109.2c-29,0.4-89.2-2.2-89.2-2.2s-141.4-7.1-156.8-8.5 c-9.8-0.6-22.5-2.1-39,1.5c-8.7,1.8-33.5,7.4-53.8,26.9C-4.9,212.4,6.6,276.2,8,285.8c1.7,11.7,6.9,44.2,31.7,72.5 c45.8,56.1,144.4,54.8,144.4,54.8s12.1,28.9,30.6,55.5c25,33.1,50.7,58.9,75.7,62c63,0,188.9-0.1,188.9-0.1s12,0.1,28.3-10.3 c14-8.5,26.5-23.4,26.5-23.4s12.9-13.8,30.9-45.3c5.5-9.7,10.1-19.1,14.1-28c0,0,55.2-117.1,55.2-231.1 C633.2,157.9,624.7,151.8,622.7,149.8z M125.6,353.9c-25.9-8.5-36.9-18.7-36.9-18.7S69.6,321.8,60,295.4 c-16.5-44.2-1.4-71.2-1.4-71.2s8.4-22.5,38.5-30c13.8-3.7,31-3.1,31-3.1s7.1,59.4,15.7,94.2c7.2,29.2,24.8,77.7,24.8,77.7 S142.5,359.9,125.6,353.9z M425.9,461.5c0,0-6.1,14.5-19.6,15.4c-5.8,0.4-10.3-1.2-10.3-1.2s-0.3-0.1-5.3-2.1l-112.9-55 c0,0-10.9-5.7-12.8-15.6c-2.2-8.1,2.7-18.1,2.7-18.1L322,273c0,0,4.8-9.7,12.2-13c0.6-0.3,2.3-1,4.5-1.5c8.1-2.1,18,2.8,18,2.8 l110.7,53.7c0,0,12.6,5.7,15.3,16.2c1.9,7.4-0.5,14-1.8,17.2C474.6,363.8,425.9,461.5,425.9,461.5z"/>
<path style="fill:#609926" d="M326.8,380.1c-8.2,0.1-15.4,5.8-17.3,13.8c-1.9,8,2,16.3,9.1,20c7.7,4,17.5,1.8,22.7-5.4 c5.1-7.1,4.3-16.9-1.8-23.1l24-49.1c1.5,0.1,3.7,0.2,6.2-0.5c4.1-0.9,7.1-3.6,7.1-3.6c4.2,1.8,8.6,3.8,13.2,6.1 c4.8,2.4,9.3,4.9,13.4,7.3c0.9,0.5,1.8,1.1,2.8,1.9c1.6,1.3,3.4,3.1,4.7,5.5c1.9,5.5-1.9,14.9-1.9,14.9 c-2.3,7.6-18.4,40.6-18.4,40.6c-8.1-0.2-15.3,5-17.7,12.5c-2.6,8.1,1.1,17.3,8.9,21.3c7.8,4,17.4,1.7,22.5-5.3 c5-6.8,4.6-16.3-1.1-22.6c1.9-3.7,3.7-7.4,5.6-11.3c5-10.4,13.5-30.4,13.5-30.4c0.9-1.7,5.7-10.3,2.7-21.3 c-2.5-11.4-12.6-16.7-12.6-16.7c-12.2-7.9-29.2-15.2-29.2-15.2s0-4.1-1.1-7.1c-1.1-3.1-2.8-5.1-3.9-6.3c4.7-9.7,9.4-19.3,14.1-29 c-4.1-2-8.1-4-12.2-6.1c-4.8,9.8-9.7,19.7-14.5,29.5c-6.7-0.1-12.9,3.5-16.1,9.4c-3.4,6.3-2.7,14.1,1.9,19.8 C343.2,346.5,335,363.3,326.8,380.1z"/>
</g>
</g>
</g>
</svg>

After

Width:  |  Height:  |  Size: 2.5 KiB

@ -1,69 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- Generator: Adobe Illustrator 24.2.1, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
<svg version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
viewBox="0 0 586 559" style="enable-background:new 0 0 586 559;" xml:space="preserve">
<style type="text/css">
.st0{fill:#FAFAFA;}
.st1{fill:#F0F0F0;}
.st2{fill:#FFFFFF;}
.st3{fill:#E24329;}
.st4{fill:#FCA326;}
.st5{fill:#FC6D26;}
.st6{fill:#8C929D;}
.st7{fill:#2E2E2E;}
.st8{fill:none;stroke:#FCA326;stroke-width:16;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:10;}
.st9{fill:none;stroke:#FC6D26;stroke-width:16;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:10;}
.st10{fill:none;stroke:#E24329;stroke-width:16;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:10;}
.st11{fill:none;stroke:#F0F0F0;stroke-miterlimit:10;}
.st12{fill:#231F20;}
.st13{fill:none;stroke:#231F20;stroke-width:16;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:10;}
.st14{display:none;}
.st15{display:inline;opacity:0.1;fill:#E828E3;}
.st16{display:inline;}
.st17{opacity:0.1;fill:#E828E3;}
.st18{font-family:'SourceSansPro-Semibold';}
.st19{font-size:24px;}
.st20{display:inline;fill:#DB3B21;}
.st21{display:inline;fill:#FC6D26;}
.st22{display:inline;fill:#2E2E2E;}
.st23{display:inline;fill:#6E49CB;}
.st24{display:inline;fill:#380D75;}
.st25{display:inline;fill:#FCA121;}
.st26{opacity:0.6;fill:none;stroke:#231F20;stroke-width:2;stroke-miterlimit:10;stroke-dasharray:12,6;}
.st27{fill:none;stroke:#444444;stroke-width:1.5339;stroke-miterlimit:10;}
</style>
<g id="logo_art">
<g>
<path id="path50_2_" class="st3" d="M293.026,434.983L293.026,434.983l62.199-191.322H230.918L293.026,434.983L293.026,434.983z"
/>
<path id="path66_6_" class="st4" d="M143.798,243.662L143.798,243.662l-18.941,58.126c-1.714,5.278,0.137,11.104,4.661,14.394
l163.509,118.801L143.798,243.662L143.798,243.662z"/>
<path id="path74_2_" class="st3" d="M143.798,243.662h87.12l-37.494-115.224c-1.919-5.895-10.282-5.895-12.27,0L143.798,243.662
L143.798,243.662z"/>
<path id="path82_6_" class="st4" d="M442.346,243.662L442.346,243.662l18.873,58.126c1.714,5.278-0.137,11.104-4.661,14.394
L293.026,434.983L442.346,243.662L442.346,243.662z"/>
<path id="path86_2_" class="st3" d="M442.346,243.662h-87.12l37.425-115.224c1.919-5.895,10.282-5.895,12.27,0L442.346,243.662
L442.346,243.662z"/>
<polygon class="st5" points="293.026,434.983 355.225,243.662 442.346,243.662 "/>
<polygon class="st5" points="293.026,434.983 143.798,243.662 230.918,243.662 "/>
</g>
</g>
<g id="spacing_guides" xmlns:sketch="http://www.bohemiancoding.com/sketch/ns" class="st14">
<path id="path40_18_" sketch:type="MSShapeGroup" class="st15" d="M0,0.5v124h586V0.5H0L0,0.5z"/>
<path id="path40_16_" sketch:type="MSShapeGroup" class="st15" d="M0,435.5v124h586v-124H0L0,435.5z"/>
<path id="path40_15_" sketch:type="MSShapeGroup" class="st15" d="M462.2,560h124V0h-124V560L462.2,560z"/>
<g class="st16">
<text transform="matrix(1 0 0 1 511.2881 283.3319)" class="st18 st19">1x</text>
</g>
<g class="st16">
<text transform="matrix(1 0 0 1 281.2881 500.9978)" class="st18 st19">1x</text>
</g>
<g class="st16">
<text transform="matrix(1 0 0 1 281.2881 65.998)" class="st18 st19">1x</text>
</g>
<path id="path40_5_" sketch:type="MSShapeGroup" class="st15" d="M0,560h124V0H0V560L0,560z"/>
<g class="st16">
<text transform="matrix(1 0 0 1 51.2881 283.3319)" class="st18 st19">1x</text>
</g>
</g>
</svg>

Before

Width:  |  Height:  |  Size: 3.5 KiB

@ -76,6 +76,11 @@
color: var(--input-nonchosen-col);
}
#remainingIntegers {
margin-top: 10px;
color: var(--secondary-color);
}
.source a:hover {
background-color: transparent;
}
}

@ -34,9 +34,12 @@
<noscript>
Ik kan helaas geen kwantummetingen ophalen zonder Javascript. Wat je zelf wel kunt doen is naar
<br>
<a href="https://qrng.anu.edu.au/API/jsonI.php?length=1&type=uint8">https://qrng.anu.edu.au/API/jsonI.php?length=1&type=uint8</a>,
<a href="https://api.quantumnumbers.anu.edu.au?length=1&type=uint8">https://api.quantumnubers.anu.edu.au?length=1&type=uint8</a>,
<br>
gaan, en Keuze&nbsp;A uitvoeren wanneer het resultaat even is, en Keuze&nbsp;B wanneer het oneven is.
Je hebt hier een (gratis) API-sleutel voor nodig, of de niet-bijster-goed-verborgen-sleutel
reverse-engineeren die ik hier gebruik ;)
</noscript>
</div>
<div id="remainingIntegers">
@ -47,7 +50,7 @@
<p>
De bovenstaand gekozen keuze is gemaakt door een &ldquo;Quantum Random Number Generator&rdquo; van
<a href="https://qrng.anu.edu.au/">qrng.anu.edu.au</a>.
<a href="https://quantumnumbers.anu.edu.au/">quantumnumbers.anu.edu.au</a>.
Volgens de <a href="https://nl.wikipedia.org/wiki/Veel-werelden-interpretatie">Veel-werelden-interpretatie</a>
van kwantummechanica stort de <a href="https://nl.wikipedia.org/wiki/Golffunctie">golffunctie</a> niet in,
maar is elke mogelijke kwantumtoestand de realiteit in een bepaald universum.
@ -60,19 +63,21 @@
<a href="https://nl.wikipedia.org/wiki/Veel-werelden-interpretatie">wikipagina</a> aan,
<a href="https://youtu.be/KNwKPfOKipk">dit filmpje</a> of het science-fiction verhaal
<a href="https://en.wikipedia.org/wiki/Anxiety_Is_the_Dizziness_of_Freedom">Anxiety Is the Dizziness of Freedom</a> door Ted Chiang.
Dit hoef je niet al te serieus te nemen.
</p>
<p>
Zie ook <a href="https://slitdecision.com">slitdecision.com</a> voor de Engelse versie.
</p>
<p>
De kwantummetingen worden geleverd door <a href="https://qrng.anu.edu.au/">ANU</a>, door hun project en
open API is kwantumkwestie mogelijk.<br>
De kwantummetingen worden geleverd door <a href="https://quantumnumbers.anu.edu.au/">ANU</a>, door hun project en
API is kwantumkwestie mogelijk.<br>
Je keuzes verlaten nooit jouw apparaat, en worden alleen gezien door jou en iedereen naast je.
</p>
<div class="source">
<a href="https://gitlab.com/RensOliemans/kwantumkwestie">
<img src="assets/gitlab-icon-rgb.svg" alt="GitLab icon" height="40" width="40">
<a href="https://git.rensoliemans.nl/rens/kwantumkwestie">
<img src="assets/gitea-icon.svg" alt="Gitea icon - link to source code" height="30" width="30">
</a>
</div>
</main>

@ -72,8 +72,3 @@ a:hover {
color: var(--a-hov-col);
background-color: var(--a-hov-bg);
}
#remainingIntegers {
margin-top: 10px;
color: var(--secondary-color);
}

@ -58,9 +58,11 @@ const getIntegersFromAPI = () => {
const getIntegerPromiseFromAPI = () => {
const url = buildUrl();
const headerValue = atob('UW9uVTB1NTQ2dTIyclNVOGRwdXRxM3ZZNlNmNW5DMWRyZnBwMVY5NQ==');
return fetch(url, {
headers: {
'x-api-key': 'FCocrjguIx3txJoU9FcY73UcGodsyOrlax84bDtG'
'x-api-key': headerValue
}
});
};

@ -1,4 +1,4 @@
const cacheName = 'kwantumkwestie-v2';
const cacheName = 'kwantumkwestie-v3';
const contentToCache = [
'/assets/gitlab-icon-rgb.svg',
'/choices.css',
@ -17,7 +17,7 @@ self.addEventListener('install', (e) => {
self.addEventListener('fetch', (e) => {
e.respondWith((async () => {
if (e.request.url.includes("qrng.anu.edu.au")) {
if (e.request.url.includes("quantumnumbers.anu.edu.au")) {
return await fetch(e.request);
} else {
const r = await caches.match(e.request);

Loading…
Cancel
Save