Skip to content

Instantly share code, notes, and snippets.

View davo's full-sized avatar
🏠

Davo Galavotti davo

🏠
View GitHub Profile
@davo
davo / beach-house-tour.md
Created June 12, 2019 15:00
Beach House
  • JUNE 14
    MANCHESTER, TN
  • AUG 1
    BURLINGTON, VT
  • AUG 3
    MONTREAL, CA
  • AUG 4
    NORTHAMPTON, MA
  • AUG 6
    CLEVELAND, OH
import * as React from "react"
import { Frame, addPropertyControls, ControlType } from "framer"
type Props = {
width: number | string
height: number | string
color: string
}
export const SvgComponent = (props: Props) => {
@davo
davo / Readme.md
Last active June 8, 2019 01:27 — forked from wiederkehr/Readme.md
Multiples Streamgraph

Example of a streamgraph that can be divided into multiple area charts.

@davo
davo / observable.tsx
Created May 20, 2019 21:44
Observable book on Framer X
import * as React from 'react'
import { useState, useEffect, useRef } from 'react'
import { Frame, addPropertyControls, ControlType } from 'framer'
import { Runtime, Inspector } from '@observablehq/runtime'
import notebook from '@davo/bar-chart-race'
export function Observable({ tick }) {
const [tickDuration, setTickDuration] = useState(tick)
const animationRef = useRef()
@davo
davo / WindowResizeListener.tsx
Created May 17, 2019 22:32
Framer X WindowResizeListener
// https://framer.slack.com/archives/CB74N2FDY/p1557954143213500?thread_ts=1557952502.211200&cid=CB74N2FDY
import { Override, Data } from "framer"
import * as React from "react"
const initialSize = document.body.getBoundingClientRect()
const preview = Data({ width: initialSize.width, height: initialSize.height })
@davo
davo / regexs.md
Created May 14, 2019 15:18
Handy Regular Expressions

Capturing a class from a HTML / SVG element.

(class="([^"]*)")
@davo
davo / ComponentHoverStyledComponents.tsx
Created May 6, 2019 15:33
Component with Hover via StyledComponents
import * as React from 'react'
import { useState, useEffect } from 'react'
import { Frame, addPropertyControls, ControlType } from 'framer'
import styled, { css } from 'styled-components'
interface Props {
padding?: number
paddingLeft?: number
color?: string
listBackgroundColor?: string
@davo
davo / scrap.js
Created January 15, 2019 12:34
Scrapping from the DevTools
copy(
Array.from(document.querySelectorAll('p')).map(p => {
const t = p.innerText
return {
t
}
})
)
@davo
davo / LineChart.tsx
Created August 6, 2018 03:50
LineChart Component for Framer X (based on VX)
import * as React from 'react'
import { Frame, Size, PropertyControls, ControlType } from 'framer'
import { AreaClosed, Line, Bar } from '@vx/shape'
import { appleStock } from '@vx/mock-data'
import { curveMonotoneX } from '@vx/curve'
import { LinearGradient } from '@vx/gradient'
// import { GridRows, GridColumns } from '@vx/grid'
import { scaleTime, scaleLinear } from '@vx/scale'
// import { withTooltip, Tooltip } from '@vx/tooltip'
@davo
davo / MatchUse.md
Last active April 5, 2019 17:30
Regex to match use{Def} on JS libraries