Skip to content

Instantly share code, notes, and snippets.

resize: function(){
this.$maskInner.css({
'position': 'absolute',
'left': -(this.getSkewDifference() * 0.5)
});
},
getRadians: function(deg) {
return deg * (Math.PI / 180);
},
/**
* Setup your Lazy Line element.
* see README file for more settings
*/
var $logo = $('#logo');
$logo.lazylinepainter({
'svgData': svgData,
'strokeWidth': 7,
@camoconnell
camoconnell / gist:f50e44c75270340ac8b7
Last active August 29, 2015 14:21
gun_fight_scene_view
define([
'jquery',
'underscore',
'backbone',
'config',
'pixi',
'shims/shim_resn_utils',
'game/games/gun_fight/view/gun_fight_gunman_view',
'game/games/gun_fight/view/gun_fight_obstacles_view'
], function(
@camoconnell
camoconnell / target_data
Created May 12, 2015 00:46
Target Data
define([], function() {
'use strict';
return {
// tg dimensions, depending on game state
obstacles: {
wRatio: 0.9,
hRatio: 0.33,
@camoconnell
camoconnell / gist:648fd088a0f67e1bf561
Last active August 29, 2015 14:21
darting target
define([
'jquery',
'underscore',
'backbone',
'config',
'shims/shim_resn_utils',
'TweenMaxEasing',
'game/games/gun_fight/model/gun_fight_target_data'
], function(
$,
@camoconnell
camoconnell / loadSvg
Created February 17, 2015 22:55
load svg
var self = this;
$.get(Config.CDN+'/svg/sprites.svg', function(response){
var importedSVGRootElement = document.importNode(response.documentElement,true);
$(".svg-defs").append(importedSVGRootElement);
}, "xml");
define([], function() {
/**
* Used to dynamically create svg
*/
'use strict';
return {
createSVG: function(settings) {
@camoconnell
camoconnell / app_controller.js
Last active August 29, 2015 14:02
Loading svg spritesheet
// app_controller.js
// Load / appending needs to happen on initial load of proj for references to svg defs to work
loadSvgs: function () {
$.get(Config.CDN + '/svg/sprites.svg', this.onSvgLoad, "xml");
},
// append to
onSvgLoad: function (response) {
var importedSVGRootElement = document.importNode(response.documentElement, true);
@camoconnell
camoconnell / gist:9934569
Created April 2, 2014 13:52
Preload CSS with Preloadjs
preloader:null,
cssUrl:'/css/drawingToolFonts.css',
loadDrawingCss:function(){
this.preloader = new PreloadJS(false);
this.preloader.addEventListener("complete", this.onDrawingCssLoaded );
var item = { id: this.cssUrl, src:this.cssUrl , type:PreloadJS.CSS };
this.preloader.loadFile(item, false, Config.CDN);
this.preloader.load();
},
@camoconnell
camoconnell / page.js
Created July 12, 2013 20:29
Adding methods to a view instance.,
initialize: function(){
_.bindAll(this);
this.slug = this.model.get('slug');
this.view = {};
if(this.slug === 'home')
this.view = new Home({el : $('#home')});