Skip to content

Instantly share code, notes, and snippets.

View davo's full-sized avatar
🦮
Golden

Davo Galavotti davo

🦮
Golden
View GitHub Profile
@davo
davo / isCanvasOrPreview.tsx
Created March 4, 2019 21:30
Framer X Check if component is on Canvas or Preview Window (via @steveruizok)
const isCanvasOrPreview = (source: any) => {
const searchLoop: (node: any) => 'canvas' | 'preview' = node => {
if (!node) return 'canvas'
if (node.key === 'preview') return 'preview'
return searchLoop(node._debugOwner)
}
return searchLoop(source._reactInternalFiber)
}
@davo
davo / GenericComponent.tsx
Last active March 1, 2019 17:45
Framer X RFC
import * as React from 'react'
import { PropertyControls, ControlType } from 'framer'
interface WithPropertyControls<P> extends React.SFC<P> {
propertyControls?: PropertyControls
}
declare type RFC<P> = WithPropertyControls<P>
interface Props {
@davo
davo / iphone-frame-overlay-app.js
Created January 21, 2019 04:40 — forked from vincentriemer/iphone-frame-overlay-app.js
Video iPhone Frame Overlay Web App Prototype
import React, { Component, useCallback, useState, useRef } from "react";
import "./App.css";
const imgUrl = require("./assets/iPhone-XS-Portrait-Space-Gray.png");
const fullSize = {
width: 1325,
height: 2616
};
@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 / settings.json
Created January 11, 2019 18:10
VS Code customization for Framer X projects
{
"workbench.colorCustomizations": {
"titleBar.activeBackground": "#05f",
"titleBar.inactiveBackground": "#09f",
"titleBar.inactiveForeground": "#262626",
"titleBar.activeForeground": "#ffffff"
}
}
@davo
davo / GoogleFontPlus.tsx
Created January 8, 2019 13:47
Dynamic ControlType.Enum values on Framer X
import * as React from 'react'
import { fonts } from './fonts'
const fontNames = fontArray => {
let fontList = []
fontArray.forEach((elem, index) => fontList.push(elem.family))
return fontList
}
const filterFontsByCategory = (category: string) => {
@davo
davo / framer-x-pain-points.md
Last active November 29, 2018 13:01
Framer X - Designer Developer Experience Pain Points

Framer X

Designer/Developer Experience Pain Points

Code Components

  • Classes as the only way to create Code Components to Framer X.

    • ES6 Classes are awesome but hardly the only way to code reusable components in React. If I wanted to create a stateless functional component there is no way for Framer X to view or create an instance of such component inside the Components panel.
  • Examples on how to Extend a Framer X Class component (ie: PageComponent)

    • This might be solved with a little documentation effort. I’m doing that to understand the relationship between the core components of Framer X and external community driven components (FX/React/JS).
@davo
davo / manifest.json
Last active November 2, 2018 01:19
React Sketchapp SVG
{
"compatibleVersion": 3,
"bundleVersion": 1,
"commands": [
{
"name": "SVG",
"identifier": "main",
"script": "./svg.js"
}
],
@davo
davo / heuristic_evaluation.md
Last active August 24, 2018 21:49
Heuristic evaluation
@davo
davo / .block
Last active August 21, 2018 18:52
Network flow with happy path
license: mit