This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Activate pagination when more than 6 events display per day | |
function pagination() { | |
var schedulerEvent = $('#events .event'); | |
var prevButton = $('#events .prev'); | |
var nextButton = $('#events .next'); | |
var currentPage = "page_1"; // begin as statically defined, will always start on page_1 | |
// If user is on page 1, add inactive class to Prev link | |
function disablePrev() { | |
if (currentPage === "page_1") { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Basic variables | |
$header-font: 'Playfair Display', serif; | |
$body-font: 'Roboto', Arial, sans-serif; | |
$color1: #A8EBFF; | |
$color2: #FFE2E5; | |
$color3: #BAEDC6; | |
$navy: #334D70; | |
$link-color: #269196; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$(function() { | |
changeBg(); | |
}); | |
function changeBg() { | |
window.addEventListener('scroll', function(e){ | |
var distanceY = window.pageYOffset || document.documentElement.scrollTop; | |
var color2 = 250; | |
var color3 = 750; | |
var body = $("body"); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ageVerify: function() { | |
function setCookie(cname, cvalue, exdays) { | |
var d = new Date(); | |
d.setTime(d.getTime() + (exdays*24*60*60*1000)); | |
var expires = "expires="+d.toUTCString(); | |
document.cookie = cname + "=" + cvalue + "; " + expires; | |
} | |
function getCookie(cname) { | |
var name = cname + "="; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Objective: access endpoint on server, created by Express | |
$(function() { | |
// On click of button, execute following function | |
$('button').on('click', function() { | |
// Use jQuery $.get AJAX request to pull JSON feed | |
$.get('/dinosaurs', function(data) { | |
// Write random dinosaur into page within a <span> tag | |
$('span').html(data.dinosaur); | |
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Objective: create an endpoint using app.get that sends a JSON object | |
// Set /dinosaurs as endpoint | |
app.get("/dinosaurs", function (req, res){ | |
// Assign dinosaur as JSON object, pull a random dinosaur out of array of dinos | |
res.json({dinosaur: array[randomNumber]}); | |
}); | |
// Array of dinosaurs | |
var array = [ "Stegosaurus", "Tyrranosaurus", "Velociraptor", "Triceratops"]; |