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 });
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
// 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. |
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
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); |
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 ...
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
// 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 |
React Component Lifecycle
- getInitialState
- getDefaultProps
- componentWillMount
- componentDidMount
- shouldComponentUpdate (Update only)
- componentWillUpdate (Update only)
- componentWillReceiveProps (Update only)
- render
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
spiner = new Layer | |
borderRadius: "50%" | |
backgroundColor: false | |
spiner.style["border"] = "5px solid" | |
spiner.style["border-color"] = "white white transparent transparent" | |
spiner.center() | |
spiner.animate |
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
{ | |
"Bakerloo": "#B36305", | |
"Central": "#E32017", | |
"Circle": "#FFD300", | |
"District": "#00782A", | |
"DLR": "#00A4A7", | |
"Hammersmith and City": "#F3A9BB", | |
"Jubilee": "#A0A5A9", | |
"Metropolitan": "#9B0056", | |
"Northern": "#000000", |
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
# 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"); |
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
# 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 |
NewerOlder