Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Create archive of previous BH sites (7, 8, club) #1296

Open
wants to merge 5 commits into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
81 changes: 41 additions & 40 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -13,64 +13,65 @@
<meta property="twitter:title" content="BrickHack 8">
<meta property="twitter:url" content="https://brickhack.io" >
<meta property="twitter:description" content="RIT's premier collegiate hackathon devoted to bringing designers, developers, and all sorts of makers together for 24 hours to create something from nothing.">
<meta name="twitter:image" content="./assets/social_cards.png">
<meta name="twitter:image" content="/assets/social_cards.png">

<!-- Open Graph Cards -->
<meta property="og:type" content="website" />
<meta property="og:title" content="Brickhack 8" />
<meta property="og:site_name" content="BrickHack 8" />
<meta property="og:url" content="https://brickhack.io" />
<meta property="og:description" content="RIT's premier collegiate hackathon devoted to bringing designers, developers, and all sorts of makers together for 24 hours to create something from nothing."/>
<meta property="og:image" content="./assets/social_cards.png" />
<meta property="og:image" content="/assets/social_cards.png" />

<!-- Favicons -->
<link rel="apple-touch-icon" sizes="180x180" href="resources/favicon/apple-touch-icon.png">
<link rel="icon" type="image/png" sizes="32x32" href="resources/favicon/favicon-32x32.png">
<link rel="icon" type="image/png" sizes="16x16" href="resources/favicon/favicon-16x16.png">
<link rel="apple-touch-icon" sizes="180x180" href="/resources/favicon/apple-touch-icon.png">
<link rel="icon" type="image/png" sizes="32x32" href="/resources/favicon/favicon-32x32.png">
<link rel="icon" type="image/png" sizes="16x16" href="/resources/favicon/favicon-16x16.png">

<!-- Fonts -->
<link rel="preconnect" href="https://fonts.gstatic.com">
<link href="https://fonts.googleapis.com/css2?family=Work+Sans:wght@400;600;700&display=swap" rel="stylesheet">
<link href="https://fonts.googleapis.com/css2?family=Sora&display=swap" rel="stylesheet">
</head>
<body>
<!-- Nav -->
<nav>
<div class="top">
<a id="logo" href="https://brickhack.io">
<img src="assets/bh8/logo.svg" alt="BrickHack 8 Logo" />
</a>
</div>
</nav>
<div class="mobile-grayout"></div>
<div id="content">

<!-- MLH Banner -->
<a id="mlh-trust-badge" href="https://mlh.io/seasons/2022/events?utm_source=na-hackathon&utm_medium=TrustBadge&utm_campaign=2022-season&utm_content=gray" target="_blank">
<img src="https://s3.amazonaws.com/logged-assets/trust-badge/2022/mlh-trust-badge-2022-gray.svg" alt="Major League Hacking 2022 Hackathon Season" style="width:100%">
</a>
<section id="sites">
<div>
<p>An archive of older BrickHack sites. View the latest at <a href="https://brickhack.io">brickhack.io</a>!</p>
</div>
<div class="site">
<img src="/assets/bh8/logo.svg"/>
<a href="./sites/bh8/bh8.html">
<h1>BrickHack 8</h1>
</a>
</div>
<div class="site">
<img src="/assets/logo.svg"/>
<a href="./sites/bh7/bh7.html">
<h1>BrickHack 7</h1>
</a>
</div>
<div class="site">
<img src="/assets/club/events.svg" />
<a href="./sites/club/club.html">
<h1>Club Site</h1>
</a>
</div>
</section>

<!-- Post-Event -->
<section id="post">
<h1>Thanks for a great BrickHack 8!</h1>
<p>See you next year!</p>
<a id="devpost" href="https://brickhack8.devpost.com/" target="_blank">VIEW PROJECTS</a>
<p><a href="./club.html">Check out our club</a></p>
<video id="prizes-ricky" autoplay muted loop playsinline>
<source src="./assets/bh8/videos/Prize-Ricky.mp4" type="video/mp4">
</video>
</section>

<!-- Footer -->
<footer>
<div id="footer-left">
<p><a href="mailto:[email protected]">[email protected]</a></p>
</div>
<div id="footer-right">
<p><a href="https://static.mlh.io/docs/mlh-code-of-conduct.pdf" target="_blank">MLH Code of Conduct</a></p>
<p><a href="https://www.rit.edu/academicaffairs/policiesmanual/c070" target="_blank">Privacy Policy</a></p>
<p>Copyright &copy; 2022 BrickHack Club</p>
</div>
</footer>
<!-- Footer -->
<footer>
<div id="footer-left">
<p><a href="mailto:[email protected]">[email protected]</a></p>
</div>
<div id="footer-right">
<p><a href="https://static.mlh.io/docs/mlh-code-of-conduct.pdf" target="_blank">MLH Code of Conduct</a></p>
<p><a href="https://www.rit.edu/academicaffairs/policiesmanual/c070" target="_blank">Privacy Policy</a></p>
<p>Copyright &copy; 2022 BrickHack Club</p>
</div>
</footer>
</div>

<!-- This is where Parcel imports are located! (SASS, etc.) -->
<script src="./index.js"></script>
Expand Down
226 changes: 0 additions & 226 deletions index.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import "./sass/index.scss"
import "@fortawesome/fontawesome-free/css/all.css"
import $ from "jquery"

// Hiring message
const hiringMessage = `Hey, you.
Expand All @@ -14,228 +13,3 @@ console.log(hiringMessage);
// 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 + "\n");
document.insertBefore(comment, document.firstChild);

// Leadership easter egg
/*$(document).ready(function() {
var randomNum = Math.floor(Math.random() * 50);
console.log(randomNum);
if (randomNum === 7) {
console.log("Lucky Ricky");
var ricky = $(".leader:first").clone();
ricky.appendTo($("#team"));
}
});*/

// Nav highlighting on scroll
import ActiveMenuLink from "active-menu-link";

let options = {
itemTag: "",
scrollOffset: -90, // nav height
scrollDuration: 1000,
ease: "out-quart",
showHash: false,
};

new ActiveMenuLink(".navbar-items", options);

// Navbar functionality
$(document).on("click", "#toggle", function() {
if ($("nav").hasClass("show-nav")) {
$("nav").removeClass("show-nav");
$("#toggle").removeClass("fa-times");
$("#toggle").addClass("fa-bars");
$(".mobile-grayout").removeClass("show-gray");
} else {
$("nav").addClass("show-nav");
$("#toggle").removeClass("fa-bars");
$("#toggle").addClass("fa-times");
$(".mobile-grayout").addClass("show-gray");
}
});

// Closing the navbar when a navigation link is clicked
$(document).on("click", ".link", function() {
$("nav").removeClass("show-nav");
$("#toggle").removeClass("fa-times");
$("#toggle").addClass("fa-bars");
$(".mobile-grayout").removeClass("show-gray");
});

// Closing the navbar when outside of the nav is clicked
$(document).on("click", ".mobile-grayout", function() {
$("nav").removeClass("show-nav");
$("#toggle").removeClass("fa-times");
$("#toggle").addClass("fa-bars");
$(".mobile-grayout").removeClass("show-gray");
});

// 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];
// Click should only work on accordion-header of each card
accordion.addEventListener("click", function() {

card[i].classList.toggle("active");

let panel = card[i].getElementsByClassName("panel")[0];
let fa = this.getElementsByTagName("i")[0];

// Toggle panel and plus/minus on click of header
if ($(card[i]).hasClass("active")) {
$(panel).slideDown(200);
} else {
$(panel).slideUp(200);
}

$(fa).toggleClass("fa-plus");
$(fa).toggleClass("fa-minus");
});
}

/* Schedule JS */

// Making buttons toggle hide/show for different days
// Saturday button
$('#saturday').click(function() {
$('#saturday').addClass('day-active');
$('#sunday').removeClass('day-active');
$('#mar-5-content').show();
$('#mar-6-content').hide();
$('#date-indicator-saturday').show();
$('#date-indicator-sunday').hide();
});
// Sunday button
$('#sunday').click(function() {
$('#sunday').addClass('day-active');
$('#saturday').removeClass('day-active');
$('#mar-6-content').show();
$('#mar-5-content').hide();
$('#date-indicator-sunday').show();
$('#date-indicator-saturday').hide();
});


// Setting the schedule to match the day
let currentDate = new Date().getDate()
// Before/during saturday
if (currentDate <= 5) {
$('#saturday').addClass('day-active');
$('#sunday').removeClass('day-active');
$('#mar-5-content').show();
$('#mar-6-content').hide();
$('#date-indicator-saturday').show();
$('#date-indicator-sunday').hide();
}
// Sunday
else {
$('#sunday').addClass('day-active');
$('#saturday').removeClass('day-active');
$('#mar-6-content').show();
$('#mar-5-content').hide();
$('#date-indicator-sunday').show();
$('#date-indicator-saturday').hide();
}


// Fetching event data from HackEngine
fetch('https://apply.brickhack.io/events.json')
.then(res => res.json())
.then(events => handleEventData(events))
.catch(err => console.log(err));


// Turning HackEngine event data into visual events - BH7 code barely modified
function handleEventData(events) {
let now = new Date()
// needed to handle overlapping events
let timeMarkerAdded = false;
// need to sort events by start/end times instead of IDs
events.sort(compareEvents);

// Looping through each event to handle it
events.forEach(event => {
// Getting strings for times
let startDate = new Date(event.start); // convert ISO 8601 -> Date object
let finishDate = undefined;
let dateString = convertDate(startDate);
if (event.finish) { // finish === null for instantaneous events
finishDate = new Date(event.finish);
let finishString = convertDate(finishDate);
if (dateString.slice(-2) === finishString.slice(-2)) { // hide "am/pm" of first time if both are identical
dateString = dateString.slice(0, -2);
}
dateString += " - " + convertDate(finishDate);
}

// calculate event container classes
let divClasses = 'event';
let liveIndicator = "";
if (finishDate < now) {
divClasses += ' event-complete';
}
else if (startDate < now && now < finishDate) {
divClasses += ' event-live';
liveIndicator = '<p class="live">LIVE!</p>';
}

// adding event to the page
var eventContainer;
// Deciding which day content box it goes inside
switch (startDate.getDate()) {
case 5: eventContainer = $('#mar-5-content'); break;
case 6: eventContainer = $('#mar-6-content'); break;
}
// If it doesn't fall into one of those event days, log the problem and quit trying to add it
if (!eventContainer) {
console.log("Event " + event.title + " date " + startDate + " out of range.");
return; // skip current iteration https://stackoverflow.com/a/31399448/1431900
}
// Building HTML and adding it to page
let html = `<div class="${divClasses}"><p class="time">${dateString}</p><p>${event.title}</p>${liveIndicator}</div>`;
const eventDiv = eventContainer.append(html);
});
}

// Comparing two events to sort them - BH7 code unmodified
function compareEvents(a, b) {
// We can sort by start/end here because the ISO 8061
// timestamps given by the server are lexicographically
// sortable.
if (a.start < b.start) { // if a starts before b...
return -1; // ...then a goes before b
} else if (a.start > b.start) { // if a starts after b...
return 1; // ...then b goes before a
} else {
if (a.end < b.end) { // if a ends before b...
return -1; // ...then a goes before b
} else if (a.end > b.end) { // if a ends after b...
return 1; // ...then b goes before a
} else {
return 0;
}
}
}

// Converting dates to something more user friendly - BH7 code unmodified
function convertDate(date) {
let output = '';
// hour
if (date.getHours() > 12) {
output = String(date.getHours() - 12);
} else {
output = String(date.getHours());
}
// minute
if (date.getMinutes() !== 0) {
output += ':' + String(date.getMinutes()).padStart(2, '0');
}
// AM/PM
if (date.getHours() >= 12) {
output += 'pm';
} else {
output += 'am';
}
return output;
}
Loading