Map animation in D3.
This file contains hidden or 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
// Returned promise | |
var promise = new Parse.Promise() | |
// Error function | |
var error = function() { | |
console.error('Error:', arguments) | |
// Break it | |
response.error('Query failed, check logs') | |
} |
This file contains hidden or 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
# Size of the map | |
size = 240 | |
# Zoom level to see all Australia | |
startScale = 330 | |
# Zoom level when zoomed | |
zoomedScale = 1330 | |
# Transition duration | |
duration = 400 | |
projection = d3.geo.mercator() |
This file contains hidden or 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
var as = document.querySelectorAll('br + a') | |
for (var i = 0, len = as.length; i < len; i++) { | |
var a = _ref[i] | |
a.setAttribute('download', a.textContent) | |
a.click() | |
} |
This file contains hidden or 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
div = document.createElement('div') | |
fakeSvg = '<svg>' + markerIcon + '</svg>' | |
div.innerHTML = '' + fakeSvg | |
for el in Array::slice.call(div.childNodes[0].childNodes) | |
marker.node().appendChild(el) |
This file contains hidden or 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
generateTitle = -> | |
v = 'aeiouy' | |
c = 'bcdfghjklmnpqrstvwxz' | |
text = '' | |
for i in [0..6] | |
group = if i % 2 then v else c | |
letter = group.charAt(Math.floor(Math.random() * group.length)) | |
if i is 0 | |
letter = letter.toUpperCase() |
This file contains hidden or 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
switchHeight = 15px | |
switchPadding = 2px | |
switchWidth = 25px | |
.switch | |
position absolute | |
height switchHeight | |
width switchWidth | |
top 4px | |
right 5px | |
border-top-left-radius 25% 50% |
This file contains hidden or 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": "Tony Abbott", | |
"img": "http://parlinfo.aph.gov.au/parlInfo/download/handbook/allmps/EZ5/upload_ref_binary/EZ5.JPG", | |
"electorate": "Warringah", | |
"state": "New South Wales" | |
}, | |
{ | |
"name": "Anthony Albanese", | |
"img": "http://parlinfo.aph.gov.au/parlInfo/download/handbook/allmps/R36/upload_ref_binary/R36.jpg", |
This file contains hidden or 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
@require 'control' | |
@require 'menu' | |
@require 'mixins' | |
@require 'multi' | |
@require 'spinner' |
This file contains hidden or 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
$scroll-shadow | |
background linear-gradient(white 30%, rgba(black, 0)), | |
linear-gradient(rgba(black, 0) 10px, white 70%) bottom, | |
radial-gradient(at top, rgba(black, 0.2), transparent 70%), | |
radial-gradient(at bottom, rgba(black, 0.2), transparent 70%) bottom | |
background-repeat no-repeat | |
background-size 100% 20px, 100% 20px, 100% 10px, 100% 10px | |
background-attachment local, local, scroll, scroll |