From e079df84fbb2adf3824f41720763026c11113668 Mon Sep 17 00:00:00 2001 From: Maxwell Jeffress Date: Thu, 7 Nov 2024 09:43:17 +1100 Subject: [PATCH] Upload all files --- index.css | 120 +++++++++++++++++++++++++++++++++++++++++++++++++++++ index.html | 44 ++++++++++++++++++++ index.js | 102 +++++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 266 insertions(+) create mode 100644 index.css create mode 100644 index.html create mode 100644 index.js diff --git a/index.css b/index.css new file mode 100644 index 0000000..4fc9951 --- /dev/null +++ b/index.css @@ -0,0 +1,120 @@ +@font-face { + font-family: "inter"; + @import url('https://fonts.googleapis.com/css2?family=Inter:ital,opsz,wght@0,14..32,100..900;1,14..32,100..900&display=swap'); +} + +body { + color: white; + background: rgb(255,0,0); + background: linear-gradient(336deg, rgba(255,0,0,1) 0%, rgba(74,73,255,1) 100%); + font-family: inter; + background-attachment: fixed; + margin-left: 20px; + margin-right: 20px; + margin-top: 20px; + margin-bottom: 20px; +} + +a { + color: white; +} + +.tiny { + font-size: 5pt; +} + +h1 { + font-size: 35pt; +} + +h2 { + font-size: 20pt; +} + +h3 { + font-size: 15pt; +} + +p { + font-size: 12pt; +} + +.section { + background-color: rgba(0, 0, 0, 0.1); + max-width: 75%; + border-radius: 10px; + margin-top: 10px; + margin-bottom: 10px; + padding: 5px +} + +.section h2 { + margin: 20px; +} + +.box { + color: white; + background: rgba(0, 0, 0, 0.5); + max-width: 95%; + border-radius: 10px; + margin-top: 10px; + margin-bottom: 10px; + margin-left: auto; + margin-right: auto; + padding: 5px; +} + +.box p { + margin: 10px; +} +.box h3 { + margin: 10px; +} +.box img { + margin: 10px; +} +.box button { + margin: 10px; +} + +.bluebutton { + color: white; + font-size: 12pt; + background: rgba(0, 0, 255, 0.3); + font-family: inter; + border-radius: 10px; + border: none; + padding: 5px; +} +.greenbutton { + color: white; + font-size: 12pt; + background: rgba(0, 255, 0, 0.3); + font-family: inter; + border-radius: 10px; + border: none; + padding: 5px; +} +.redbutton { + color: white; + font-size: 12pt; + background: rgba(255, 0, 0, 0.3); + font-family: inter; + border-radius: 10px; + border: none; + padding: 5px; +} +.backbutton { + color: white; + font-size: 12pt; + background: rgba(255, 0, 0, 0.3); + font-family: inter; + border-radius: 10px; + border: none; + padding: 5px; +} +.hidden { + display: none; +} + + diff --git a/index.html b/index.html new file mode 100644 index 0000000..148ec13 --- /dev/null +++ b/index.html @@ -0,0 +1,44 @@ + + + + The IQ Estimator + + + +
+

The IQ Estimator

+
+
+

Question 1

+

Are you an American citizen?

+ + +
+ + + + +
+
+ + + diff --git a/index.js b/index.js new file mode 100644 index 0000000..474d4ab --- /dev/null +++ b/index.js @@ -0,0 +1,102 @@ +var iqscore = 100; + +function getSnarkyRemark() { + if (iqscore < 0) { + return("Hmm... I'm guessing that you didn't go to any schooling beyond what's mandatory. Hey, just like most other Trump supporters!"); + } else if (iqscore == 50) { + return("Why didn't you register to vote? You could have saved democracy in America..."); + } else if (iqscore == 200) { + return("Only thing keeping you from greatness is all the other idiots living in America :/"); + } else if (iqscore == 250) { + return("Pity you don't live in America to help fight against the forces of evil."); + } +} + +function getResult() { + const resultPlaceholder = document.getElementById('resultPlaceholder'); + if (resultPlaceholder) { + resultPlaceholder.textContent = `is about ${iqscore} IQ!`; + } + const snarkyRemark = document.getElementById('snarkyRemark'); + if (snarkyRemark) { + snarkyRemark.textContent = getSnarkyRemark(); + } +} + +function international() { + iqscore += 50; + const qone = document.getElementById('q1'); + if (qone) { + qone.style.display = 'none'; + } + const qtwob = document.getElementById('q2b'); + if (qtwob) { + qtwob.style.display = 'block'; + } +} +function americanCitizen() { + iqscore -= 50; + const qone = document.getElementById('q1'); + if (qone) { + qone.style.display = 'none'; + } + const qtwoa = document.getElementById('q2a'); + if (qtwoa) { + qtwoa.style.display = 'block'; + } +} +function voted() { + iqscore += 50; + const qtwoa = document.getElementById('q2a'); + if (qtwoa) { + qtwoa.style.display = 'none'; + } + const qthree = document.getElementById('q3'); + if (qthree) { + qthree.style.display = 'block'; + } +} +function novoted() { + iqscore -= 100; + const qtwoa = document.getElementById('q2a'); + if (qtwoa) { + qtwoa.style.display = 'none'; + } + const qtwob = document.getElementById('q2b'); + if (qtwob) { + qtwob.style.display = 'block'; + } +} +function smartPerson() { + iqscore += 100; + const qtwob = document.getElementById('q2b'); + if (q2b) { + q2b.style.display = 'none'; + } + const qthree = document.getElementById('q3'); + if (qthree) { + qthree.style.display = 'none'; + } + const iqresult = document.getElementById('iqresult'); + if (iqresult) { + iqresult.style.display = 'block'; + getResult() + } +} +function noBrainCells() { + iqscore -= 500; + const qtwob = document.getElementById('q2b'); + if (q2b) { + q2b.style.display = 'none'; + } + const qthree = document.getElementById('q3'); + if (qthree) { + qthree.style.display = 'none'; + } + const iqresult = document.getElementById('iqresult'); + if (iqresult) { + iqresult.style.display = 'block'; + getResult() + } +} +