Skip to content

Instantly share code, notes, and snippets.

@cvan
cvan / tailwind.config.js
Last active July 5, 2024 10:46
tailwind CSS breakpoints (including iPhone 11 Pro Max)
// References used:
// - https://yesviz.com/devices.php
// - https://ricostacruz.com/til/css-media-query-breakpoints
// - https://tailwindcss.com/docs/responsive-design/#customizing-breakpoints
screens: {
'2xs': { min: '300px' },
xs: { max: '575px' }, // Mobile (iPhone 3 - iPhone XS Max).
sm: { min: '576px', max: '897px' }, // Mobile (matches max: iPhone 11 Pro Max landscape @ 896px).
md: { min: '898px', max: '1199px' }, // Tablet (matches max: iPad Pro @ 1112px).
lg: { min: '1200px' }, // Desktop smallest.
import { Data, animate, Override, Animatable } from "framer";
const data = Data({ scaleValues: [] });
export const Scale: Override = props => {
data.scaleValues.push({ id: props.id, scaleValue: Animatable(1) });
return {
scale: getValueForId(props.id),
onTap() {
let valueToScale = getValueForId(props.id);
@whoisryosuke
whoisryosuke / useMousePosition.md
Created November 5, 2018 19:22
React Hooks - Track user mouse position - via: https://twitter.com/JoshWComeau

Hook

import { useState, useEffect } from "react";

const useMousePosition = () => {
  const [mousePosition, setMousePosition] = useState({ x: null, y: null });

  const updateMousePosition = ev => {
 setMousePosition({ x: ev.clientX, y: ev.clientY });
@gomar
gomar / 00-intro.md
Last active January 30, 2024 04:58
Setting up a Keynote document for grid layout design

Setting up a Keynote document for grid layout design

I like (love ?) Keynote because it

  • is a simple to use presentation software,
  • is vector based (when zooming it just looks gorgeous)
  • exports to powerpoint

If I could remove that last argument, I would, but the fact is that, as a consultant, the final document is almost always expected to be a powerpoint document. Don't ask me why, it is just so. I am fighting against it but I did not win the battle so far ...

@mmazzarolo
mmazzarolo / hideOnScroll.js
Last active July 4, 2024 12:57
react-native-action-button hide on scroll
// 1. Define a state variable for showing/hiding the action-button
state = {
isActionButtonVisible: true
}
// 2. Define a variable that will keep track of the current scroll position
_listViewOffset = 0
// 3. Add an onScroll listener to your listview/scrollview
<ListView
@monicao
monicao / react.md
Last active February 23, 2021 19:07
React Lifecycle Cheatsheet

React Component Lifecycle

  • getInitialState
  • getDefaultProps
  • componentWillMount
  • componentDidMount
  • shouldComponentUpdate (Update only)
  • componentWillUpdate (Update only)
  • componentWillReceiveProps (Update only)
  • render
@RayPS
RayPS / Framer-CSS-Spiner.coffee
Last active September 26, 2016 17:07
Framer CSS Spiner
spiner = new Layer
borderRadius: "50%"
backgroundColor: false
spiner.style["border"] = "5px solid"
spiner.style["border-color"] = "white white transparent transparent"
spiner.center()
spiner.animate
@inversion
inversion / gist:60a96ea3294e4ce35615
Last active November 30, 2015 21:18
TfL Hex Line Colours JSON
{
"Bakerloo": "#B36305",
"Central": "#E32017",
"Circle": "#FFD300",
"District": "#00782A",
"DLR": "#00A4A7",
"Hammersmith and City": "#F3A9BB",
"Jubilee": "#A0A5A9",
"Metropolitan": "#9B0056",
"Northern": "#000000",
@woeldiche
woeldiche / framerproject.coffee
Created June 3, 2015 11:41
Modular Framer project
# Import layers
Imports = Framer.Importer.load "imported/Nordea Markets Master"
# Import settings and model
config = require("nmSettings").config;
model = require("nmModel").model;
# Import page changing behavior
slideIn = require("nmSlidein");
# Import instances of pages
TradeInstance = require("nmTrade");
@stakes
stakes / frameless.coffee
Last active April 14, 2017 21:08
Framer.js module to open prototypes in Frameless
# Add the following line to your project in Framer Studio.
# `frameless = require "frameless"`
frameless = {}
# Directly opens the prototype in Frameless
frameless.open = ->
intent = "frameless://"
url = intent + window.location.host + window.location.pathname + "/"
window.location.replace url