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
{ | |
"name" : "appname", | |
"version" : "0.0.1", | |
"description" : "Description goes here.", | |
"main" : "app.js", | |
"author" : "Nick Sheffield", | |
"dependencies" : { | |
"express" : "~4.7.2", | |
"mongoose" : "~3.6.2", | |
"morgan" : "~1.2.2" |
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
http://sachagreif.com/flat-pixels/ | |
http://speckyboy.com/2013/11/21/flat-design-vs-minimalism/ | |
http://sixrevisions.com/user-interface/when-flat-design-falls-flat/ |
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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
$(window).scroll(function(){ | |
var scrollY = window.scrollY // how far you are scrolled down | |
$('section').each(function(){ | |
var e = $(this), // element | |
height = e.height() // height of element | |
eTop = e.offset().top // element top offset, | |
h1 = e.find('h1') // title element | |
// if the screen is scrolled down past the top of the section |
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
CanvasRenderingContext2D.prototype.circle = function (x, y, r) { | |
this.beginPath(); | |
this.arc(x, y, r, 0, 2 * Math.PI, false); | |
this.closePath(); | |
} |
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
.flex{ | |
display: flex; | |
flex: 1; | |
justify-content: space-between; | |
} | |
.flex-row { flex-flow: row nowrap; } | |
.flex-column { flex-flow: column nowrap; } |
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 romanToInt(s){ | |
var n=0,i=0,d={'I':1,'V':5,'X':10,'L':50,'C':100,'D':500,'M':1000}; | |
for(;i<s.length;i++)n+=d[s[i+1]]>d[s[i]]?d[s[i]]*-1:d[s[i]]; | |
return n; | |
} |
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
[layout], [data-layout] { display: flex; } | |
[layout~="row"], [data-layout~="row"] { flex-direction: row; } | |
[layout~="col"], [data-layout~="col"] { flex-direction: column; } | |
[layout~="full-col"], [data-layout~="full-col"] { flex-direction: column; min-height: 100vh; } | |
[justify~="start"], [data-justify~="start"] { justify-content: flex-start; } | |
[justify~="end"], [data-justify~="end"] { justify-content: flex-start; } | |
[justify~="center"], [data-justify~="center"] { justify-content: center; } | |
[justify~="between"], [data-justify~="between"] { justify-content: space-between; } | |
[justify~="around"], [data-justify~="around"] { justify-content: space-around; } | |
[align~="start"], [data-align~="start"] { align-items: flex-start; } |
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
# Modified from https://css-tricks.com/snippets/jquery/smooth-scrolling/ | |
$('a[href*=#]:not([href=#])').click(function() { | |
if (location.pathname.replace(/^\//,'') == this.pathname.replace(/^\//,'') && location.hostname == this.hostname) { | |
var target = $(this.hash); | |
target = target.length ? target : $('[name=' + this.hash.slice(1) +']'); | |
if (target.length) { | |
$('html,body').animate({ scrollTop: target.offset().top }, 500, function(){ | |
location.hash = target.selector; |
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
<!DOCTYPE html> | |
<html lang="en"> | |
<head> | |
<meta charset="UTF-8"> | |
<title>DOM Traversal</title> | |
<style> | |
.box1, .box2, .box3, .box4, .box5{ | |
border: 1px solid black; | |
padding: 1em; |
OlderNewer