diff --git a/.prettierrc b/.prettierrc new file mode 100644 index 0000000..629b5eb --- /dev/null +++ b/.prettierrc @@ -0,0 +1,10 @@ +{ + "printWidth": 100, + "trailingComma": "all", + "tabWidth": 2, + "useTabs": false, + "htmlWhitespaceSensitivity": "strict", + "jsxBracketSameLine": false, + "semi": true, + "singleQuote": true +} diff --git a/401.html b/401.html index beae24e..b29833b 100644 --- a/401.html +++ b/401.html @@ -1,25 +1,27 @@ - - - + + + 401 | Conestoga Computer Science Club - - + + - - + + -
-

401

-

You may need to Login to view this page.

+
+

401

+

You may need to Login to view this page.

- - -

+ +

Home?

- \ No newline at end of file + diff --git a/404.html b/404.html index b8e5e9d..ef7597a 100644 --- a/404.html +++ b/404.html @@ -1,22 +1,23 @@ - - - + + + 404 | Conestoga Computer Science Club - - + + - - + + -
-

404

+
+

404

-

- Back? +

+ Back?

- \ No newline at end of file + diff --git a/index.html b/index.html index fcf8dfe..7575e72 100644 --- a/index.html +++ b/index.html @@ -1,54 +1,70 @@ - - - + + + Conestoga Computer Science Club - - + + - - - + + + - - + + - - - + + +
- - - - +
- - - - - -

Conestoga
Computer
Science Club

- + + + + + +

Conestoga
Computer
Science Club

+
@@ -58,10 +74,21 @@

About Us

-

Hello World, and welcome to the Conestoga Computer Science Club website! In addition to our weekly meetings (on Mondays in room 2005), we organize a variety of events throughout the year. Our flagship event is hackStoga (Stoga's annual hackathon), but we also organize a Scratchathon, two CodeFests, and participate and sometimes win local events. You should join our Schoology group!

- +

+ Hello World, and welcome to the Conestoga Computer Science Club website! In + addition to our weekly meetings (on Mondays in room 2005), we organize a variety of events + throughout the year. Our flagship event is hackStoga (Stoga's annual hackathon), but we + also organize a Scratchathon, two CodeFests, and participate and sometimes win local + events. You should join our + Schoology group! +

+
- +
@@ -70,37 +97,83 @@

About Us

Wins

- Philadelphia Classic
- ➔ Fall 1st Place Novice Division (2018)Matt Gusdorff, Rohit Chatterjee, Mihir Dhamankar
- ➔ Spring 1st Place Novice Division (2017)Jason Tu, Isaac Singer, Gary Lu
- ➔ Spring 2nd Place Novice Division (2015)Jason Tu, Orion Forowycz, Aaron Lee
- ➔ Spring Top 10 (2015)Dennis Lee, Jeffrey Huang, Michael Tao, Narahari Bharadwaj
- ➔ Spring Top 10 (2013)
- ➔ 3rd Place (2012)Jed Thompson, Jichao Sun, Scott Shi, Allen Zhu + Philadelphia Classic
+ ➔ Fall 1st Place Novice Division (2018)Matt Gusdorff, Rohit Chatterjee, Mihir Dhamankar
+ ➔ Spring 1st Place Novice Division (2017)Jason Tu, Isaac Singer, Gary Lu
+ ➔ Spring 2nd Place Novice Division (2015)Jason Tu, Orion Forowycz, Aaron Lee
+ ➔ Spring Top 10 (2015)Dennis Lee, Jeffrey Huang, Michael Tao, Narahari Bharadwaj
+ ➔ Spring Top 10 (2013)
+ ➔ 3rd Place (2012)Jed Thompson, Jichao Sun, Scott Shi, Allen Zhu

- hackBCA
- ➔ Top 10 and Best Mobile App (2017)Jason Tu, Jason Kim, Orion Forowycz
+ hackBCA
+ ➔ Top 10 and Best Mobile App (2017)Jason Tu, Jason Kim, Orion Forowycz

- MIT Blueprint
- ➔ Most Spirited (2018)Aaron Lee, Brady Monroe
- ➔ Best Continued Hack (2017)Jason Tu, Vikas Chelur, Michael Fan
- ➔ 3rd Place Novice Division (2016)Jason Tu, Jason Kim, Orion Forowycz, Aaron Lee
+ MIT Blueprint
+ ➔ Most Spirited (2018)Aaron Lee, Brady Monroe
+ ➔ Best Continued Hack (2017)Jason Tu, Vikas Chelur, Michael Fan
+ ➔ 3rd Place Novice Division (2016)Jason Tu, Jason Kim, Orion Forowycz, Aaron Lee

- hackMHS
- ➔ Best Usage of AWS (2016)Jason Tu, Richard Xu
- ➔ Best Education Hack (2016)Jack Damasco, et al.
+ hackMHS
+ ➔ Best Usage of AWS (2016)Jason Tu, Richard Xu
+ ➔ Best Education Hack (2016)Jack Damasco, et al.

- Swarthmore College Local Hack Day
- ➔ Best Overall (2016)Jason Tu, Michael Fan, Orion Forowycz, Richard Xu
+ Swarthmore College Local Hack Day
+ ➔ Best Overall (2016)Jason Tu, Michael Fan, Orion Forowycz, Richard Xu

- Widener Programming Competition
- ➔ Spring Top 10 (2022)
- ➔ 3rd Place (2015)
+ Widener Programming Competition
+ ➔ Spring Top 10 (2022)
+ ➔ 3rd Place (2015)

@@ -109,7 +182,10 @@

Wins

- +
@@ -119,15 +195,30 @@

Wins

-
-

Accounts

-

We operate accounts on several sites, some of which are listed below:

-

- Email — If you want to shoot us an email, you can reach us at officers@stogacs.club

- Github — Our GitHub organization page with all our repos (inlcuding this site)

- Schoology — You can join our Schoology group by clicking this link or with the code MRV4S-28MM5

-

-
+
+

Accounts

+

We operate accounts on several sites, some of which are listed below:

+

+ Email + — If you want to shoot us an email, you can reach us at + officers@stogacs.club

+ Github + — Our GitHub organization page with all our repos (inlcuding + this site)

+ Schoology + — You can join our Schoology group by clicking + this link + or with the code MRV4S-28MM5

+

+
@@ -137,50 +228,79 @@

Leadership

-
- -

- Wilson Zhang
- Co-President -

+
+
+ +
+
+
+

+ Wilson Zhang
+ Co-President +

+
+
-
- -

- Richard Zhang
- Co-President -

+
+
+ +
+
+
+

+ Richard Zhang
+ Co-President +

+
+
-
- -

- Anay Mohile
- Officer -

+
+
+ +
+
+
+

+ Anay Mohile
+ Officer +

+
+
-
- -

- Daniel Davis
- Officer -

+
+
+ +
+
+
+

+ Daniel Davis
+ Officer +

+
+
-
- -

- Milan Agarwala
- Officer -

+
+
+ +
+
+
+

+ Milan Agarwala
+ Officer +

+
+
-
@@ -188,4 +308,4 @@

Leadership

- \ No newline at end of file + diff --git a/leaderboard/index.html b/leaderboard/index.html index e262763..f0576cb 100644 --- a/leaderboard/index.html +++ b/leaderboard/index.html @@ -1,22 +1,21 @@ - - - - - + + + + Sharick Shekels | Conestoga Computer Science Club - - + + - - - + + + - - + + @@ -25,44 +24,66 @@ - - - + + + - +
- - - - + + + +
-
-
-

Sharick ShekelsBeta

- -
    - -
-
- - - -
- - +
+
+

Sharick Shekels

+ +
    + +
+
+ + +
-
+ + +
+
- \ No newline at end of file + + diff --git a/leaderboard/login.html b/leaderboard/login.html index 803e62e..51ac02f 100644 --- a/leaderboard/login.html +++ b/leaderboard/login.html @@ -52,7 +52,7 @@

Log in

Log in Options
- +
- -
- -
- -
- -
-
-
- - \ No newline at end of file + + + + diff --git a/leaderboard/shop/past.html b/leaderboard/shop/past.html index 5929aee..2441f02 100644 --- a/leaderboard/shop/past.html +++ b/leaderboard/shop/past.html @@ -1,22 +1,21 @@ - - - - - + + + + Sharick Shekels | Conestoga Computer Science Club - - + + - - - + + + - - + + @@ -25,47 +24,50 @@ - - - + + + - +
- - - - + + + +
-
-
-

My PurchasesPre

- - - - -
- - +
+
+

My PurchasesBeta

+ + +
-
-
+ +
+
- \ No newline at end of file + + diff --git a/media/admins/24MohileA.png b/media/admins/24MohileA.png new file mode 100644 index 0000000..a5ca30a Binary files /dev/null and b/media/admins/24MohileA.png differ diff --git a/presentations/index.html b/presentations/index.html index 70ff091..cce77ec 100644 --- a/presentations/index.html +++ b/presentations/index.html @@ -1,108 +1,110 @@ - - - - + + + + Presentations | Conestoga Computer Science Club - - + + - - - + + + - + - - - - + + + - - - - - -
- - - - +
+ - - -
-

Presentations

- -

Preview upcoming presentations, view past presentations, or sign up to present.

-
- -
- - -
-
-

Upcoming

-
- -
- -
-

Past

-
- -
- - +
+

Presentations

+ +

+ Preview upcoming presentations, view past presentations, or sign up to present. +

+
- - +
+ +
+
+

Upcoming

+
+
- - - +
+

Past

+
+
+ + + diff --git a/scripts/leaderboard.js b/scripts/leaderboard.js index 27254e3..a46a6d9 100644 --- a/scripts/leaderboard.js +++ b/scripts/leaderboard.js @@ -1,17 +1,17 @@ function getPurchases(userInfo) { - const isAdmin = userInfo?.admin; - let leaderboard = document.getElementById("leaderboard-list"); - const leaderboardTable = document.createElement('table'); - leaderboardTable.className = 'leaderboard center-text'; - specialColors = ["gold", "silver", "#9F7A34"] - let tableContent = ` + const isAdmin = userInfo?.admin; + let leaderboard = document.getElementById('leaderboard-list'); + const leaderboardTable = document.createElement('table'); + leaderboardTable.className = 'leaderboard center-text'; + specialColors = ['gold', 'silver', '#9F7A34']; + let tableContent = ` Rank Name Shekels `; - tableContent += ` + tableContent += `

ᔑ!

Mr. Sharick @@ -19,165 +19,177 @@ function getPurchases(userInfo) { `; - - fetch("https://shekels.mrsharick.com/users") - .then(response => response.json()) - .then(data => { - if (!data.disabled) { - for (let i = 0; i < data.length; i++) { - // add each user to the table - let rank = ordinal(i + 1); - let name = data[i].displayName || removeMiddle(data[i].name) || 'N/A'; - let shekels = (parseInt(data[i].shekels) !== 0) ? (parseInt(data[i].shekels) || 'N/A') : 0; - let discord_linked = data[i].discord_linked; - let shekelTags = isAdmin ? [`" + shekels, "p"]; - let nameTags = isAdmin ? [` `, ``, ""] : ["" + name, "", ""]; - let styleTag = ""; - if (i < specialColors.length) { - styleTag = `style="color: ${specialColors[i]}"`; - } - - if (discord_linked) { - tableContent += ` + fetch('https://shekels.mrsharick.com/users') + .then((response) => response.json()) + .then((data) => { + if (!data.disabled) { + for (let i = 0; i < data.length; i++) { + // add each user to the table + let rank = ordinal(i + 1); + let name = data[i].display_name || removeMiddle(data[i].name) || 'N/A'; + let shekels = parseInt(data[i].shekels) !== 0 ? parseInt(data[i].shekels) || 'N/A' : 0; + let discord_linked = data[i].discord_linked; + let shekelTags = isAdmin + ? [ + `' + shekels, 'p']; + let nameTags = isAdmin + ? [ + ` `, + ``, + '', + ] + : ['' + name, '', '']; + let styleTag = ''; + if (i < specialColors.length) { + styleTag = `style="color: ${specialColors[i]}"`; + } + + if (discord_linked) { + tableContent += ` ${rank} ${nameTags[0]}${nameTags[1]}${nameTags[2]} ${shekelTags[0]} `; - } else { - tableContent += ` + } else { + tableContent += ` ${rank} ${nameTags[0]}${nameTags[1]}${nameTags[2]} ${shekelTags[0]} `; - } - - } - + } + } - leaderboardTable.innerHTML = tableContent; - leaderboard.innerHTML = '

A badge indicates this person has linked their Discord account to the leaderboard.

'; - if (isAdmin) { - document.getElementById("new-row-button").style.display = ""; - document.getElementById("save-button").style.display = ""; - let footer = document.getElementById("footer-text"); - footer.innerHTML = ``; - } - leaderboard.appendChild(leaderboardTable); - } else { - leaderboard.innerHTML = `

Web access to the leaderboard is disabled.

`; - } - }) - .catch(error => { - leaderboard.innerHTML = `

An error occurred while accessing the leaderboard.

`; - console.log(error) + leaderboardTable.innerHTML = tableContent; + leaderboard.innerHTML = + '

A badge indicates this person has linked their Discord account to the leaderboard.

'; + if (isAdmin) { + document.getElementById('new-row-button').style.display = ''; + document.getElementById('save-button').style.display = ''; + let footer = document.getElementById('footer-text'); + footer.innerHTML = ``; } - ); + leaderboard.appendChild(leaderboardTable); + } else { + leaderboard.innerHTML = `

Web access to the leaderboard is disabled.

`; + } + }) + .catch((error) => { + leaderboard.innerHTML = `

An error occurred while accessing the leaderboard.

`; + console.log(error); + }); } function updateLeaderboard() { - const leaderboardTable = document.getElementsByClassName('leaderboard')[0]; - const rows = leaderboardTable.getElementsByTagName('tr'); - const data = []; - - // skipping the first 2 rows!!! - for (let i = 2; i < rows.length; i++) { - const row = rows[i]; - const shekel_guid = row.getAttribute('shekel_guid'); - const real_name = row.getElementsByTagName('input')[0].value; - const display_name = row.getElementsByTagName('input')[1].value; - const shekels = row.getElementsByTagName('input')[2].value; - data.push({ shekel_guid, real_name, display_name, shekels }); + const leaderboardTable = document.getElementsByClassName('leaderboard')[0]; + const rows = leaderboardTable.getElementsByTagName('tr'); + const data = []; + + // skipping the first 2 rows!!! + for (let i = 2; i < rows.length; i++) { + const row = rows[i]; + const shekel_guid = row.getAttribute('shekel_guid'); + const real_name = row.getElementsByTagName('input')[0].value; + const display_name = row.getElementsByTagName('input')[1].value; + const shekels = row.getElementsByTagName('input')[2].value; + data.push({ shekel_guid, real_name, display_name, shekels }); + } + + const json = JSON.stringify(data); + + fetch('https://shekels.mrsharick.com/users/update?discordAuth=' + getCookie('discordAuth'), { + method: 'POST', + headers: { + 'Content-Type': 'application/json', + }, + body: json, + }).then((response) => { + if (response.status == 200) { + window.location.reload(); + } else { + response.json().then((data) => { + document.getElementById( + 'subheading', + ).innerHTML = `

${data.message}

`; + }); } - - const json = JSON.stringify(data); - - fetch("https://shekels.mrsharick.com/users/update?discordAuth=" + getCookie("discordAuth"), { - method: 'POST', - headers: { - 'Content-Type': 'application/json' - }, - body: json - }).then(response => { - if (response.status == 200) { - window.location.reload(); - } else { - response.json() - .then(data => { - document.getElementById("subheading").innerHTML = `

${data.message}

`; - }) - } - }); + }); } //Visually delete the user from the table, does not send an api request anymore function deleteUser(shekel_guid) { - const leaderboardTable = document.getElementsByClassName('leaderboard')[0]; - const rows = leaderboardTable.getElementsByTagName('tr'); - for (let i = 2; i < rows.length; i++) { - const row = rows[i]; - if (row.getAttribute('shekel_guid') == shekel_guid) { - row.remove(); - break; - } + const leaderboardTable = document.getElementsByClassName('leaderboard')[0]; + const rows = leaderboardTable.getElementsByTagName('tr'); + for (let i = 2; i < rows.length; i++) { + const row = rows[i]; + if (row.getAttribute('shekel_guid') == shekel_guid) { + row.remove(); + break; } + } } function newRow() { - const leaderboardTable = document.getElementsByClassName('leaderboard')[0]; - const row = leaderboardTable.insertRow(-1); - row.innerHTML = ` + const leaderboardTable = document.getElementsByClassName('leaderboard')[0]; + const row = leaderboardTable.insertRow(-1); + row.innerHTML = ` `; } - function ordinal(i) { - var j = i % 10, - k = i % 100; - if (j == 1 && k != 11) { - return i + "st"; - } - if (j == 2 && k != 12) { - return i + "nd"; - } - if (j == 3 && k != 13) { - return i + "rd"; - } - return i + "th"; + var j = i % 10, + k = i % 100; + if (j == 1 && k != 11) { + return i + 'st'; + } + if (j == 2 && k != 12) { + return i + 'nd'; + } + if (j == 3 && k != 13) { + return i + 'rd'; + } + return i + 'th'; } function removeMiddle(name) { - let nameArray = name.split(" "); - if (nameArray.length > 2) { - nameArray.splice(1, 1); - return nameArray.join(" "); - } else { - return name; - } + let nameArray = name.split(' '); + if (nameArray.length > 2) { + nameArray.splice(1, 1); + return nameArray.join(' '); + } else { + return name; + } } - // On page load -document.addEventListener("DOMContentLoaded", async function () { - let userInfo = await verifyUser(); - if (userInfo != null) { - if (userInfo.name == null) { - window.location.href = "/leaderboard/onboarding/claim.html"; - } +document.addEventListener('DOMContentLoaded', async function () { + let userInfo = await verifyUser(); + if (userInfo != null) { + if (userInfo.name == null) { + window.location.href = '/leaderboard/onboarding/claim.html'; } - let leaderboard = document.getElementById("leaderboard-list"); - leaderboard.innerHTML = `

Loading leaderboard...

`; - getPurchases(userInfo); - let chars = "ᔑʖᓵ↸ᒷ⎓⊣⍑╎⋮ꖌꖎᒲリ𝙹!¡ᑑ∷ᓭℸ⚍⍊ᑑ/||⨅"; - function textEffect() { - try { document.getElementById("enchanted").innerHTML = chars.charAt(Math.floor(Math.random() * chars.length)) + chars.charAt(Math.floor(Math.random() * chars.length)); } catch (e) { } - } - setInterval(textEffect, 41); - -}); \ No newline at end of file + } + let leaderboard = document.getElementById('leaderboard-list'); + leaderboard.innerHTML = `

Loading leaderboard...

`; + getPurchases(userInfo); + let chars = 'ᔑʖᓵ↸ᒷ⎓⊣⍑╎⋮ꖌꖎᒲリ𝙹!¡ᑑ∷ᓭℸ⚍⍊ᑑ/||⨅'; + function textEffect() { + try { + document.getElementById('enchanted').innerHTML = + chars.charAt(Math.floor(Math.random() * chars.length)) + + chars.charAt(Math.floor(Math.random() * chars.length)); + } catch (e) {} + } + setInterval(textEffect, 41); +}); diff --git a/scripts/leaderboard/login.js b/scripts/leaderboard/login.js index 488164a..87891a2 100644 --- a/scripts/leaderboard/login.js +++ b/scripts/leaderboard/login.js @@ -1,34 +1,37 @@ -document.getElementById('login-code-entry').addEventListener('submit', function (event) { +// on page finish loading +document.addEventListener('DOMContentLoaded', async function () { + document.getElementById('login-code-entry').addEventListener('submit', function (event) { event.preventDefault(); loginWithCode(); + }); }); function loginWithCode() { - code = document.getElementById("login-code-for").value.replace(/\D/g, ''); + code = document.getElementById('login-code-for').value.replace(/\D/g, ''); - if (code.length != 6 || isNaN(code)) { - document.getElementById("error-display").innerHTML = "Invalid Code"; - return; - } + if (code.length != 6 || isNaN(code)) { + document.getElementById('error-display').innerHTML = 'Invalid Code'; + return; + } - fetch("https://shekels.mrsharick.com/me/login?code=" + code, { - method: "POST", - headers: { - "Content-Type": "application/json", - }, - body: JSON.stringify({ - "code": code, - }) + fetch('https://shekels.mrsharick.com/me/login?code=' + code, { + method: 'POST', + headers: { + 'Content-Type': 'application/json', + }, + body: JSON.stringify({ + code: code, + }), + }) + .then((response) => { + return response.json(); }) - .then(response => { - return response.json(); - }) - .then(result => { - if (result.success) { - setCookie("discordAuth", result.token, 7); - window.location.href = "/leaderboard/index.html"; - } else { - document.getElementById("error-display").innerHTML = result.message; - } - }) -} \ No newline at end of file + .then((result) => { + if (result.success) { + setCookie('discordAuth', result.token, 7); + window.location.href = '/leaderboard/index.html'; + } else { + document.getElementById('error-display').innerHTML = result.message; + } + }); +} diff --git a/scripts/leaderboard/manage.js b/scripts/leaderboard/manage.js index 3840f66..89efdeb 100644 --- a/scripts/leaderboard/manage.js +++ b/scripts/leaderboard/manage.js @@ -1,75 +1,84 @@ -document.addEventListener("DOMContentLoaded", async function () { - await verifyUser().then(userInfo => { - if (userInfo != null) { - if (userInfo.name == null) { - window.location.href = "/leaderboard/onboarding/claim.html"; - } - } else { - window.location.href = "/401"; - } - }); +document.addEventListener('DOMContentLoaded', async function () { + await verifyUser().then((userInfo) => { + if (userInfo != null) { + if (userInfo.name == null) { + window.location.href = '/leaderboard/onboarding/claim.html'; + } + } else { + window.location.href = '/401'; + } + }); }); function getLoginCode() { - fetch("https://shekels.mrsharick.com/me/login_code?discordAuth=" + getCookie("discordAuth"), { - method: "GET", - headers: { - "Content-Type": "application/json", - }, + fetch('https://shekels.mrsharick.com/me/login_code?discordAuth=' + getCookie('discordAuth'), { + method: 'GET', + headers: { + 'Content-Type': 'application/json', + }, + }) + .then((response) => { + if (response.status === 200) { + return response.json(); // Return the promise + } else { + document.getElementById('code-display').innerHTML = + "

Failed to fetch login code

"; + } + }) + .then((data) => { + // Now data contains the parsed JSON response + codeString = data.logonCode.toString(); + document.getElementById('code-display').innerText = + codeString.substr(0, 3) + '-' + codeString.substr(3, 6); + button = document.getElementById('code-button'); + button.innerText = + 'Expires In ' + + Math.max(1, Math.trunc(Math.round(data.expiresIn / 60 / 1000))) + + ' Minutes'; + button.className = 'pure-button pure-button-primary pure-button-disabled'; }) - .then(response => { - if (response.status === 200) { - return response.json(); // Return the promise - } else { - document.getElementById("code-display").innerHTML = "

Failed to fetch login code

"; - } - }) - .then(data => { - // Now data contains the parsed JSON response - codeString = data.logonCode.toString(); - document.getElementById("code-display").innerText = codeString.substr(0, 3) + "-" + codeString.substr(3, 6); - button = document.getElementById("code-button"); - button.innerText = "Expires In " + Math.max(1, Math.trunc(Math.round((data.expiresIn / 60) / 1000))) + " Minutes"; - button.className = "pure-button pure-button-primary pure-button-disabled"; - }) - .catch(error => { - document.getElementById("code-display").innerHTML = "

Failed to communicate with server.

"; - console.error(error); - }); + .catch((error) => { + document.getElementById('code-display').innerHTML = + "

Failed to communicate with server.

"; + console.error(error); + }); } - function submitData() { - document.getElementById("loader").style.display = ""; + document.getElementById('loader').style.display = ''; - - fetch("https://shekels.mrsharick.com/leaderboard/update_prefs?discordAuth=" + getCookie("discordAuth"), { - method: "POST", - headers: { - "Content-Type": "application/json", - }, - body: JSON.stringify({ - "display_name": document.getElementById("display-name-for").value, - }) + fetch( + 'https://shekels.mrsharick.com/leaderboard/update_prefs?discordAuth=' + + getCookie('discordAuth'), + { + method: 'POST', + headers: { + 'Content-Type': 'application/json', + }, + body: JSON.stringify({ + display_name: document.getElementById('display-name-for').value, + }), + }, + ) + .then((response) => { + return response.json(); + }) + .then((result) => { + // if code is 200, redirect to leaderboard + console.log(result); + if (result.success) { + window.location.href = '/leaderboard'; + } else { + document.getElementById('error-display').innerHTML = result.message; + } + document.getElementById('loader').style.display = 'none'; }) - .then(response => { - return response.json(); - }) - .then(result => { - // if code is 200, redirect to leaderboard - console.log(result) - if (result.success) { - window.location.href = "/leaderboard"; - } else { - document.getElementById("error-display").innerHTML = result.message; - } - document.getElementById("loader").style.display = "none"; - }) - .catch(error => { - console.log(error); - document.getElementById("error-display").innerHTML = "An error occurred while communicating with the server, please try again later."; - document.getElementById("loader").style.display = "none"; - }); + .catch((error) => { + console.log(error); + document.getElementById('error-display').innerHTML = + 'An error occurred while communicating with the server, please try again later.'; + document.getElementById('loader').style.display = 'none'; + }); - return false; -}; + return false; +} diff --git a/scripts/leaderboard/onboarding.js b/scripts/leaderboard/onboarding.js index 550d5f3..6712c39 100644 --- a/scripts/leaderboard/onboarding.js +++ b/scripts/leaderboard/onboarding.js @@ -1,51 +1,55 @@ -document.addEventListener("DOMContentLoaded", async function () { - // await verifyUser().then(userInfo => { - // if (userInfo != null) { - // if (userInfo.name != null) { - // window.location.href = "/leaderboard"; - // } - // } else { - // window.location.href = "/401"; - // } - // }); - +document.addEventListener('DOMContentLoaded', async function () { + // await verifyUser().then(userInfo => { + // if (userInfo != null) { + // if (userInfo.name != null) { + // window.location.href = "/leaderboard"; + // } + // } else { + // window.location.href = "/401"; + // } + // }); }); function submitData() { - document.getElementById("loader").style.display = ""; + document.getElementById('loader').style.display = ''; - let form = document.getElementById("claim-form"); + let form = document.getElementById('claim-form'); - fetch("https://shekels.mrsharick.com/leaderboard/claim?discordAuth=" + getCookie("discordAuth"), { - method: "POST", - headers: { - "Content-Type": "application/json" - }, - body: JSON.stringify({ - "name": form.elements["name-for"].value, - "grad_year": parseInt(form.elements["grad-year"].value) - }) + fetch('https://shekels.mrsharick.com/leaderboard/claim?discordAuth=' + getCookie('discordAuth'), { + method: 'POST', + headers: { + 'Content-Type': 'application/json', + }, + body: JSON.stringify({ + name: form.elements['name-for'].value, + grad_year: parseInt(form.elements['grad-year'].value), + }), + }) + .then((response) => { + return response.json(); + }) + .then((result) => { + console.log(result); + if (result.success) { + window.location.href = '/leaderboard'; + } else { + if (result.logout) { + window.location.href = + '/leaderboard/logout.html?message=' + + encodeURIComponent( + "The server wasn't able to verify your Discord account. Please sign in again via Discord or contact a club officer for assistance.", + ); + } + document.getElementById('error-display').innerHTML = result.message; + } + document.getElementById('loader').style.display = 'none'; }) - .then(response => { - return response.json(); - }) - .then(result => { - console.log(result) - if (result.success) { - window.location.href = "/leaderboard"; - } else { - if (result.logout) { - window.location.href = "/leaderboard/logout.html?message=" + encodeURIComponent("The server wasn't able to verify your Discord account. Please sign in again via Discord or contact a club officer for assistance."); - } - document.getElementById("error-display").innerHTML = result.message; - } - document.getElementById("loader").style.display = "none"; - }) - .catch(error => { - console.log(error); - document.getElementById("error-display").innerHTML = "An error occurred while communicating with the server, please try again later."; - document.getElementById("loader").style.display = "none"; - }); + .catch((error) => { + console.log(error); + document.getElementById('error-display').innerHTML = + 'An error occurred while communicating with the server, please try again later.'; + document.getElementById('loader').style.display = 'none'; + }); - return false; -}; + return false; +} diff --git a/scripts/leaderboard/purchases.js b/scripts/leaderboard/purchases.js index c2f2bca..2ee6aef 100644 --- a/scripts/leaderboard/purchases.js +++ b/scripts/leaderboard/purchases.js @@ -1,17 +1,17 @@ function getPurchases(userInfo) { - const noPurchaseText = [ - "You have not purchased anything yet.", - "We looked far and wide but couldn't find any purchases.", - "Despite our diligent search, not a single item found its way into your possession.", - "Why did you even come here? You got to buy something first.", - "Why are we even here? Just to suffer?", - "Like a magician's assistant with a pocketful of empty hats, we pulled nothing out of our bag of tricks.", - "Nobody here but us chickens.", - ] - let chart = document.getElementById("purchases-table"); - const purchaseTable = document.createElement('table'); - purchaseTable.className = 'leaderboard center-text'; - let tableContent = ` + const noPurchaseText = [ + 'You have not purchased anything yet.', + "We looked far and wide but couldn't find any purchases.", + 'Despite our diligent search, not a single item found its way into your possession.', + 'Why did you even come here? You got to buy something first.', + 'Why are we even here? Just to suffer?', + "Like a magician's assistant with a pocketful of empty hats, we pulled nothing out of our bag of tricks.", + 'Nobody here but us chickens.', + ]; + let chart = document.getElementById('purchases-table'); + const purchaseTable = document.createElement('table'); + purchaseTable.className = 'leaderboard center-text'; + let tableContent = `
@@ -19,55 +19,58 @@ function getPurchases(userInfo) { `; - fetch("https://shekels.mrsharick.com/me/purchases?discordAuth=" + getCookie("discordAuth")) - .then(response => response.json()) - .then(data => { - if (data.success) { - data.products.reverse(); - if (data.products.length > 0) { - for (let i = 0; i < data.products.length; i++) { - console.log(data.products[i]) - let expiry; - data.products[i].expires_after == null ? expiry = "Never" : expiry = new Date(data.products[i].expires_after).toLocaleString().split(",")[0]; - ts = data.products[i].timestamp = new Date(data.products[i].timestamp); - tableContent += ` + fetch('https://shekels.mrsharick.com/me/purchases?discordAuth=' + getCookie('discordAuth')) + .then((response) => response.json()) + .then((data) => { + if (data.success) { + data.products.reverse(); + if (data.products.length > 0) { + for (let i = 0; i < data.products.length; i++) { + console.log(data.products[i]); + let expiry; + data.products[i].expires_after == null + ? (expiry = 'Never') + : (expiry = new Date(data.products[i].expires_after).toLocaleString().split(',')[0]); + ts = data.products[i].timestamp = new Date(data.products[i].timestamp); + tableContent += ` - + - ` - } - } else { - tableContent += ``; - } - - purchaseTable.innerHTML = tableContent; - chart.innerHTML = purchaseTable.outerHTML; - } else { - tableContent += ``; - } - }) - .catch(error => { - chart.innerHTML = ``; - console.log(error) - }); -} - - -document.addEventListener("DOMContentLoaded", async function() { - let userInfo; - await verifyUser().then(userInfo => { - if (userInfo != null) { - if (userInfo.name == null) { - window.location.href = "/leaderboard/onboarding/claim.html"; + `; } } else { - window.location.href = "/401"; + tableContent += ``; } - userInfo = userInfo; + + purchaseTable.innerHTML = tableContent; + chart.innerHTML = purchaseTable.outerHTML; + } else { + tableContent += ``; + } + }) + .catch((error) => { + chart.innerHTML = ``; + console.log(error); }); - let chart = document.getElementById("purchases-table"); - chart.innerHTML = `

Now Loading...

`; - getPurchases(userInfo); -}); \ No newline at end of file +} + +document.addEventListener('DOMContentLoaded', async function () { + let userInfo; + await verifyUser().then((userInfo) => { + if (userInfo != null) { + if (userInfo.name == null) { + window.location.href = '/leaderboard/onboarding/claim.html'; + } + } else { + window.location.href = '/401'; + } + userInfo = userInfo; + }); + let chart = document.getElementById('purchases-table'); + chart.innerHTML = `

Now Loading...

`; + getPurchases(userInfo); +}); diff --git a/scripts/leaderboard/store.js b/scripts/leaderboard/store.js index 42a953e..881d989 100644 --- a/scripts/leaderboard/store.js +++ b/scripts/leaderboard/store.js @@ -1,45 +1,49 @@ -document.addEventListener("DOMContentLoaded", async function () { +document.addEventListener('DOMContentLoaded', async function () { let userinfo; - await verifyUser().then(userInfo => { + await verifyUser().then((userInfo) => { userinfo = userInfo; if (userInfo != null) { if (userInfo.name == null) { - window.location.href = "/leaderboard/onboarding/claim.html"; + window.location.href = '/leaderboard/onboarding/claim.html'; } } else { - document.getElementById("alert-signin").style = "display: inline-flex;"; - document.getElementById("account-description").innerText = "Sign in to see your account details."; - document.getElementById("past-purchase-button").classList.add("pure-button-disabled"); + document.getElementById('alert-signin').style = 'display: inline-flex;'; + document.getElementById('account-description').innerText = + 'Sign in to see your account details.'; + document.getElementById('past-purchase-button').classList.add('pure-button-disabled'); } - - fetch("https://shekels.mrsharick.com/me/purchases?discordAuth=" + getCookie("discordAuth")) - .then(response => response.json()) - .then(data => { - if (data.success) { - let latestPurchase; - if (data.products.length > 0) { - latestPurchase = data.products[0].title + " (" + data.products[0].price + " Shekels)"; - } else { - latestPurchase = "Never"; - } - document.getElementById("account-description").innerText = "Shekels: " + userInfo.shekels + "
Last Purchase: " + latestPurchase; - document.getElementById("account-title").innerHTML = userInfo.name; - } - }) - .catch(error => { - console.log(error) + fetch('https://shekels.mrsharick.com/me/purchases?discordAuth=' + getCookie('discordAuth')) + .then((response) => response.json()) + .then((data) => { + if (data.success) { + let latestPurchase; + if (data.products.length > 0) { + latestPurchase = data.products[0].title + ' (' + data.products[0].price + ' Shekels)'; + } else { + latestPurchase = 'Never'; + } + document.getElementById('account-description').innerHTML = + `

` + + 'Shekels: ' + + userInfo.shekels + + '
Last Purchase: ' + + latestPurchase + + `

`; + document.getElementById('account-title').innerHTML = userInfo.name; } - ); - + }) + .catch((error) => { + console.log(error); + }); }); try { - const response = await fetch("https://shekels.mrsharick.com/shop/items", { - method: "GET", + const response = await fetch('https://shekels.mrsharick.com/shop/items', { + method: 'GET', headers: { - "Content-Type": "application/json" - } + 'Content-Type': 'application/json', + }, }); if (!response.ok) { @@ -48,28 +52,27 @@ document.addEventListener("DOMContentLoaded", async function () { const data = await response.json(); items = Object.values(data.products); - element = document.getElementById("shop-cards") + element = document.getElementById('shop-cards'); if (items.length > 0) { - items.forEach(item => { - createCard(element, item); + items.forEach((item) => { + createCard(element, item); }); - items.forEach(item => { + items.forEach((item) => { if (item.hasImg) { updateCard(item.id, fetchImage(item.id)); } }); } else { - document.getElementById("error-display").innerHTML = "There's nothing in store for you at the moment..."; + document.getElementById('error-display').innerHTML = + "There's nothing in store for you at the moment..."; } - } catch (error) { console.error(error); } }); function createCard(parent, item) { - - const card = document.createElement("div"); + const card = document.createElement('div'); card.innerHTML = `
@@ -102,37 +105,43 @@ function fetchImage(id) { return `https://shekels.mrsharick.com/getasset/shop_${id}.png`; } - -document.addEventListener("click", function (event) { - if (event.target && (event.target.classList.contains("buy-button") || event.target.classList.contains("button-text")) ) { +document.addEventListener('click', function (event) { + if ( + event.target && + (event.target.classList.contains('buy-button') || + event.target.classList.contains('button-text')) + ) { buyProduct(event.target.id); } }); function buyProduct(id) { - fetch("https://shekels.mrsharick.com/shop/purchase?" + "discordAuth=" + getCookie("discordAuth"), { - method: "POST", - headers: { - "Content-Type": "application/json", + fetch( + 'https://shekels.mrsharick.com/shop/purchase?' + 'discordAuth=' + getCookie('discordAuth'), + { + method: 'POST', + headers: { + 'Content-Type': 'application/json', + }, + body: JSON.stringify({ + discordAuth: getCookie('discordAuth'), + itemID: id, + }), }, - body: JSON.stringify({ - "discordAuth": getCookie("discordAuth"), - "itemID": id - }) - }) - .then(response => { + ) + .then((response) => { return response.json(); }) - .then(result => { - console.log(result) + .then((result) => { + console.log(result); if (result.success) { - window.location.href = "/leaderboard/shop/past.html"; + window.location.href = '/leaderboard/shop/past.html'; } else { - document.getElementById("error-display").innerHTML = result.message; + document.getElementById('error-display').innerHTML = result.message; } }) - .catch(error => { - document.getElementById("error-display").innerHTML = "Failed to communicate with server."; + .catch((error) => { + document.getElementById('error-display').innerHTML = 'Failed to communicate with server.'; console.error(error); }); -} \ No newline at end of file +} diff --git a/scripts/main.js b/scripts/main.js index d5acb89..1a894fa 100644 --- a/scripts/main.js +++ b/scripts/main.js @@ -1,7 +1,7 @@ -let events = ["Scratchathon", "CodeFest", "hackStoga"]; +let events = ['Scratchathon', 'CodeFest', 'hackStoga']; let day = Math.floor((Date.now() - new Date(new Date().getFullYear(), 0, 0)) / 86400000); -let navbar = document.getElementById("navbar-links"); +let navbar = document.getElementById('navbar-links'); let activity = events[day > 310 ? 1 : day > 245 ? 0 : day > 100 ? 1 : day > 30 ? 2 : 1]; // Uncomment out when Scratchathon, CodeFest, and hackStoga pages are completed -// navbar.innerHTML += `\n
  • ${activity}
  • `; \ No newline at end of file +// navbar.innerHTML += `\n
  • ${activity}
  • `; diff --git a/scripts/navbar.js b/scripts/navbar.js index 2b497e2..89dfae9 100644 --- a/scripts/navbar.js +++ b/scripts/navbar.js @@ -1,45 +1,47 @@ -document.addEventListener("DOMContentLoaded", async function () { - let navbar = document.getElementById("navbar-links"); - const specialPages = { - "shop": { - "Purchased": "/leaderboard/shop/past.html", - }, - "leaderboard": { - "Shop": "/leaderboard/shop", - "Purchased": "/leaderboard/shop/past.html", - }, - "login": { - "Leaderboard": "/leaderboard/", - "Home": "/" - }, - } +document.addEventListener('DOMContentLoaded', async function () { + let navbar = document.getElementById('navbar-links'); + const specialPages = { + shop: { + Purchased: '/leaderboard/shop/past.html', + }, + leaderboard: { + Shop: '/leaderboard/shop', + Purchased: '/leaderboard/shop/past.html', + }, + login: { + Leaderboard: '/leaderboard/', + Home: '/', + }, + }; - let currentPath = window.location.pathname - // remove trailing slash from currentPath - if (currentPath[currentPath.length - 1] == "/") { - currentPath = currentPath.slice(0, -1); - } - let currentPage = currentPath.slice(currentPath.lastIndexOf("/") + 1); - if (currentPage == "index.html") { - currentPage = currentPath.slice(0, currentPath.lastIndexOf("/")); - currentPage = currentPage.slice(currentPage.lastIndexOf("/") + 1); - } + let currentPath = window.location.pathname; + // remove trailing slash from currentPath + if (currentPath[currentPath.length - 1] == '/') { + currentPath = currentPath.slice(0, -1); + } + let currentPage = currentPath.slice(currentPath.lastIndexOf('/') + 1); + if (currentPage == 'index.html') { + currentPage = currentPath.slice(0, currentPath.lastIndexOf('/')); + currentPage = currentPage.slice(currentPage.lastIndexOf('/') + 1); + } - if (specialPages[currentPage]) { - for (let page in specialPages[currentPage]) { - navbar.innerHTML += `
  • ${page}
  • `; - } + if (specialPages[currentPage]) { + for (let page in specialPages[currentPage]) { + navbar.innerHTML += `
  • ${page}
  • `; } - navbar.innerHTML += `
  • Now Loading

  • `; - getLoginDetails(); - await verifyUser().then(userInfo => { - document.getElementById("loader").remove(); - if (userInfo != null) { - let displayTag = userInfo.discordDiscriminator == 0 ? "" : "#" + userInfo.discordDiscriminator; - navbar.innerHTML += `
  • ${userInfo.discordUsername + displayTag}
  • `; - } else { - navbar.innerHTML += `\n
  • Login
  • `; - } - }); - + } + navbar.innerHTML += `
  • Now Loading

  • `; + getLoginDetails(); + await verifyUser().then((userInfo) => { + document.getElementById('loader').remove(); + if (userInfo != null) { + let displayTag = + userInfo.discordDiscriminator == 0 ? '' : '#' + userInfo.discordDiscriminator; + navbar.innerHTML += `
  • ${ + userInfo.discordUsername + displayTag + }
  • `; + } else { + navbar.innerHTML += `\n
  • Login
  • `; + } + }); }); diff --git a/scripts/presentations/presentations.js b/scripts/presentations/presentations.js index d2462ca..e246617 100644 --- a/scripts/presentations/presentations.js +++ b/scripts/presentations/presentations.js @@ -1,189 +1,208 @@ -const link = "https://presentations-api.frankanator433.repl.co/" - -$.get(link + "getNextDays", (dateData, status) => { - var flex = document.getElementById("upc-flex"); - for (i in dateData) { - var item = document.createElement("span"); - item.className = "pres-item"; - flex.appendChild(item); - - var banner = document.createElement("section"); - banner.className = "col-ban"; - item.appendChild(banner); - var title = document.createElement("h1"); - title.innerHTML = dateData[i]; - banner.appendChild(title); - - var desc = document.createElement("p"); - desc.className = "pres-desc" - desc.id = "desc-"+dateData[i] - item.appendChild(desc); - $.ajax({ - type: "GET", - url: link + "requestDayInfo", - data: { - day:dateData[i] - }, - async: false, - success: function(meetingData) { - desc.innerHTML = ` +const link = 'https://presentations-api.frankanator433.repl.co/'; + +$.get(link + 'getNextDays', (dateData, status) => { + var flex = document.getElementById('upc-flex'); + for (i in dateData) { + var item = document.createElement('span'); + item.className = 'pres-item'; + flex.appendChild(item); + + var banner = document.createElement('section'); + banner.className = 'col-ban'; + item.appendChild(banner); + var title = document.createElement('h1'); + title.innerHTML = dateData[i]; + banner.appendChild(title); + + var desc = document.createElement('p'); + desc.className = 'pres-desc'; + desc.id = 'desc-' + dateData[i]; + item.appendChild(desc); + $.ajax({ + type: 'GET', + url: link + 'requestDayInfo', + data: { + day: dateData[i], + }, + async: false, + success: function (meetingData) { + desc.innerHTML = + ` Time Slot 1:
    -Topic: `+ meetingData[0][0] + ` +Topic: ` + + meetingData[0][0] + + `

    -Presenters: `+meetingData[0][1]+` +Presenters: ` + + meetingData[0][1] + + `

    Time Slot 2:
    -Topic: `+meetingData[1][0] + ` +Topic: ` + + meetingData[1][0] + + `

    -Presenters: `+ meetingData[1][1] - ; - } - }); - - } +Presenters: ` + + meetingData[1][1]; + }, + }); + } }); -$.get(link + "getAllPastDays", (dateData, status) => { - console.log(dateData); - var flex = document.getElementById("pas-flex"); - for (i in dateData) { - var item = document.createElement("span"); - item.className = "pres-item"; - flex.appendChild(item); - - var banner = document.createElement("section"); - banner.className = "col-ban blue-mod"; - item.appendChild(banner); - var title = document.createElement("h1"); - title.innerHTML = dateData[i]; - banner.appendChild(title); - - var desc = document.createElement("p"); - desc.className = "pres-desc" - desc.id = "desc-"+dateData[i] - item.appendChild(desc); - $.ajax({ - type: "GET", - url: link + "requestDayInfo", - data: { - day:dateData[i] - }, - async: false, - success: function(meetingData) { - desc.innerHTML = ` +$.get(link + 'getAllPastDays', (dateData, status) => { + console.log(dateData); + var flex = document.getElementById('pas-flex'); + for (i in dateData) { + var item = document.createElement('span'); + item.className = 'pres-item'; + flex.appendChild(item); + + var banner = document.createElement('section'); + banner.className = 'col-ban blue-mod'; + item.appendChild(banner); + var title = document.createElement('h1'); + title.innerHTML = dateData[i]; + banner.appendChild(title); + + var desc = document.createElement('p'); + desc.className = 'pres-desc'; + desc.id = 'desc-' + dateData[i]; + item.appendChild(desc); + $.ajax({ + type: 'GET', + url: link + 'requestDayInfo', + data: { + day: dateData[i], + }, + async: false, + success: function (meetingData) { + desc.innerHTML = + ` Time Slot 1:
    -Topic: ` + meetingData[0][0] + `` + ` +Topic: ` + + meetingData[0][0] + + `` + + `

    -Presenters: `+meetingData[0][1]+` +Presenters: ` + + meetingData[0][1] + + `

    Time Slot 2:
    -Topic: ` + meetingData[1][0] + `` + ` +Topic: ` + + meetingData[1][0] + + `` + + `

    -Presenters: `+ meetingData[1][1] - ; - } - }); - - } +Presenters: ` + + meetingData[1][1]; + }, + }); + } }); -$.get(link + "getAllFutureDays", (nextDays, status) => { - var sel = document.getElementById("dateSelect"); - for (i in nextDays) { - var option = document.createElement('option'); - option.text = option.value = nextDays[i]; - sel.add(option); - } +$.get(link + 'getAllFutureDays', (nextDays, status) => { + var sel = document.getElementById('dateSelect'); + for (i in nextDays) { + var option = document.createElement('option'); + option.text = option.value = nextDays[i]; + sel.add(option); + } }); - - function makeSignup() { - var backgr = document.getElementById("signupDialog"); - backgr.style.display="flex" -}; + var backgr = document.getElementById('signupDialog'); + backgr.style.display = 'flex'; +} function destroySignup() { - var backgr = document.getElementById("signupDialog"); - backgr.style.display="none" -}; + var backgr = document.getElementById('signupDialog'); + backgr.style.display = 'none'; +} function check() { - $.ajax({ - type: "GET", - url: link + "status", - data: { - - "day":$("#dateSelect").val(), - "time":$("#timeSelect").val() - }, - async: false, - success: function(meetingData) { - if (meetingData) { - document.getElementById("overrideText").innerHTML = ` + $.ajax({ + type: 'GET', + url: link + 'status', + data: { + day: $('#dateSelect').val(), + time: $('#timeSelect').val(), + }, + async: false, + success: function (meetingData) { + if (meetingData) { + document.getElementById('overrideText').innerHTML = ` Make an override password for your presentation. Make sure it is not another password you use, there is absolutely no encryption of these. Make sure to remember this, you'll need it to edit. `; - document.getElementById("submit").innerHTML = "Sign up" - document.getElementById("modal-title").innerHTML = "Sign up to present" - } else { - document.getElementById("overrideText").innerHTML = "Input your override password or the global admin password."; - document.getElementById("submit").innerHTML = "Edit" - document.getElementById("modal-title").innerHTML = "Edit presentation" - } - } - }); -}; - -$(function(ready){ - $('#dateSelect').change(function(){ - check(); - }); + document.getElementById('submit').innerHTML = 'Sign up'; + document.getElementById('modal-title').innerHTML = 'Sign up to present'; + } else { + document.getElementById('overrideText').innerHTML = + 'Input your override password or the global admin password.'; + document.getElementById('submit').innerHTML = 'Edit'; + document.getElementById('modal-title').innerHTML = 'Edit presentation'; + } + }, + }); +} + +$(function (ready) { + $('#dateSelect').change(function () { + check(); + }); }); -window.onload = check +window.onload = check; -$(function(ready){ - - $('#timeSelect').change(function(){ - check(); - }); +$(function (ready) { + $('#timeSelect').change(function () { + check(); + }); }); function register() { - document.getElementById("submit").innerHTML = "..."; - document.getElementById("submit").disabled = true; - if ($("#topic").val() === "" || $("#presenters").val() === "" || $("#link").val() === "" || $("#pw").val() === "") { - document.getElementById("submit").disabled = false; - document.getElementById("submit").innerHTML = "Fill all fields"; - } else { - $.ajax({ - type: "POST", - url: link + "register", - data: { - "day":$("#dateSelect").val(), - "time":$("#timeSelect").val(), - "topic":$("#topic").val(), - "presenters":$("#presenters").val(), - "link":$("#link").val(), - "pw":$("#pw").val(), - }, - headers: {}, - async: false, - mode: 'cors', - success: function(res) { - document.getElementById("submit").innerHTML = res - if (res == "Success") { - setTimeout(function(){ - location.reload(); - }, 2000); // 3000 milliseconds = 2 seconds - } else { - document.getElementById("submit").disabled = false; - } - } - }); - } - -} \ No newline at end of file + document.getElementById('submit').innerHTML = '...'; + document.getElementById('submit').disabled = true; + if ( + $('#topic').val() === '' || + $('#presenters').val() === '' || + $('#link').val() === '' || + $('#pw').val() === '' + ) { + document.getElementById('submit').disabled = false; + document.getElementById('submit').innerHTML = 'Fill all fields'; + } else { + $.ajax({ + type: 'POST', + url: link + 'register', + data: { + day: $('#dateSelect').val(), + time: $('#timeSelect').val(), + topic: $('#topic').val(), + presenters: $('#presenters').val(), + link: $('#link').val(), + pw: $('#pw').val(), + }, + headers: {}, + async: false, + mode: 'cors', + success: function (res) { + document.getElementById('submit').innerHTML = res; + if (res == 'Success') { + setTimeout(function () { + location.reload(); + }, 2000); // 3000 milliseconds = 2 seconds + } else { + document.getElementById('submit').disabled = false; + } + }, + }); + } +} diff --git a/scripts/utils.js b/scripts/utils.js index 47b92ff..1113735 100644 --- a/scripts/utils.js +++ b/scripts/utils.js @@ -1,59 +1,62 @@ const knownVersion = 'Mi4wLjA'; function getCookie(name) { - const cookies = document.cookie.split(';'); - for (let i = 0; i < cookies.length; i++) { - const cookie = cookies[i].trim(); - if (cookie.startsWith(name + '=')) { - return cookie.substring(name.length + 1); - } + const cookies = document.cookie.split(';'); + for (let i = 0; i < cookies.length; i++) { + const cookie = cookies[i].trim(); + if (cookie.startsWith(name + '=')) { + return cookie.substring(name.length + 1); } - return null; + } + return null; } function setCookie(name, value, days) { - const expirationDate = new Date(); - expirationDate.setDate(expirationDate.getDate() + days); - const cookieValue = encodeURIComponent(value) + (days ? `; expires=${expirationDate.toUTCString()};` : ''); - document.cookie = `${name}=${cookieValue}; path=/`; + const expirationDate = new Date(); + expirationDate.setDate(expirationDate.getDate() + days); + const cookieValue = + encodeURIComponent(value) + (days ? `; expires=${expirationDate.toUTCString()};` : ''); + document.cookie = `${name}=${cookieValue}; path=/`; } function deleteCookie(name) { - document.cookie = `${name}=; expires=Thu, 01 Jan 1970 00:00:00 UTC; path=/;`; + document.cookie = `${name}=; expires=Thu, 01 Jan 1970 00:00:00 UTC; path=/;`; } function getLoginDetails() { - const urlParams = new URLSearchParams(window.location.search); - const access_token = urlParams.get('access_token'); + const urlParams = new URLSearchParams(window.location.search); + const access_token = urlParams.get('access_token'); - if (access_token != null) { - setCookie('discordAuth', access_token, 7); - window.location.href = window.location.href.split('?')[0]; - } + if (access_token != null) { + setCookie('discordAuth', access_token, 7); + window.location.href = window.location.href.split('?')[0]; + } } async function verifyUser() { - const access_token = getCookie('discordAuth'); - if (access_token != null) { - try { - const response = await fetch(`https://shekels.mrsharick.com/discord/user?token=${access_token}`); - const data = await response.json(); - if (response.status != 200) { - deleteCookie('discordAuth'); - return null; - } - return data; - } catch (error) { - console.error(error); - return null; - } - } else { + const access_token = getCookie('discordAuth'); + if (access_token != null) { + try { + const response = await fetch( + `https://shekels.mrsharick.com/discord/user?token=${access_token}`, + ); + const data = await response.json(); + if (response.status != 200) { + deleteCookie('discordAuth'); return null; + } + return data; + } catch (error) { + console.error(error); + return null; } + } else { + return null; + } } async function isUpToDate() { - const response = await fetch('https://shekels.mrsharick.com/api/version'); - const data = await response.json(); - return data.version == knownVersion; -} \ No newline at end of file + const response = await fetch('https://shekels.mrsharick.com/api/version'); + const data = await response.json(); + return data.version == knownVersion; +} diff --git a/style/gallery.css b/style/gallery.css index 148f73d..5ce445b 100644 --- a/style/gallery.css +++ b/style/gallery.css @@ -2,13 +2,13 @@ /* screens */ @media screen and (min-width: 800px) { - .formatting-separator { - height: 100px; - } + .formatting-separator { + height: 100px; + } } #splash { - /* temporary, lets try to find another banner for this page */ - background-image: url("/media/banners/resources.png"); - font-family: "Montserrat", sans-serif; -} \ No newline at end of file + /* temporary, lets try to find another banner for this page */ + background-image: url('/media/banners/resources.png'); + font-family: 'Montserrat', sans-serif; +} diff --git a/style/hackstoga.css b/style/hackstoga.css index 63cc4ba..955df17 100644 --- a/style/hackstoga.css +++ b/style/hackstoga.css @@ -1,133 +1,133 @@ #cover { - background-image: url("/media/banners/hackstoga24.jpg"); - background-size: cover; - color: var(--light); - min-height: 50em; - background-color: rgba(0, 0, 0, 0.25); - background-blend-mode: multiply; + background-image: url('/media/banners/hackstoga24.jpg'); + background-size: cover; + color: var(--light); + min-height: 50em; + background-color: rgba(0, 0, 0, 0.25); + background-blend-mode: multiply; } #title { - font-size: 5em; - margin: 0; - font-weight: bolder; - text-shadow: 2px 2px 3px var(--superdark); + font-size: 5em; + margin: 0; + font-weight: bolder; + text-shadow: 2px 2px 3px var(--superdark); } #subtitle { - font-size: x-large; + font-size: x-large; } #about { - color: var(--light); - font-size: 120%; + color: var(--light); + font-size: 120%; } #sponsors { - background-color: var(--superdark); - color: var(--light); - font-size: 120%; + background-color: var(--superdark); + color: var(--light); + font-size: 120%; } #faq { - color: var(--light); - font-size: 120%; + color: var(--light); + font-size: 120%; } #schedule { - background-color: var(--superdark); - color: var(--light); - font-size: 120%; + background-color: var(--superdark); + color: var(--light); + font-size: 120%; } #footer { - color: var(--light); - background-color: var(--superdark); + color: var(--light); + background-color: var(--superdark); } /* details */ details { - padding: 1rem; - margin: 1em; - transition: background-color 0.1s ease-in-out; - background-color: var(--darker); - border-radius: 1em; + padding: 1rem; + margin: 1em; + transition: background-color 0.1s ease-in-out; + background-color: var(--darker); + border-radius: 1em; } details[open] { - background-color: var(--darkred); + background-color: var(--darkred); } details p { - font-size: 120%; + font-size: 120%; } details summary { - font-size: 130%; - cursor: pointer; - user-select: none; - transition: margin 70ms ease-in-out; + font-size: 130%; + cursor: pointer; + user-select: none; + transition: margin 70ms ease-in-out; } details[open] summary { - margin-bottom: 2em; - font-size: 130%; + margin-bottom: 2em; + font-size: 130%; } /* screens */ @media screen and (min-width: 800px) { - .formatting-separator { - height: 100px; - } + .formatting-separator { + height: 100px; + } } @media screen and (max-width: 800px) { - #title { - font-size: 3.5em; - } + #title { + font-size: 3.5em; + } - #subtitle { - font-size: medium; - } + #subtitle { + font-size: medium; + } } /* dividers */ .waves-divider { - bottom: 0; - left: 0; - width: 100%; - overflow: hidden; - line-height: 0; - transform: rotate(180deg) translateY(148px); + bottom: 0; + left: 0; + width: 100%; + overflow: hidden; + line-height: 0; + transform: rotate(180deg) translateY(148px); } .waves-divider svg { - position: relative; - display: block; - width: calc(100% + 1.3px); - height: 150px; + position: relative; + display: block; + width: calc(100% + 1.3px); + height: 150px; } .waves-divider .shape-fill { - fill: var(--dark); + fill: var(--dark); } .triangle-divider { - top: 0; - left: 0; - width: 100%; - overflow: hidden; - line-height: 0; - transform: rotate(180deg); + top: 0; + left: 0; + width: 100%; + overflow: hidden; + line-height: 0; + transform: rotate(180deg); } .triangle-divider svg { - position: relative; - display: block; - width: calc(100% + 1.3px); - height: 150px; + position: relative; + display: block; + width: calc(100% + 1.3px); + height: 150px; } .triangle-divider .shape-fill { - fill: var(--superdark); -} \ No newline at end of file + fill: var(--superdark); +} diff --git a/style/hackstoga_sponsor.css b/style/hackstoga_sponsor.css index c6d0702..351060f 100644 --- a/style/hackstoga_sponsor.css +++ b/style/hackstoga_sponsor.css @@ -1,160 +1,162 @@ @import url('https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@500&display=swap'); :root { - --dark: #212121; - --darker: #121212; - --superdark: #0a0a0a; - --light: #fefefe; - --superlight: #ffffff; - --red: #e83b3b; - --darkred: #ae2334; - --orange: #f8a435; - --offwhite: #c7dcd0; - --magenta: #a884f3; - --darkpurple: #2e222f; - --superdarkpurple: #251c26; - - --bronze: #9e4539; - --silver: #30e1b9; - --gold: #f79617; - --platinum: #f04f78; + --dark: #212121; + --darker: #121212; + --superdark: #0a0a0a; + --light: #fefefe; + --superlight: #ffffff; + --red: #e83b3b; + --darkred: #ae2334; + --orange: #f8a435; + --offwhite: #c7dcd0; + --magenta: #a884f3; + --darkpurple: #2e222f; + --superdarkpurple: #251c26; + + --bronze: #9e4539; + --silver: #30e1b9; + --gold: #f79617; + --platinum: #f04f78; } html { - scroll-behavior: smooth; + scroll-behavior: smooth; } body { - font-family: 'Space Grotesk', sans-serif; - color: var(--light); - background-color: var(--dark); - overflow-y: visible; - overflow-x: hidden; + font-family: 'Space Grotesk', sans-serif; + color: var(--light); + background-color: var(--dark); + overflow-y: visible; + overflow-x: hidden; } a:link { - color: var(--red); + color: var(--red); } a:visited { - color: var(--red); + color: var(--red); } a:hover { - color: var(--darkred); + color: var(--darkred); } a:active { - color: var(--darkred); + color: var(--darkred); } .light { - color: var(--dark); - background-color: var(--light); + color: var(--dark); + background-color: var(--light); } .darker { - color: var(--light); - background-color: var(--darker); + color: var(--light); + background-color: var(--darker); } .flex { - display: flex; + display: flex; } .flex-center { - justify-content: center; - align-items: center; + justify-content: center; + align-items: center; } .flex-column { - flex-direction: column; + flex-direction: column; } .rounded { - border-radius: 10px; + border-radius: 10px; } #title { - font-size: calc(1em + 5vw); - margin: 0 0 0 70px; - font-weight: bolder; - text-shadow: 2px 2px 3px var(--superdark); + font-size: calc(1em + 5vw); + margin: 0 0 0 70px; + font-weight: bolder; + text-shadow: 2px 2px 3px var(--superdark); } #main-cover { - height: 90vh; - background-size: cover; - background-image: url("../media/banners/sponsor24.png"); - background-attachment: fixed; - background-color: rgba(0, 0, 0, 0.5); - background-blend-mode: multiply; + height: 90vh; + background-size: cover; + background-image: url('../media/banners/sponsor24.png'); + background-attachment: fixed; + background-color: rgba(0, 0, 0, 0.5); + background-blend-mode: multiply; } .video { - position: relative; - aspect-ratio: 16 / 9; - width: 100%; - height: auto; - border-radius: 1em; + position: relative; + aspect-ratio: 16 / 9; + width: 100%; + height: auto; + border-radius: 1em; } .video-section { - height: 30vh; + height: 30vh; } .icon { - width: 4em; + width: 4em; } .sponsor-card { - margin: 1em; - background-color: var(--dark); - color: var(--light); - box-shadow: 0 0 12px rgba(255, 255, 255, 0.3); - transition: transform ease 300ms; + margin: 1em; + background-color: var(--dark); + color: var(--light); + box-shadow: 0 0 12px rgba(255, 255, 255, 0.3); + transition: transform ease 300ms; } .sponsor-card:not(:hover) { - transform: translate(0, 0px); + transform: translate(0, 0px); } .sponsor-card:hover { - transform: translate(0, -10px); + transform: translate(0, -10px); } .sponsor-content { - width: 80%; + width: 80%; } .sponsor-indicator { - width: 80%; - height: 2px; - margin: 0 0 1em 0; - border-radius: 100%; + width: 80%; + height: 2px; + margin: 0 0 1em 0; + border-radius: 100%; } .leadership-card { - margin: 0.5em; - padding: 1.5em; - background-color: var(--darker); - color: var(--light); - transition: transform ease 300ms; - min-height: 85%; + margin: 0.5em; + padding: 1.5em; + background-color: var(--darker); + color: var(--light); + transition: transform ease 300ms; + min-height: 85%; } .leadership-card:not(:hover) { - transform: translate(0, 0px); + transform: translate(0, 0px); } .leadership-card:hover { - transform: translate(0, -10px); + transform: translate(0, -10px); } .leadership-card > img { - min-width: 100%; + min-width: 100%; } -.leadership-card > h3, h2, p { - overflow-wrap: break-word; -} \ No newline at end of file +.leadership-card > h3, +h2, +p { + overflow-wrap: break-word; +} diff --git a/style/leaderboard/leaderboard.css b/style/leaderboard/leaderboard.css index 1b8050d..d5a1541 100644 --- a/style/leaderboard/leaderboard.css +++ b/style/leaderboard/leaderboard.css @@ -1,120 +1,118 @@ @import url('https://fonts.googleapis.com/css2?family=Montserrat&display=swap'); - /* screens */ @media screen and (min-width: 800px) { - .formatting-separator { - height: 100px; - } + .formatting-separator { + height: 100px; + } } #splash { - /* this used to be the hackStoga banner but we have enough pictures of the event that we can use those */ - /* background-image: url("/media/banners/resources.png"); */ - height: 10px; - max-height: 10px; - font-family: "Montserrat", sans-serif; + /* this used to be the hackStoga banner but we have enough pictures of the event that we can use those */ + /* background-image: url("/media/banners/resources.png"); */ + height: 10px; + max-height: 10px; + font-family: 'Montserrat', sans-serif; } #leaderboard-section { - padding-top: 100px; - color: var(--light); - font-size: 120%; + padding-top: 100px; + color: var(--light); + font-size: 120%; } #leaderboard-list { - padding-top: 15px; - padding-bottom: 15px; - color: var(--light); - font-size: 120%; + padding-top: 15px; + padding-bottom: 15px; + color: var(--light); + font-size: 120%; } .error-text { - color: var(--red); - font-size: 120%; + color: var(--red); + font-size: 120%; } #leaderboard-list table { - margin-top: 30px; - border-collapse: collapse; - border: 3px solid var(--light); - border-spacing: 0; - max-width: 1200px; - width: 100%; + margin-top: 30px; + border-collapse: collapse; + border: 3px solid var(--light); + border-spacing: 0; + max-width: 1200px; + width: 100%; } #leaderboard-list th { - padding: 3px; - border-bottom: 1px solid var(--light); - border-right: 1px solid var(--light); + padding: 3px; + border-bottom: 1px solid var(--light); + border-right: 1px solid var(--light); } #leaderboard-list td { - padding: 5px; - border-bottom: 1px solid var(--light); - border-right: 1px solid var(--light); + padding: 5px; + border-bottom: 1px solid var(--light); + border-right: 1px solid var(--light); } #leaderboard-list img { - width: auto; - height: 20px; - border-radius: 50%; - margin-right: 10px; - padding-left: 5px; + width: auto; + height: 20px; + border-radius: 50%; + margin-right: 10px; + padding-left: 5px; } .center-form { - display: flex; - flex-direction: column; - align-items: center; - justify-content: center; - text-align: center; + display: flex; + flex-direction: column; + align-items: center; + justify-content: center; + text-align: center; } - @media screen and (min-width: 800px) { - #leaderboard-list table { - width: 90%; - } + #leaderboard-list table { + width: 90%; + } } .pure-control-group { - display: flex; - justify-content: flex-end; - align-items: center; + display: flex; + justify-content: flex-end; + align-items: center; } .page-container { - position: relative; + position: relative; } .loader-overlay { - position: absolute; - top: 0; - left: 0; - width: 100%; - height: 100%; - background-color: rgba(0, 0, 0, 0.5); - /* Darkened background color */ - display: flex; - justify-content: center; - align-items: center; - z-index: 9999; - /* Ensure the loader is on top */ + position: absolute; + top: 0; + left: 0; + width: 100%; + height: 100%; + background-color: rgba(0, 0, 0, 0.5); + /* Darkened background color */ + display: flex; + justify-content: center; + align-items: center; + z-index: 9999; + /* Ensure the loader is on top */ } #signout-button { - background: rgb(202, 60, 60); - color: white; + background: rgb(202, 60, 60); + color: white; } .admin-num-input { - max-width: 6rem; - background: transparent; - color: white + max-width: 6rem; + background: transparent; + color: white; } .admin-text-input { - background: transparent; - color: white -} \ No newline at end of file + background: transparent; + color: white; +} diff --git a/style/leaderboard/login.css b/style/leaderboard/login.css index a53aaa9..43c37ca 100644 --- a/style/leaderboard/login.css +++ b/style/leaderboard/login.css @@ -2,7 +2,6 @@ --card-background: #121212; } - #login-cards { text-align: center; margin-top: 20px; @@ -21,7 +20,7 @@ flex-grow: 1; flex-shrink: 1; flex-basis: 0; - padding: 0.5rem 2rem .5rem 2rem; + padding: 0.5rem 2rem 0.5rem 2rem; background-color: var(--card-background); border-radius: 1rem; font-size: 120%; @@ -30,10 +29,10 @@ .display-name-for { padding-bottom: 1rem; - } -.card p, .card b { +.card p, +.card b { color: white; font-size: 150%; position: relative; @@ -53,7 +52,6 @@ width: 100%; } - .card > .card-content > img { width: auto; height: 400px; @@ -69,7 +67,7 @@ height: 60px; } -.card .pure-button img { +.card .pure-button img { position: relative; max-height: 80%; border-radius: 0px; @@ -113,4 +111,4 @@ display: inline-block; font-size: 100%; color: rgba(255, 255, 255, 0.6); -} \ No newline at end of file +} diff --git a/style/leaderboard/purchases.css b/style/leaderboard/purchases.css index 2c9fd08..9f6f4f0 100644 --- a/style/leaderboard/purchases.css +++ b/style/leaderboard/purchases.css @@ -1,80 +1,80 @@ #leaderboard-section { - padding-top: 100px; - color: var(--light); - font-size: 120%; + padding-top: 100px; + color: var(--light); + font-size: 120%; } #leaderboard-list { - padding-top: 15px; - padding-bottom: 15px; - color: var(--light); - font-size: 120%; + padding-top: 15px; + padding-bottom: 15px; + color: var(--light); + font-size: 120%; } .error-text { - color: var(--red); - font-size: 120%; + color: var(--red); + font-size: 120%; } table { - text-align: center; - margin-left: auto; - margin-right: auto; - margin-top: 30px; - border-collapse: collapse; - border: 3px solid var(--light); - border-spacing: 0; - max-width: 1200px; - width: 100%; + text-align: center; + margin-left: auto; + margin-right: auto; + margin-top: 30px; + border-collapse: collapse; + border: 3px solid var(--light); + border-spacing: 0; + max-width: 1200px; + width: 100%; } table th { - border-bottom: 1px solid var(--light); - border-right: 1px solid var(--light); + border-bottom: 1px solid var(--light); + border-right: 1px solid var(--light); } table td { - padding: 10px; - border-bottom: 1px solid var(--light); - border-right: 1px solid var(--light); + padding: 10px; + border-bottom: 1px solid var(--light); + border-right: 1px solid var(--light); } table .content { - display: none; + display: none; } table .content td, img { - width: 100%; - box-sizing: border-box; + width: 100%; + box-sizing: border-box; } @keyframes fadeIn { - 0% { - opacity: 0; - } + 0% { + opacity: 0; + } - 100% { - opacity: 1; - } + 100% { + opacity: 1; + } } @keyframes fadeOut { - 0% { - opacity: 1; - } + 0% { + opacity: 1; + } - 100% { - opacity: 0; - } + 100% { + opacity: 0; + } } .fadeIn { - animation: fadeIn 0.5s ease-in-out; - display: block !important; + animation: fadeIn 0.5s ease-in-out; + display: block !important; } .fadeOut { - animation: fadeOut 0.5s ease-in-out; - display: none !important; -} \ No newline at end of file + animation: fadeOut 0.5s ease-in-out; + display: none !important; +} diff --git a/style/leaderboard/store.css b/style/leaderboard/store.css index cd4d191..a45dc78 100644 --- a/style/leaderboard/store.css +++ b/style/leaderboard/store.css @@ -11,7 +11,7 @@ margin-top: 120px; margin: 0; margin-left: 330px; - padding-bottom: 30px + padding-bottom: 30px; } #shop-cards, @@ -51,11 +51,10 @@ height: 600px; } -.card>.card-content { +.card > .card-content { width: 400px; } - .side-card { margin-left: -370px; display: flex; @@ -75,7 +74,6 @@ .display-name-for { padding-bottom: 1rem; - } #title, @@ -98,8 +96,7 @@ font-size: 120%; } - -.card>.card-content>img { +.card > .card-content > img { width: auto; height: 350px; } @@ -142,7 +139,7 @@ justify-content: center; } -.button-content>p { +.button-content > p { position: relative; color: white; font-size: 120%; @@ -166,7 +163,6 @@ } } - @media screen and (max-width: 850px) { #side-cards { display: none; @@ -175,4 +171,4 @@ .main { margin-left: 0px; } -} \ No newline at end of file +} diff --git a/style/main.css b/style/main.css index ec2896b..421eaa5 100644 --- a/style/main.css +++ b/style/main.css @@ -1,231 +1,231 @@ :root { - --logo-text: #1ebc73; + --logo-text: #1ebc73; - --awards-background: #212121; - --awards-text: #fefefe; + --awards-background: #212121; + --awards-text: #fefefe; - --contacts-background: #212121; - --contacts-text: #fefefe; + --contacts-background: #212121; + --contacts-text: #fefefe; - --account-background: #121212; + --account-background: #121212; } /* screens */ @media screen and (min-width: 800px) { - .formatting-separator { - height: 100px; - } + .formatting-separator { + height: 100px; + } } #about { - background-color: var(--light); + background-color: var(--light); } .badge { - font-family: Inter; - position: relative; - bottom: 7px; - min-width: 10px; - margin-left: 5px; - padding: 3px 7px; - font-size: 16px; - font-weight: 700; - color: #fff; - text-align: center; - white-space: nowrap; - background-color: var(--badge); - border-radius: 10px; + font-family: Inter; + position: relative; + bottom: 7px; + min-width: 10px; + margin-left: 5px; + padding: 3px 7px; + font-size: 16px; + font-weight: 700; + color: #fff; + text-align: center; + white-space: nowrap; + background-color: var(--badge); + border-radius: 10px; } #contacts { - background-color: var(--contacts-background); - color: var(--contacts-text) + background-color: var(--contacts-background); + color: var(--contacts-text); } /* textbox */ .textbox { - margin: inherit !important; - padding: inherit !important; - font-size: 130%; + margin: inherit !important; + padding: inherit !important; + font-size: 130%; } -.textbox>h1, +.textbox > h1, h2, h3 { - margin: 1.5rem; - font-weight: 600; + margin: 1.5rem; + font-weight: 600; } -.textbox>* { - margin: 1.5rem; +.textbox > * { + margin: 1.5rem; } /* animated logo */ .logo-piece { - width: 20em; - position: absolute; - pointer-events: none; - image-rendering: pixelated; + width: 20em; + position: absolute; + pointer-events: none; + image-rendering: pixelated; } #base { - animation: 1s ease-out 0s 1 spinny; + animation: 1s ease-out 0s 1 spinny; } #scroll { - animation: 0.45s ease-out 0s 1 spinny-3; + animation: 0.45s ease-out 0s 1 spinny-3; } #gold { - animation: 1s ease-out 0s 1 spinny-2; + animation: 1s ease-out 0s 1 spinny-2; } #laptop { - animation: 0.5s ease-out 0s 1 spinny-3; + animation: 0.5s ease-out 0s 1 spinny-3; } #brackets { - animation: 1s ease-out 0s 1 spinny; + animation: 1s ease-out 0s 1 spinny; } #name { - color: var(--logo-text); - font-size: medium; - text-align: center; - white-space: nowrap; - overflow: hidden; - animation: type 3s steps(27, end) .51s 1 normal both; + color: var(--logo-text); + font-size: medium; + text-align: center; + white-space: nowrap; + overflow: hidden; + animation: type 3s steps(27, end) 0.51s 1 normal both; } #banner-text { - align-self: end; - font-weight: 500; - padding-bottom: 7em; - color: var(--banner-text); - font-size: large; + align-self: end; + font-weight: 500; + padding-bottom: 7em; + color: var(--banner-text); + font-size: large; } /* trailer embed */ #trailer { - position: relative; - padding-bottom: 56.25%; + position: relative; + padding-bottom: 56.25%; } -#trailer>iframe { - position: absolute; - top: 0; - left: 0; - width: 100%; - height: 100%; - border-radius: 1em; +#trailer > iframe { + position: absolute; + top: 0; + left: 0; + width: 100%; + height: 100%; + border-radius: 1em; } /* awards section */ #accolades { - background-color: var(--awards-background); - color: var(--awards-text); + background-color: var(--awards-background); + color: var(--awards-text); } -#accolades>h2 { - text-align: center; +#accolades > h2 { + text-align: center; } -#accolades>p span { - font-size: smaller; +#accolades > p span { + font-size: smaller; } /* wavy divider */ .wavy-divider { - width: 100%; - overflow: hidden; - line-height: 0; + width: 100%; + overflow: hidden; + line-height: 0; } .wavy-divider svg { - position: relative; - display: block; - width: calc(100% + 1.3px); - transform: translateY(2px); - height: 120px; + position: relative; + display: block; + width: calc(100% + 1.3px); + transform: translateY(2px); + height: 120px; } .wavy-divider .shape-fill { - fill: var(--contacts-background); + fill: var(--contacts-background); } /* leadership cards */ .officer { - background-color: var(--account-background); - width: 90%; - border-radius: 1rem; + background-color: var(--account-background); + width: 90%; + border-radius: 1rem; } -.officer>.pure-u-1-4>.pure-img { - margin-top: 10%; - margin-bottom: 10%; - border-radius: 4rem; +.officer > .pure-u-1-4 > .pure-img { + margin-top: 10%; + margin-bottom: 10%; + border-radius: 4rem; } -.officer>.pure-u-1-2 { - display: flex; - align-items: center; +.officer > .pure-u-1-2 { + display: flex; + align-items: center; } /* mobile */ @media screen and (max-width: 800px) { - #accolades { - background-color: var(--superdark); - width: 100%; - } + #accolades { + background-color: var(--superdark); + width: 100%; + } - .wavy-divider { - background-color: var(--superdark); - } + .wavy-divider { + background-color: var(--superdark); + } } @media screen and (min-width: 800px) { - #accolades { - border-radius: 1rem; - } + #accolades { + border-radius: 1rem; + } } /* animations */ @keyframes spinny { - 0% { - transform: scale(0.5, 0.5); - } + 0% { + transform: scale(0.5, 0.5); + } - 40% { - transform: scale(1, 1); - } + 40% { + transform: scale(1, 1); + } } @keyframes spinny-2 { - 0% { - transform: scale(0.2, 0.2); - } + 0% { + transform: scale(0.2, 0.2); + } - 40% { - transform: scale(1, 1); - } + 40% { + transform: scale(1, 1); + } } @keyframes spinny-3 { - 85% { - transform: scaleY(1.4); - } + 85% { + transform: scaleY(1.4); + } - 100% { - transform: scaleY(1); - } + 100% { + transform: scaleY(1); + } } @keyframes type { - 0% { - width: 0; - } - - 100% { - width: 20rem; - } -} \ No newline at end of file + 0% { + width: 0; + } + + 100% { + width: 20rem; + } +} diff --git a/style/navbar.css b/style/navbar.css index 563c683..3c24752 100644 --- a/style/navbar.css +++ b/style/navbar.css @@ -1,130 +1,130 @@ header { - position: fixed; - display: flex; - justify-content: space-between; - align-items: center; - padding-top: 30px; - padding-bottom: 30px; - padding-left: 10%; - padding-right: 10%; - width: 100vw; - background-color: var(--navbar-color); - z-index: 1; + position: fixed; + display: flex; + justify-content: space-between; + align-items: center; + padding-top: 30px; + padding-bottom: 30px; + padding-left: 10%; + padding-right: 10%; + width: 100vw; + background-color: var(--navbar-color); + z-index: 1; } /* Modified badge for navbar */ .badge-nav { - font-family: Inter; - position: relative; - bottom: 2px; - margin-left: 5px; - padding: 3px 7px; - font-size: 12px; - font-weight: 700; - color: #fff; - text-align: center; - white-space: nowrap; - background-color: var(--badge); - border-radius: 10px; + font-family: Inter; + position: relative; + bottom: 2px; + margin-left: 5px; + padding: 3px 7px; + font-size: 12px; + font-weight: 700; + color: #fff; + text-align: center; + white-space: nowrap; + background-color: var(--badge); + border-radius: 10px; } #navbar-click { - display: none; + display: none; } #navbar-links li, #navbar-links li a, .navbar-title { - font-family: "Jetbrains Mono", monospace; - font-weight: 500; - font-size: 16px; - text-decoration: none; - color: var(--navbar-text); + font-family: 'Jetbrains Mono', monospace; + font-weight: 500; + font-size: 16px; + text-decoration: none; + color: var(--navbar-text); } #navbar-links li { - display: inline-block; - padding-top: 0px; - padding-bottom: 0px; - padding-left: 20px; - padding-right: 20px; + display: inline-block; + padding-top: 0px; + padding-bottom: 0px; + padding-left: 20px; + padding-right: 20px; } #navbar-links li a { - transition: all 0.3s ease 0s; + transition: all 0.3s ease 0s; } #navbar-links li a:hover, .active { - color: var(--navbar-links); + color: var(--navbar-links); } .navbar-title { - font-size: 20px; - font-weight: 400; + font-size: 20px; + font-weight: 400; } .navbar-toggle { - color: var(--navbar-text); - display: none; - cursor: pointer; - padding-left: 10px; + color: var(--navbar-text); + display: none; + cursor: pointer; + padding-left: 10px; } @media (max-width: 1250px) { - #navbar-links { - position: fixed; - top: 80px; - left: -100%; - background-color: var(--navbar-color); - height: 100vh; - width: 100%; - display: block; - text-align: center; - transition: all 0.3s ease; - } - - .navbar-toggle { - display: inline-block; - } - - #navbar-click:not(:checked)~#navbar-links { - left: -100%; - } - - #navbar-click:checked~#navbar-links { - left: 0%; - } - - #navbar-click:checked~.navbar-toggle i:before { - content: "\f00d"; - } - - #navbar-links li { - display: block; - margin-top: 40px; - } - - #navbar-links .dropdown { - position: relative; - } - - #navbar-links .dropdown .dropdown-content { - display: none; - position: absolute; - background-color: var(--navbar-color); - box-shadow: 0px 8px 16px 0px rgba(0, 0, 0, 0.2); - z-index: 1; - } - - #navbar-links .dropdown .dropdown-content a { - color: var(--navbar-text); - padding: 12px 16px; - text-decoration: none; - display: block; - } - - #navbar-links .dropdown:hover .dropdown-content { - display: block; - } -} \ No newline at end of file + #navbar-links { + position: fixed; + top: 80px; + left: -100%; + background-color: var(--navbar-color); + height: 100vh; + width: 100%; + display: block; + text-align: center; + transition: all 0.3s ease; + } + + .navbar-toggle { + display: inline-block; + } + + #navbar-click:not(:checked) ~ #navbar-links { + left: -100%; + } + + #navbar-click:checked ~ #navbar-links { + left: 0%; + } + + #navbar-click:checked ~ .navbar-toggle i:before { + content: '\f00d'; + } + + #navbar-links li { + display: block; + margin-top: 40px; + } + + #navbar-links .dropdown { + position: relative; + } + + #navbar-links .dropdown .dropdown-content { + display: none; + position: absolute; + background-color: var(--navbar-color); + box-shadow: 0px 8px 16px 0px rgba(0, 0, 0, 0.2); + z-index: 1; + } + + #navbar-links .dropdown .dropdown-content a { + color: var(--navbar-text); + padding: 12px 16px; + text-decoration: none; + display: block; + } + + #navbar-links .dropdown:hover .dropdown-content { + display: block; + } +} diff --git a/style/resources.css b/style/resources.css index 3c4a841..ce4702b 100644 --- a/style/resources.css +++ b/style/resources.css @@ -1,41 +1,40 @@ @import url('https://fonts.googleapis.com/css2?family=Montserrat&display=swap'); - /* screens */ @media screen and (min-width: 800px) { - .formatting-separator { - height: 100px; - } + .formatting-separator { + height: 100px; + } } #splash { - /* this used to be the hackStoga banner but we have enough pictures of the event that we can use those */ - background-image: url("/media/banners/resources.png"); - font-family: "Montserrat", sans-serif; + /* this used to be the hackStoga banner but we have enough pictures of the event that we can use those */ + background-image: url('/media/banners/resources.png'); + font-family: 'Montserrat', sans-serif; } #resources { - color: var(--light); - font-size: 120%; + color: var(--light); + font-size: 120%; } /* divider */ .triangle-divider { - bottom: 0; - left: 0; - width: 100%; - overflow: hidden; - line-height: 0; - transform: rotate(180deg) translateY(148px); + bottom: 0; + left: 0; + width: 100%; + overflow: hidden; + line-height: 0; + transform: rotate(180deg) translateY(148px); } .triangle-divider svg { - position: relative; - display: block; - width: calc(100% + 1.3px); - height: 150px; + position: relative; + display: block; + width: calc(100% + 1.3px); + height: 150px; } .triangle-divider .shape-fill { - fill: var(--dark); -} \ No newline at end of file + fill: var(--dark); +} diff --git a/style/theme.css b/style/theme.css index fa4df43..cc7367f 100644 --- a/style/theme.css +++ b/style/theme.css @@ -2,276 +2,277 @@ @import url('https://fonts.googleapis.com/css2?family=JetBrains+Mono&display=swap'); :root { - --background-color: #212121; - --navbar-color: #121212; - --navbar-text: #fefefe; - --navbar-links: #0088A9; - - --anchor: #e83b3b; - --anchor-hover: #ae2334; - - --tooltip: #0a0a0a; - --tooltip-underline: #0a0a0a; - --tooltip-text: #fefefe; - --badge: #7132feff; - - --dark: #212121; - --darker: #121212; - --superdark: #0a0a0a; - --light: #fefefe; - --superlight: #ffffff; - --red: #e83b3b; - --darkred: #ae2334; - --orange: #f8a435; - --offwhite: #c7dcd0; - --magenta: #a884f3; - --darkpurple: #2e222f; - --superdarkpurple: #251c26; - - --garnet: #8b2b2b; - - --enchanted: #fc86fc; - --gold: #fede86; - --silver: #C0C0C0; - --bronze: #9F7A34; + --background-color: #212121; + --navbar-color: #121212; + --navbar-text: #fefefe; + --navbar-links: #0088a9; + + --anchor: #e83b3b; + --anchor-hover: #ae2334; + + --tooltip: #0a0a0a; + --tooltip-underline: #0a0a0a; + --tooltip-text: #fefefe; + --badge: #7132feff; + + --dark: #212121; + --darker: #121212; + --superdark: #0a0a0a; + --light: #fefefe; + --superlight: #ffffff; + --red: #e83b3b; + --darkred: #ae2334; + --orange: #f8a435; + --offwhite: #c7dcd0; + --magenta: #a884f3; + --darkpurple: #2e222f; + --superdarkpurple: #251c26; + + --garnet: #8b2b2b; + + --enchanted: #fc86fc; + --gold: #fede86; + --silver: #c0c0c0; + --bronze: #9f7a34; } * { - margin: 0; - padding: 0; - box-sizing: border-box; - scroll-behavior: smooth; + margin: 0; + padding: 0; + box-sizing: border-box; + scroll-behavior: smooth; } body { - font-family: 'Space Grotesk', sans-serif; - background-color: var(--background-color); + font-family: 'Space Grotesk', sans-serif; + background-color: var(--background-color); } code { - font-family: 'Jetbrains Mono', monospace; + font-family: 'Jetbrains Mono', monospace; } a { - color: var(--anchor); - font-weight: 600; - text-decoration: none; + color: var(--anchor); + font-weight: 600; + text-decoration: none; } a:hover { - color: var(--anchor-hover); - text-decoration: underline; + color: var(--anchor-hover); + text-decoration: underline; } .screen { - overflow: hidden; - min-height: 45em; + overflow: hidden; + min-height: 45em; } #splash { - display: flex; - justify-content: center; - align-items: center; - background-size: cover; - color: var(--light); + display: flex; + justify-content: center; + align-items: center; + background-size: cover; + color: var(--light); } -#splash>h1 { - color: var(--light); - font-size: 400%; - font-weight: 400; - text-shadow: 4px 4px 6px var(--superdark); +#splash > h1 { + color: var(--light); + font-size: 400%; + font-weight: 400; + text-shadow: 4px 4px 6px var(--superdark); } #stack { - display: flex; - flex-direction: column; - align-items: center; - justify-content: center; - text-align: center; - color: var(--light); + display: flex; + flex-direction: column; + align-items: center; + justify-content: center; + text-align: center; + color: var(--light); } -#stack>h1 { - font-size: 3em; - margin-bottom: 0.5em; - color: var(--light); +#stack > h1 { + font-size: 3em; + margin-bottom: 0.5em; + color: var(--light); } .animated-button { - border: none; - border-radius: 50px; - padding: 10px 20px; - margin-top: 20px; - max-height: 50px; - background-color: var(--anchor); - color: white; - font-weight: bold; - position: relative; - overflow: hidden; - cursor: pointer; - transition: background-color 0.2s; + border: none; + border-radius: 50px; + padding: 10px 20px; + margin-top: 20px; + max-height: 50px; + background-color: var(--anchor); + color: white; + font-weight: bold; + position: relative; + overflow: hidden; + cursor: pointer; + transition: background-color 0.2s; } .animated-button:before, .animated-button:after { - content: ""; - position: absolute; - top: -50%; - left: -50%; - width: 400%; - height: 200%; - background-image: linear-gradient(135deg, - rgba(255, 227, 104, 0) 0%, - rgba(255, 227, 104, 0) 48%, - rgba(255, 227, 104, 0.5) 50%, - rgba(255, 227, 104, 0) 52%, - rgba(255, 227, 104, 0) 100%); - animation: gold-lines 4s linear infinite; + content: ''; + position: absolute; + top: -50%; + left: -50%; + width: 400%; + height: 200%; + background-image: linear-gradient( + 135deg, + rgba(255, 227, 104, 0) 0%, + rgba(255, 227, 104, 0) 48%, + rgba(255, 227, 104, 0.5) 50%, + rgba(255, 227, 104, 0) 52%, + rgba(255, 227, 104, 0) 100% + ); + animation: gold-lines 4s linear infinite; } .animated-button:after { - animation-delay: 4s; + animation-delay: 4s; } .animated-button:hover { - background-color: var(--anchor-hover); + background-color: var(--anchor-hover); } .animated-button:hover:before, .animated-button:hover:after { - animation-duration: 2s; + animation-duration: 2s; } @keyframes gold-lines { - 0% { - transform: translateX(-100%); - } + 0% { + transform: translateX(-100%); + } - 100% { - transform: translateX(100%); - } + 100% { + transform: translateX(100%); + } } .center-text { - text-align: center; - margin-left: auto; - margin-right: auto; + text-align: center; + margin-left: auto; + margin-right: auto; } .center-form { - display: flex; - flex-direction: column; - align-items: center; + display: flex; + flex-direction: column; + align-items: center; } - /* loader from https://loading.io/css/ */ .lds-dual-ring { - display: inline-block; - width: 80px; - height: 80px; + display: inline-block; + width: 80px; + height: 80px; } .lds-dual-ring:after { - content: " "; - display: block; - width: 64px; - height: 64px; - margin: 8px; - border-radius: 50%; - border: 6px solid #fff; - border-color: #fff transparent #fff transparent; - animation: lds-dual-ring 1.2s linear infinite; + content: ' '; + display: block; + width: 64px; + height: 64px; + margin: 8px; + border-radius: 50%; + border: 6px solid #fff; + border-color: #fff transparent #fff transparent; + animation: lds-dual-ring 1.2s linear infinite; } @keyframes lds-dual-ring { - 0% { - transform: rotate(0deg); - } + 0% { + transform: rotate(0deg); + } - 100% { - transform: rotate(360deg); - } + 100% { + transform: rotate(360deg); + } } @-webkit-keyframes breathing { - 0% { - -webkit-transform: scale(0.9); - transform: scale(0.9); - } - - 25% { - -webkit-transform: scale(1); - transform: scale(1); - } - - 60% { - -webkit-transform: scale(0.9); - transform: scale(0.9); - } - - 100% { - -webkit-transform: scale(0.9); - transform: scale(0.9); - } + 0% { + -webkit-transform: scale(0.9); + transform: scale(0.9); + } + + 25% { + -webkit-transform: scale(1); + transform: scale(1); + } + + 60% { + -webkit-transform: scale(0.9); + transform: scale(0.9); + } + + 100% { + -webkit-transform: scale(0.9); + transform: scale(0.9); + } } @keyframes breathing { - 0% { - -webkit-transform: scale(0.9); - -ms-transform: scale(0.9); - transform: scale(0.9); - } - - 25% { - -webkit-transform: scale(1); - -ms-transform: scale(1); - transform: scale(1); - } - - 60% { - -webkit-transform: scale(0.9); - -ms-transform: scale(0.9); - transform: scale(0.9); - } - - 100% { - -webkit-transform: scale(0.9); - -ms-transform: scale(0.9); - transform: scale(0.9); - } + 0% { + -webkit-transform: scale(0.9); + -ms-transform: scale(0.9); + transform: scale(0.9); + } + + 25% { + -webkit-transform: scale(1); + -ms-transform: scale(1); + transform: scale(1); + } + + 60% { + -webkit-transform: scale(0.9); + -ms-transform: scale(0.9); + transform: scale(0.9); + } + + 100% { + -webkit-transform: scale(0.9); + -ms-transform: scale(0.9); + transform: scale(0.9); + } } .alert { - padding: 0 2vh 0 3vh; - background-color: var(--darkred); - color: var(--light); - display: inline-flex; - align-items: center; - justify-content: space-between; - - border-style: dashed; - border-width: 2.5px; - border-radius: 10px; - border-color: var(--superdarkred); + padding: 0 2vh 0 3vh; + background-color: var(--darkred); + color: var(--light); + display: inline-flex; + align-items: center; + justify-content: space-between; + + border-style: dashed; + border-width: 2.5px; + border-radius: 10px; + border-color: var(--superdarkred); } .alert > p { - text-shadow: 2px 2px 3px var(--dark); - margin-right: 5vh; + text-shadow: 2px 2px 3px var(--dark); + margin-right: 5vh; } .close-alert { - display: inline-flex; - align-items: center; - font-weight: bold; - font-size: 5vh; - cursor: pointer; - transition: 0.3s; - padding: 0; + display: inline-flex; + align-items: center; + font-weight: bold; + font-size: 5vh; + cursor: pointer; + transition: 0.3s; + padding: 0; } - + .close-alert:hover { - color: var(--superdarkred); -} \ No newline at end of file + color: var(--superdarkred); +} diff --git a/style/tooltips.css b/style/tooltips.css index 55418b5..018a5c6 100644 --- a/style/tooltips.css +++ b/style/tooltips.css @@ -1,81 +1,81 @@ /* slightly adapted from vivime.info*/ .tooltip { - position: relative; - display: inline-block; - border-bottom: 1px dotted var(--tooltip-underline); - cursor: pointer; + position: relative; + display: inline-block; + border-bottom: 1px dotted var(--tooltip-underline); + cursor: pointer; } -.tooltip>tooltip { - visibility: hidden; - text-align: center; - position: absolute; - z-index: 1; +.tooltip > tooltip { + visibility: hidden; + text-align: center; + position: absolute; + z-index: 1; - background-color: var(--tooltip); - color: var(--tooltip-text); - padding: 5px 0; - border-radius: 6px; - user-select: none; + background-color: var(--tooltip); + color: var(--tooltip-text); + padding: 5px 0; + border-radius: 6px; + user-select: none; - width: 15em; - margin: 0 0 0.5em -4em; - left: 50%; + width: 15em; + margin: 0 0 0.5em -4em; + left: 50%; - animation: tooltip-out 0.3s forwards, load-in 0.4s forwards; + animation: tooltip-out 0.3s forwards, load-in 0.4s forwards; } -.tooltip>tooltip:after { - content: " "; - position: absolute; - top: 100%; - left: 50%; - margin-left: -5px; - border-width: 5px; - border-style: solid; - border-color: var(--tooltip) transparent transparent transparent; +.tooltip > tooltip:after { + content: ' '; + position: absolute; + top: 100%; + left: 50%; + margin-left: -5px; + border-width: 5px; + border-style: solid; + border-color: var(--tooltip) transparent transparent transparent; } -.tooltip:active>tooltip { - animation: tooltip-in 0.5s forwards, load-in 0.4s forwards; +.tooltip:active > tooltip { + animation: tooltip-in 0.5s forwards, load-in 0.4s forwards; } @keyframes load-in { - 0% { - opacity: 0%; - } + 0% { + opacity: 0%; + } - 80% { - opacity: 0%; - } + 80% { + opacity: 0%; + } - /* 5% of buffer — just in case */ - 100% { - opacity: 100%; - } + /* 5% of buffer — just in case */ + 100% { + opacity: 100%; + } } @keyframes tooltip-in { - 0% { - bottom: 50%; - visibility: hidden; - } + 0% { + bottom: 50%; + visibility: hidden; + } - 100% { - bottom: 100%; - visibility: visible; - } + 100% { + bottom: 100%; + visibility: visible; + } } @keyframes tooltip-out { - 0% { - bottom: 100%; - visibility: visible; - } + 0% { + bottom: 100%; + visibility: visible; + } - 100% { - bottom: 80%; - visibility: hidden; - } -} \ No newline at end of file + 100% { + bottom: 80%; + visibility: hidden; + } +}
    Date ExpiresShekels
    ${ts.toLocaleString().split(",")[0]}${ts.toLocaleString().split(',')[0]} ${expiry} ${data.products[i].title} ${data.products[i].price}
    ${noPurchaseText[Math.floor(Math.random() * noPurchaseText.length)]}
    An error occured while fetching your purchases..

    An unhandled error occured while getting your purchases.

    ${ + noPurchaseText[Math.floor(Math.random() * noPurchaseText.length)] + }
    An error occured while fetching your purchases..

    An unhandled error occured while getting your purchases.