Skip to content

Instantly share code, notes, and snippets.

View mamezito-zz's full-sized avatar

Sergiy Voronov mamezito-zz

View GitHub Profile
send = ->
xhr = new XMLHttpRequest
url = baseUrl
xhr.open 'POST', url, true
xhr.setRequestHeader 'Content-type', 'application/json'
xhr.setRequestHeader 'Authorization', 'Bearer ' + accessToken
xhr.onreadystatechange = ->
if xhr.readyState == 4 and xhr.status == 200
print JSON.parse(xhr.responseText)
if pageComponent.x<350
layerA.x = Utils.modulate(pageComponent.x,[0,350],[0,100],true)
else if pageComponent.x>350
layerA.x = Utils.modulate(pageComponent.x,[350,1050],[100,1000],true)
@mamezito-zz
mamezito-zz / gist:909f71e7e8fae869b91dc18256b19081
Created April 25, 2018 10:35
Adding Mapbox object to Framer
{MapboxJS, CustomMarker, Marker, animateOnRoute} = require 'MapboxJS'
myMap = new mapboxJS
accessToken: 'insertHereYourAccessToken'
@mamezito-zz
mamezito-zz / gist:bc9cb81c170ecd2aef9f3a1faebdbab7
Last active April 25, 2018 10:41
Creating Mapbox Marker in Framer
point2=["-0.089039","51.526553"]
simpleMarker=new Marker
size:20
point:point2
borderRadius:50
backgroundColor:"#ffcc00"
@mamezito-zz
mamezito-zz / gist:190c7c572080ef69b8577d8203a6dedc
Created April 25, 2018 10:42
Custom Framer Mapbox Marker
point2=["-0.089039","51.526553"]
startPoint=new Layer
size:20
borderRadius:20
customMarker=new CustomMarker
target:startPoint
point:point2
@mamezito-zz
mamezito-zz / gist:d4e3870a627dfe2a3da8d486ec6e12ce
Created April 25, 2018 10:45
Building Mapbox Route in Framer
myMap.buildRoute(point1, point2, 9, "#ffcc00")
#where myMap - is your map object name. Point1, Point2 are your start and end points of route, last two attributes are strokeWidth and strokeColor
# use animateOnRoute function, pass marker object there, end point, and distance step - in this case 0.01, tweek this number to make animation smooth depending on size of the route between points
animateOnRoute(customMarker, point1, 0.01)
#initial setup
#modules
{MapboxJS, CustomMarker, Marker, animateOnRoute} = require "mapbox-js/MapboxJS"
mapboxToken='your api key'
# use build3D method on mapobject load, mind that bearing, hash and pitch should be set at mapbox initialization
myMap = new MapboxJS
accessToken: mapboxToken
style: styles.light
zoom: 12
center: originPoint
pitch: 45,
bearing: -17.6,
hash: true
myMap.mapbox.on 'load', ->
import * as React from "react";
import { PropertyControls, ControlType } from "framer";
import { Button } from "@bulb/design";
interface Props {
text: string;
width: number;
height: number;
fullWidth: boolean;
}