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
videoLayer = new VideoLayer {video: "images/videos/v0.mp4", size: Screen.size} | |
videoOverlay = new Layer {size: Screen.size, backgroundColor: "rgba(0,0,0,.7)"} | |
bg = new Layer {backgroundColor: "#FFF", size: Screen.size} | |
countdown = new TextLayer {text: "closing in 3s", fontSize: 18, y: Align.bottom(-64), x: Align.center, color:"#FFF", parent: videoOverlay} | |
replay = new TextLayer {text: "Replay video", fontSize: 24, point: Align.center, color: "#FFF", parent: videoOverlay} | |
showHideLayers = [videoOverlay, countdown, replay] | |
for layer in showHideLayers | |
layer.states = | |
show: |
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
app.factory('SonService', function($http, $q) { | |
return { | |
getWeather: function() { | |
// the $http API is based on the deferred/promise APIs exposed by the $q service | |
// so it returns a promise for us by default | |
return $http.get('http://fishing-weather-api.com/sunday/afternoon') | |
.then(function(response) { | |
if (typeof response.data === 'object') { | |
return response.data; | |
} else { |
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 makePromiseWithSon = function() { | |
// This service's function returns a promise, but we'll deal with that shortly | |
SonService.getWeather() | |
// then() called when son gets back | |
.then(function(data) { | |
// promise fulfilled | |
if (data.forecast === 'good') { |
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
$(':checkbox').click(function(){ | |
var elems = $(this).parents('tbody').find(':checkbox'); | |
elems.not($(this)).attr('disabled', $(this).is(':checked')); | |
}); |
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
$(document).ready(function() { | |
$('.table-list tr').click(function(e){ | |
if(e.target.type !== 'checkbox') { | |
$(':checkbox', this).trigger('click'); | |
} | |
}); | |
var $action = $(".action-btn").hide(), |
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
$(document).ready(function() { | |
var $action = $(".action-btn").hide(), | |
$anyInput = $('.table-list input').click(function() { | |
$action.toggle( $anyInput.is(":checked") ); | |
}); | |
}); |
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
/* 4.4 deep linking | |
*/ | |
function deepEqual(a, b) { | |
if (a === b) return true; | |
if (a == null || typeof a != "object" || | |
b == null || typeof b != "object") | |
return false; |
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
$(document).ready( function(){ | |
$('.save-button').on('click', save_onclick); | |
$('.cancel-button').on('click', cancel_onclick); | |
$('.edit-button').on('click', edit_onclick); | |
$('.save-button, .cancel-button').hide(); | |
}); | |
function edit_onclick(){ |
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
# Your keymap | |
# | |
# Atom keymaps work similarly to stylesheets. Just as stylesheets use selectors | |
# to apply styles to elements, Atom keymaps use selectors to associate | |
# keystrokes with events in specific contexts. | |
# | |
# You can create a new keybinding in this file by typing "key" and then hitting | |
# tab. | |
# | |
# Here's an example taken from Atom's built-in keymap: |
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
//IMAGES | |
// SVG PNG swap out | |
$image-path: '../images' !default; | |
$fallback-extension: 'png' !default; | |
$retina-suffix: '@2x'; | |
@mixin background-image($name, $size:false, $repeat: no-repeat) { | |
background-image: url("#{$image-path}/#{$name}.svg"); | |
background-repeat: $repeat; | |
@if($size) { |