Skip to content

Instantly share code, notes, and snippets.

View antonkartashov's full-sized avatar

Anton Kartashov antonkartashov

  • Orenburg, Russia
View GitHub Profile
switch num
when 20 then "yes"
when 30 then "no"
when 40 then "maybe"
// Languages: name (local), name_en, name_fr, name_es, name_de
@name: '[name_en]';
// Fonts //
@sans: 'Arial Unicode MS Regular';
@sans_italic: 'Arial Unicode MS Regular';
@sans_bold: 'Arial Unicode MS Bold';
// Common Colors //
@land: #fff;
@water: #ccc;
@admin: #000;
# index.html: <div id="selection" hidden></div>
# style.css: #selection { border: 1px dotted #000; position: absolute; }
selection = document.getElementById('selection')
x1 = 0; y1 = 0
x2 = 0; y2 = 0
reCalc = ->
x3 = Math.min x1, x2
x4 = Math.max x1, x2
/*
index.html
<div id="div" hidden></div>
style.css
#div {
border: 1px dotted #000;
position: absolute;
}
*/
@antonkartashov
antonkartashov / 3dtouch.coffee
Created October 1, 2015 15:17 — forked from gk3/3dtouch.coffee
3D Touch for Framer
# basic setup of layers
test = new Layer width: Screen.width, height: Screen.height
circle = new Layer
circle.center()
forceValue = new Layer width: Screen.width
forceValue.html = "0"
forceValue.style =
textAlign: "center"
# https://github.com/RayPS/Framer-Module-ShakeEvent
throttleInterval = exports.throttleInterval ?= 1
handler = Utils.throttle throttleInterval, ->
exports.onShake()
# http://stackoverflow.com/questions/711536
if typeof window.DeviceMotionEvent != 'undefined'
# Position variables
# Add this line to .framer index.html:
# <script src="http://snapsvg.io/assets/js/snap.svg-min.js"></script>
background = new BackgroundLayer
diameter = Screen.width
radius = Screen.width / 2
svglayer = new Layer
width: diameter, height: diameter
y: Screen.height / 2 - radius
pos = []
touchDown = false
card.on Events.TouchStart, (e) ->
touchDown = true
pos.x = Events.touchEvent(e).clientX
pos.y = Events.touchEvent(e).clientY
card.on Events.TouchEnd, (e) ->
[1, 2, 3].forEach -> print "yo!"
marginLeft = 50
marginTop = 40
redLine = new Layer
x: 1000 + marginLeft, width: 1, height: 1500
backgroundColor: "red", opacity: .2
for i in [0..75] by 3