This file contains 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
// Framer X Utils.modulate equivalent | |
function modulate(value, rangeA, rangeB, limit = false) { | |
const [fromLow, fromHigh] = rangeA; | |
const [toLow, toHigh] = rangeB; | |
const result = toLow + ((value - fromLow) / (fromHigh - fromLow)) * (toHigh - toLow); | |
if (limit === true) { | |
if (toLow < toHigh) { | |
if (result < toLow) { | |
return toLow; |
This file contains 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 { useState, useEffect } from "react" | |
interface WorldOrientation { | |
/** A number representing the motion of the device around the z axis, expressed in degrees with values ranging from 0 to 360. */ | |
alpha: number | |
/** A number representing the motion of the device around the x axis, expressed in degrees with values ranging from -180 to 180. This represents a front to back motion of the device. */ | |
beta: number | |
/** A number representing the motion of the device around the y axis, expressed in degrees with values ranging from -90 to 90. This represents a left to right motion of the device. */ | |
gamma: number | |
} |
This file contains 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 * as React from 'react' | |
import { Stack, Frame } from 'framer' | |
import { colors } from './canvas' | |
export function Colors() { | |
const [colorsTokens] = React.useState(() => { | |
return Object.keys(colors).map(key => colors[key]) | |
}) | |
return ( |
This file contains 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 * as React from "react"; | |
import { Frame, addPropertyControls, ControlType } from "framer"; | |
export function Component({ childComponent }) { | |
return ( | |
<div style={{ width: "100%" }}> | |
{React.Children.map(childComponent, (child, index) => { | |
return React.cloneElement(child, { | |
width: "100%", | |
key: index, |
OlderNewer