From ea891551dfdac4589dc604d027969ccd9ee4d369 Mon Sep 17 00:00:00 2001 From: Peter Kos Date: Fri, 18 Dec 2020 00:08:51 -0500 Subject: [PATCH 1/3] Refactor spacing/code org in index.js --- index.js | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/index.js b/index.js index 50e72339b..6d41311ce 100644 --- a/index.js +++ b/index.js @@ -1,11 +1,8 @@ import './sass/main.scss' import '@fortawesome/fontawesome-free/css/all.css' -// slick-carousel configuration -import $ from 'jquery' -import 'slick-carousel' - +// Hiring message const hiringMessage = `Hey, you. You’re finally awake. You were trying to see the code, right? @@ -14,11 +11,15 @@ If you’d like to work on this website and other cool projects with hackathons, console.log(hiringMessage); -// comment generated via js instead of directly in HTML so the hiring message text is only in one place +// Comment generated via js instead of directly in HTML so the hiring message text is only in one place const comment = document.createComment("\n"+hiringMessage.toString()+"\n"); document.insertBefore(comment, document.firstChild); +// Slick-carousel +import $ from 'jquery' +import 'slick-carousel' + $(document).ready(function() { $('.carousel').slick({ infinite: true, @@ -67,6 +68,7 @@ $(document).on('keydown', function(event) { }); +// FAQ Cards hide/show let card = document.getElementsByClassName("card"); for (let i = 0; i < card.length; i++) { let accordion = card[i].getElementsByClassName("accordion-header")[0]; @@ -90,6 +92,7 @@ for (let i = 0; i < card.length; i++) { }); } + // Schedule toggle code $('.day-second-events').hide(); $('.day-first').click(function() { From 2825ec2d00059b21bbe6cf5c64693bb3c1544935 Mon Sep 17 00:00:00 2001 From: Peter Kos Date: Fri, 18 Dec 2020 01:07:34 -0500 Subject: [PATCH 2/3] Random SVG func --- index.js | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/index.js b/index.js index 6d41311ce..603de0253 100644 --- a/index.js +++ b/index.js @@ -16,6 +16,23 @@ const comment = document.createComment("\n"+hiringMessage.toString()+"\n"); document.insertBefore(comment, document.firstChild); +// Random hero SVG on each page load +import desk1 from './assets/desk1.svg' +import desk2 from './assets/desk2.svg' +import desk3 from './assets/desk3.svg' + +$(document).ready(function() { + var deskIndex = parseInt(localStorage.getItem('deskIndex')); + if (!deskIndex) { + deskIndex = 0; + localStorage.setItem('deskIndex', 0); + } + var desks = [desk1, desk2, desk3] + $('#desk').css('background-image', 'url(' + desks[deskIndex % desks.length] + ')'); + localStorage.setItem('deskIndex', deskIndex + 1); +}); + + // Slick-carousel import $ from 'jquery' import 'slick-carousel' From fba4a0c882fe9d5d601d24efefbda31fd50e84c6 Mon Sep 17 00:00:00 2001 From: Peter Kos Date: Fri, 18 Dec 2020 01:26:48 -0500 Subject: [PATCH 3/3] Remove desk SVG change from fading on transition Utterly broken on Safari, firefox has no transition when you do things, and chrome is nice but its ok --- sass/main.scss | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sass/main.scss b/sass/main.scss index 6a053eed8..1b54294b8 100644 --- a/sass/main.scss +++ b/sass/main.scss @@ -78,7 +78,7 @@ $event-count: 6; // Transition all elements on the screen // (except FAQ panel, which already has a transition, // and the section days, which need no transition.) - &:not(.panel):not(#days):not(.number) { + &:not(.panel):not(#days):not(.number):not(#desk) { transition: all 1s ease; }