From ce0052fc0c2447d39e1c58ce1803b86fe212a38f Mon Sep 17 00:00:00 2001 From: Lynnesbian Date: Thu, 26 Mar 2020 00:13:08 +1000 Subject: [PATCH] you can now play... The Lynne Quiz. --- assets/big-thicc-quiz-of-the-lynne.js | 86 +++++++++++++++++++++++++++ assets/script.js | 1 - assets/style.css | 59 +++++++++++++++--- quiz.html | 16 +++++ 4 files changed, 154 insertions(+), 8 deletions(-) create mode 100644 assets/big-thicc-quiz-of-the-lynne.js create mode 100644 quiz.html diff --git a/assets/big-thicc-quiz-of-the-lynne.js b/assets/big-thicc-quiz-of-the-lynne.js new file mode 100644 index 0000000..bfa5e09 --- /dev/null +++ b/assets/big-thicc-quiz-of-the-lynne.js @@ -0,0 +1,86 @@ +// @license magnet:?xt=urn:btih:5305d91886084f776adcf57509a648432709a7c7&dn=x11.txt X11 License + +// checking the source code is cheating and now your score is null and void >:c + +var questions = { + "have never broken a bone": false, + "like Banjo Kazooie: Nuts & Bolts": true, + "tell people who say \"Linux\" that it's actually \"GNU/Linux\"": false, + "have never broken a bone": false, + "joined the Fediverse in August 2018": true, + "have a habit of buying domain names that I never use": true, + "have mixed up the phrases \"Middle Earth\" and \"Middle East\" several times": true, + "am lactose intolerant": true, + "have never seen a rabbit in real life": true, + "have never seen a sheep in real life": false, + "chew my nails": true, + "am the only person on fedi.lynnesbian.space": false, + "often mix up my lefts and rights": true, + "main Isabelle in Smash Ultimate": false, + "main Mii Swordfighter in Smash Ultimate": true, + "have accidentally stolen a library book before": true, + "am allergic to gluten": true, + "can draw The Cool S": false, + "have written several games for the TI-84+ calculator": true, + "can play the trumpet": true, + "can play the ukelele": false, + "never have to look at the keyboard when typing": false, + "have never owned an Apple device": false, + "have never used FaceBook": false, + "do not particularly care for the way LibreJS requires you to annotate your JavaScript files": true, + "have walked into a tree while reading a book": true, + "have walked into a tree while using my phone": false, + "live and die by vim": false, + "live and die by emacs": false, + "have a truck driver's license": false, +} + +var ranks = [ + "The AntiLynne", + "Poop martial", + "Twitter crossposter", + "Fake gamer", + "CLASS D LICENSE", + "Coin flipper", + "Much to learn", + "Lucky number sevlynne", + "Long leggy creacher", + "The Seer", + "Gosh Amongst Mortals" // unless you read the JS, in which case you are a poop martial +] +var score = 0; +var answered = 0; +var ready = false; +var current = null; + +function next_question(butotn) { + let correct = null; + let gamediv = dgel('quiz'); + if (!ready) { + ready = true; + } else { + correct = butotn.classList.contains("true") == questions[current] + if (correct) { score++; } + answered++; + } + + delete questions[current]; + + if (answered < 10) { + // https://stackoverflow.com/a/15106541 + var qkeys = Object.keys(questions); + current = qkeys[qkeys.length * Math.random() << 0]; + + gamediv.innerHTML = `

Question ${answered + 1}

True or false: I ${current}.

`; + } else { + gamediv.innerHTML = `

Finish!

You got ${score} points, earning you the rank of "${ranks[score]}"! Thanks for playing!

Play again`; + } +} + +window.addEventListener('DOMContentLoaded', (event) => { + dgel('quiz-questions').innerHTML = Object.keys(questions).length; + + dgel('quiz-start').onclick = next_question; +}); + +// @license-end \ No newline at end of file diff --git a/assets/script.js b/assets/script.js index adaee50..c8505da 100644 --- a/assets/script.js +++ b/assets/script.js @@ -2,7 +2,6 @@ var use_local_storage = storage_check(); var html_element = null; - function dgel(id) { return document.getElementById(id); } diff --git a/assets/style.css b/assets/style.css index 9c1f5e4..c24771a 100644 --- a/assets/style.css +++ b/assets/style.css @@ -232,6 +232,57 @@ html.night #theme-control::before { content: "Theme: Night"; } +button, a.button { + background: mediumpurple; + border: none; + cursor: pointer; + color: white; + font-size: 1.3em; + padding: 10px; + margin: 0 20px; + min-width: 100px; +} + +#quiz { + text-align: center; + position: relative; +} +.quiz-popup:not(.null) { + display: block; + position: absolute; + color: white; + top: 0; + left: 0; + right: 0; + bottom: 0; + font-size: 3em; + padding-top: 40px; + animation: quiz-popup-fadeout 0.25s 0.25s linear forwards; + animation-fill-mode: forwards; +} +.quiz-popup.true { + background: #0c9; +} +.quiz-popup.true::before { + content: "Correct!"; +} +.quiz-popup.false { + background: #c03; +} +.quiz-popup.false::before { + content: "Incorrect!"; +} + +@keyframes quiz-popup-fadeout { + 0% { + opacity: 1; + } + 100% { + opacity: 0; + pointer-events: none; + } +} + /*this is very silly do not look*/ #big-leggy-lynne { margin: 40px auto 0; @@ -253,16 +304,10 @@ html.night #theme-control::before { #bll-bottom { background: url('/assets/img/bll-send-pics.png'); } - #bll-enlarge { - background: mediumpurple; - border: none; - cursor: pointer; - color: white; font-size: 2em; - padding: 10px; - margin: 30px auto; display: block; + margin: 30px auto; } @media only screen and (max-width: 1200px) { diff --git a/quiz.html b/quiz.html new file mode 100644 index 0000000..2838d9e --- /dev/null +++ b/quiz.html @@ -0,0 +1,16 @@ +--- +title: Quiz +layout: default +less_important: true +--- + + + +

The Lynne Quiz

+
+

Welcome!

+

+ Hello and welcome to The Lynne Quiz! You will be presented with 10 of a possible PLEASE ENABLE JAVASCRIPT true or false questions. Your job is to answer as many of them as accurately as you can! Find out how well you truly know the bune behind it all. +

+ +
\ No newline at end of file