index
int64
0
0
repo_id
stringlengths
16
181
file_path
stringlengths
28
270
content
stringlengths
1
11.6M
__index_level_0__
int64
0
10k
0
petrpan-code/Shopify/react-native-skia/fabricexample/src/Examples
petrpan-code/Shopify/react-native-skia/fabricexample/src/Examples/API/PictureView.tsx
import React, { useMemo } from "react"; import { StyleSheet } from "react-native"; import { createPicture, Skia, SkiaPictureView, } from "@shopify/react-native-skia"; export const PictureViewExample = () => { // Create picture const picture = useMemo( () => createPicture({ x: 0, y: 0, width: 100, h...
6,800
0
petrpan-code/Shopify/react-native-skia/fabricexample/src/Examples
petrpan-code/Shopify/react-native-skia/fabricexample/src/Examples/API/Routes.ts
export type Routes = { Images: undefined; AnimatedImages: undefined; List: undefined; Shapes: undefined; PathEffect: undefined; Path: undefined; Clipping: undefined; Transform: undefined; ColorFilter: undefined; ImageFilters: undefined; Gradients: undefined; SVG: undefined; Touch: undefined; ...
6,801
0
petrpan-code/Shopify/react-native-skia/fabricexample/src/Examples
petrpan-code/Shopify/react-native-skia/fabricexample/src/Examples/API/SVG.tsx
import React from "react"; import { useWindowDimensions } from "react-native"; import { Canvas, ImageSVG, useSVG } from "@shopify/react-native-skia"; export const SVG = () => { const { width, height } = useWindowDimensions(); const svg = useSVG(require("./tiger.svg")); return ( <Canvas style={{ flex: 1 }}> ...
6,802
0
petrpan-code/Shopify/react-native-skia/fabricexample/src/Examples
petrpan-code/Shopify/react-native-skia/fabricexample/src/Examples/API/Shapes.tsx
import React, { useMemo } from "react"; import { ScrollView, PixelRatio, useWindowDimensions } from "react-native"; import { Skia, PaintStyle, Canvas, Rect, DiffRect, Group, Oval, Line, Points, vec, rect, rrect, Paint, DashPathEffect, Vertices, RoundedRect, Patch, } from "@shopify/reac...
6,803
0
petrpan-code/Shopify/react-native-skia/fabricexample/src/Examples
petrpan-code/Shopify/react-native-skia/fabricexample/src/Examples/API/Snapshot.tsx
import React, { useCallback, useRef, useState } from "react"; import { View, StyleSheet, Button, Text, useWindowDimensions, ScrollView, } from "react-native"; import type { SkImage } from "@shopify/react-native-skia"; import { Canvas, Fill, Skia, RoundedRect, makeImageFromView, mix, Shader, ...
6,804
0
petrpan-code/Shopify/react-native-skia/fabricexample/src/Examples
petrpan-code/Shopify/react-native-skia/fabricexample/src/Examples/API/Touch.tsx
import React from "react"; import { StyleSheet, View } from "react-native"; import type { SkPicture, SkSize } from "@shopify/react-native-skia"; import { Group, Fill, Canvas, Picture, Skia, PaintStyle, } from "@shopify/react-native-skia"; import type { TouchData } from "react-native-gesture-handler"; import...
6,805
0
petrpan-code/Shopify/react-native-skia/fabricexample/src/Examples
petrpan-code/Shopify/react-native-skia/fabricexample/src/Examples/API/Transform.tsx
import React, { useMemo } from "react"; import { ScrollView, useWindowDimensions } from "react-native"; import { Skia, useDrawCallback, SkiaView, PaintStyle, useImage, } from "@shopify/react-native-skia"; import { Title } from "./components/Title"; const card = require("../../assets/card.png"); const paint...
6,806
0
petrpan-code/Shopify/react-native-skia/fabricexample/src/Examples
petrpan-code/Shopify/react-native-skia/fabricexample/src/Examples/API/UseCanvas.tsx
import type { SkSize } from "@shopify/react-native-skia"; import { Canvas, Fill, Group, Rect, rect } from "@shopify/react-native-skia"; import React, { useEffect, useRef } from "react"; import { View, Animated } from "react-native"; import { useNavigation } from "@react-navigation/native"; import { useContextBridge } f...
6,807
0
petrpan-code/Shopify/react-native-skia/fabricexample/src/Examples
petrpan-code/Shopify/react-native-skia/fabricexample/src/Examples/API/index.tsx
import React from "react"; import { createNativeStackNavigator } from "@react-navigation/native-stack"; import type { Routes } from "./Routes"; import { List } from "./List"; import { PathEffectDemo } from "./PathEffect"; import { Shapes } from "./Shapes"; import { Clipping } from "./Clipping"; import { Transform } fr...
6,808
0
petrpan-code/Shopify/react-native-skia/fabricexample/src/Examples
petrpan-code/Shopify/react-native-skia/fabricexample/src/Examples/API/tiger.svg
<?xml version="1.0" encoding="UTF-8" standalone="no"?> <svg id="svg2" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 900 900" version="1.1"> <g id="g4" fill="none" transform="matrix(1.7656463,0,0,1.7656463,324.90716,255.00942)"> <g id="g6" stroke-width="0.17200001" stroke="#000" fill="#FFF"> <path id="path8" d="...
6,809
0
petrpan-code/Shopify/react-native-skia/fabricexample/src/Examples/API
petrpan-code/Shopify/react-native-skia/fabricexample/src/Examples/API/Icons/index.tsx
import React, { createContext, useContext, useMemo } from "react"; import { Text, View } from "react-native"; import { createBottomTabNavigator } from "@react-navigation/bottom-tabs"; import type { SkPicture } from "@shopify/react-native-skia"; import { Canvas, Rect, SkiaPictureView, Skia, useSVG, } from "@sh...
6,810
0
petrpan-code/Shopify/react-native-skia/fabricexample/src/Examples/API/Icons
petrpan-code/Shopify/react-native-skia/fabricexample/src/Examples/API/Icons/SvgIcons/GithubIcon.tsx
/* eslint-disable max-len */ import * as React from "react"; import Svg, { Path } from "react-native-svg"; export const Github = () => ( <Svg width={48} height={48}> <Path fill="#fff" d="M41 24c0 9.4-7.6 17-17 17S7 33.4 7 24 14.6 7 24 7s17 7.6 17 17z" /> <Path fill="#455a64" d="M21...
6,811
0
petrpan-code/Shopify/react-native-skia/fabricexample/src/Examples/API/Icons
petrpan-code/Shopify/react-native-skia/fabricexample/src/Examples/API/Icons/SvgIcons/OctocatIcon.tsx
/* eslint-disable max-len */ import * as React from "react"; import Svg, { Path } from "react-native-svg"; export const Octocat = () => ( <Svg width={48} height={48}> <Path fill="#455A64" d="M40.3 15.7c.6-1.7 1.2-5-.4-8.7-4.5 0-8.3 3.2-8.9 3.8-2.2-.5-4.6-.7-7-.7-2.5 0-4.9.3-7.2.8C13.7 7.7 9.6 7 8 7c0 ...
6,812
0
petrpan-code/Shopify/react-native-skia/fabricexample/src/Examples/API/Icons
petrpan-code/Shopify/react-native-skia/fabricexample/src/Examples/API/Icons/SvgIcons/StackExchangeIcon.tsx
import * as React from "react"; import Svg, { Path } from "react-native-svg"; export const StackExchange = () => ( <Svg width={48} height={48}> <Path fill="#33afec" d="M6 13v7h25.2l6.4-7H6z" /> <Path fill="#0084d7" d="M6 22v7h17.1l6.3-7H6z" /> <Path fill="#0262b8" d="M6 31v2c0 3.3 2.7 6 6 6h2l7.3-8H6z" />...
6,813
0
petrpan-code/Shopify/react-native-skia/fabricexample/src/Examples/API/Icons
petrpan-code/Shopify/react-native-skia/fabricexample/src/Examples/API/Icons/SvgIcons/StackOverflowIcon.tsx
/* eslint-disable max-len */ import * as React from "react"; import Svg, { Path } from "react-native-svg"; export const StackOverflow = () => ( <Svg width={48} height={48}> <Path fill="#727d86" d="M32 28.5V39H12V28.5a.5.5 0 0 0-.5-.5h-2a.5.5 0 0 0-.5.5V41a1 1 0 0 0 1 1h24a1 1 0 0 0 1-1V28.5a.5.5 0 0 0...
6,814
0
petrpan-code/Shopify/react-native-skia/fabricexample/src/Examples/API
petrpan-code/Shopify/react-native-skia/fabricexample/src/Examples/API/components/Examples.tsx
import type { ReactChild, ReactFragment, ReactPortal } from "react"; import React, { Children } from "react"; import { ScrollView } from "react-native"; import { Canvas } from "@shopify/react-native-skia"; import { ExportableCanvas } from "../../../components/ExportableCanvas"; export const SIZE = 256; type Child = ...
6,815
0
petrpan-code/Shopify/react-native-skia/fabricexample/src/Examples/API
petrpan-code/Shopify/react-native-skia/fabricexample/src/Examples/API/components/Title.tsx
import React from "react"; import { Text, StyleSheet } from "react-native"; interface TitleProps { children: string; } export const Title = ({ children }: TitleProps) => { return <Text style={styles.title}>{children}</Text>; }; const styles = StyleSheet.create({ title: { fontSize: 24, fontWeight: "bold...
6,816
0
petrpan-code/Shopify/react-native-skia/fabricexample/src/Examples/API/components
petrpan-code/Shopify/react-native-skia/fabricexample/src/Examples/API/components/drawings/backface.tsx
/* eslint-disable max-len */ import React from "react"; import { Skia, PaintStyle, Group, Path, Rect, translate, } from "@shopify/react-native-skia"; const aspectRatio = 757 / 492; const center = { x: 492 / 2, y: 757 / 2 }; export const CARD_WIDTH = 300; export const CARD_HEIGHT = CARD_WIDTH * aspectRatio;...
6,817
0
petrpan-code/Shopify/react-native-skia/fabricexample/src/Examples
petrpan-code/Shopify/react-native-skia/fabricexample/src/Examples/Aurora/Aurora.tsx
import React from "react"; import { CoonsPatchMeshGradient } from "./components/CoonsPatchMeshGradient"; export const Aurora = () => { return ( <CoonsPatchMeshGradient rows={3} cols={3} colors={palette.otto} lines handles /> ); }; const palette = { otto: [ "#FEF8C4", ...
6,818
0
petrpan-code/Shopify/react-native-skia/fabricexample/src/Examples
petrpan-code/Shopify/react-native-skia/fabricexample/src/Examples/Aurora/index.ts
export * from "./Aurora";
6,819
0
petrpan-code/Shopify/react-native-skia/fabricexample/src/Examples/Aurora
petrpan-code/Shopify/react-native-skia/fabricexample/src/Examples/Aurora/components/BilinearGradient.tsx
import React from "react"; import type { SkRect, Color } from "@shopify/react-native-skia"; import { Shader, Skia } from "@shopify/react-native-skia"; const source = Skia.RuntimeEffect.Make(` uniform vec4 position; uniform vec4 colors[4]; vec4 main(vec2 pos) { vec2 uv = (pos - vec2(position.x, position.y))/vec2(pos...
6,820
0
petrpan-code/Shopify/react-native-skia/fabricexample/src/Examples/Aurora
petrpan-code/Shopify/react-native-skia/fabricexample/src/Examples/Aurora/components/CoonsPatchMeshGradient.tsx
import React, { useMemo } from "react"; import type { CubicBezierHandle } from "@shopify/react-native-skia"; import { Skia, isEdge, Group, add, Canvas, ImageShader, Patch, vec, useImage, } from "@shopify/react-native-skia"; import { View, useWindowDimensions, StyleSheet } from "react-native"; import A...
6,821
0
petrpan-code/Shopify/react-native-skia/fabricexample/src/Examples/Aurora
petrpan-code/Shopify/react-native-skia/fabricexample/src/Examples/Aurora/components/Cubic.tsx
import React from "react"; import type { CubicBezierHandle } from "@shopify/react-native-skia"; import { Line, Paint, Circle } from "@shopify/react-native-skia"; import { useDerivedValue, type SharedValue } from "react-native-reanimated"; import { symmetric } from "./Math"; interface CubicProps { mesh: SharedValue<...
6,822
0
petrpan-code/Shopify/react-native-skia/fabricexample/src/Examples/Aurora
petrpan-code/Shopify/react-native-skia/fabricexample/src/Examples/Aurora/components/Curves.tsx
import type { PatchProps } from "@shopify/react-native-skia"; import { Path, Skia } from "@shopify/react-native-skia"; import React from "react"; import { useDerivedValue, type SharedValue } from "react-native-reanimated"; interface CurvesProps { patch: SharedValue<PatchProps["patch"]>; } export const Curves = ({ p...
6,823
0
petrpan-code/Shopify/react-native-skia/fabricexample/src/Examples/Aurora
petrpan-code/Shopify/react-native-skia/fabricexample/src/Examples/Aurora/components/Math.ts
import type { Color, Vector } from "@shopify/react-native-skia"; import { mixColors, dist, vec } from "@shopify/react-native-skia"; export const bilinearInterpolate = ( [color0, color1, color2, color3]: Color[], size: Vector, pos: Vector ) => { "worklet"; const uv = vec(pos.x / size.x, pos.y / size.y); con...
6,824
0
petrpan-code/Shopify/react-native-skia/fabricexample/src/Examples/Aurora
petrpan-code/Shopify/react-native-skia/fabricexample/src/Examples/Aurora/components/useHandles.ts
import type { CubicBezierHandle, SkRect } from "@shopify/react-native-skia"; import { isEdge, sub } from "@shopify/react-native-skia"; import { useSharedValue, type SharedValue } from "react-native-reanimated"; import { Gesture } from "react-native-gesture-handler"; import { inRadius, symmetric } from "./Math"; type ...
6,825
0
petrpan-code/Shopify/react-native-skia/fabricexample/src/Examples
petrpan-code/Shopify/react-native-skia/fabricexample/src/Examples/Breathe/Breathe.tsx
import React, { useMemo } from "react"; import { StyleSheet, useWindowDimensions } from "react-native"; import { BlurMask, vec, Canvas, Circle, Fill, Group, polar2Canvas, mix, } from "@shopify/react-native-skia"; import type { SharedValue } from "react-native-reanimated"; import { useDerivedValue } from...
6,826
0
petrpan-code/Shopify/react-native-skia/fabricexample/src/Examples
petrpan-code/Shopify/react-native-skia/fabricexample/src/Examples/Breathe/index.ts
export { Breathe } from "./Breathe";
6,827
0
petrpan-code/Shopify/react-native-skia/fabricexample/src/Examples
petrpan-code/Shopify/react-native-skia/fabricexample/src/Examples/Filters/Filters.tsx
import React from "react"; import { Pressable, useWindowDimensions } from "react-native"; import { useImage, Canvas, ImageShader, Skia, Shader, mix, Fill, } from "@shopify/react-native-skia"; import { useDerivedValue } from "react-native-reanimated"; import { useLoop } from "../../components/Animations";...
6,828
0
petrpan-code/Shopify/react-native-skia/fabricexample/src/Examples
petrpan-code/Shopify/react-native-skia/fabricexample/src/Examples/Filters/index.tsx
export { Filters } from "./Filters";
6,829
0
petrpan-code/Shopify/react-native-skia/fabricexample/src/Examples
petrpan-code/Shopify/react-native-skia/fabricexample/src/Examples/Glassmorphism/Card.tsx
import { BackdropBlur, Canvas, rect, rrect, vec, Rect, LinearGradient, Paint, Text, useFont, } from "@shopify/react-native-skia"; import React, { useMemo } from "react"; import { View, useWindowDimensions, StyleSheet } from "react-native"; import { useDerivedValue, useSharedValue } from "react-nativ...
6,830
0
petrpan-code/Shopify/react-native-skia/fabricexample/src/Examples
petrpan-code/Shopify/react-native-skia/fabricexample/src/Examples/Glassmorphism/Glassmorphism.tsx
import { add, Canvas, Circle, LinearGradient, vec, sub, Fill, mix, BackdropFilter, Blur, } from "@shopify/react-native-skia"; import React, { useMemo } from "react"; import { useWindowDimensions } from "react-native"; import { useDerivedValue } from "react-native-reanimated"; import { useLoop } fro...
6,831
0
petrpan-code/Shopify/react-native-skia/fabricexample/src/Examples
petrpan-code/Shopify/react-native-skia/fabricexample/src/Examples/Glassmorphism/index.ts
export * from "./Glassmorphism";
6,832
0
petrpan-code/Shopify/react-native-skia/fabricexample/src/Examples/Glassmorphism
petrpan-code/Shopify/react-native-skia/fabricexample/src/Examples/Glassmorphism/components/Background.tsx
import { Fill, Group, Paint, rect } from "@shopify/react-native-skia"; import React from "react"; import { useWindowDimensions } from "react-native"; import { BilinearGradient } from "../../Aurora/components/BilinearGradient"; export const Background = () => { const { width, height } = useWindowDimensions(); retu...
6,833
0
petrpan-code/Shopify/react-native-skia/fabricexample/src/Examples/Glassmorphism
petrpan-code/Shopify/react-native-skia/fabricexample/src/Examples/Glassmorphism/components/Ball.tsx
import type { Vector } from "@shopify/react-native-skia"; import { BlurMask, add, vec, Circle, Paint, LinearGradient, Group, } from "@shopify/react-native-skia"; import React from "react"; interface BallProps { c: Vector; r: number; } export const Ball = ({ c, r }: BallProps) => { return ( <Gr...
6,834
0
petrpan-code/Shopify/react-native-skia/fabricexample/src/Examples
petrpan-code/Shopify/react-native-skia/fabricexample/src/Examples/Gooey/Gooey.tsx
/* eslint-disable max-len */ import React, { useMemo } from "react"; import type { SkPath, Vector } from "@shopify/react-native-skia"; import { Canvas, Fill, Skia, translate, vec, Group, PathOp, rotate, mixVector, Paint, Circle, Blur, ColorMatrix, } from "@shopify/react-native-skia"; import { ...
6,835
0
petrpan-code/Shopify/react-native-skia/fabricexample/src/Examples
petrpan-code/Shopify/react-native-skia/fabricexample/src/Examples/Gooey/index.ts
export * from "./Gooey";
6,836
0
petrpan-code/Shopify/react-native-skia/fabricexample/src/Examples/Gooey
petrpan-code/Shopify/react-native-skia/fabricexample/src/Examples/Gooey/components/Hamburger.tsx
import { Circle, vec, Line } from "@shopify/react-native-skia"; import React from "react"; import { FG } from "./Theme"; const R = 50; export const Hamburger = () => { return ( <> <Circle r={R} color={FG} /> <Line p1={vec(-20, -15)} p2={vec(20, -15)} color="white" st...
6,837
0
petrpan-code/Shopify/react-native-skia/fabricexample/src/Examples/Gooey
petrpan-code/Shopify/react-native-skia/fabricexample/src/Examples/Gooey/components/Icon.tsx
import type { SkPath } from "@shopify/react-native-skia"; import { Group, Path, vec } from "@shopify/react-native-skia"; import React from "react"; export const R = 50; interface IconProps { path: SkPath; } export const Icon = ({ path }: IconProps) => { return ( <> <Group origin={vec(12)} ...
6,838
0
petrpan-code/Shopify/react-native-skia/fabricexample/src/Examples/Gooey
petrpan-code/Shopify/react-native-skia/fabricexample/src/Examples/Gooey/components/Theme.ts
export const BG = "lightblue"; export const FG = "#ade6bb";
6,839
0
petrpan-code/Shopify/react-native-skia/fabricexample/src/Examples
petrpan-code/Shopify/react-native-skia/fabricexample/src/Examples/Graphs/Interpolation.tsx
import type { AnimatedProps, PathProps, SkPath, } from "@shopify/react-native-skia"; import { interpolatePaths, Canvas, Fill, Path, } from "@shopify/react-native-skia"; import React, { useEffect, useState } from "react"; import { StyleSheet, Text, View } from "react-native"; import { useDerivedValue, ...
6,840
0
petrpan-code/Shopify/react-native-skia/fabricexample/src/Examples
petrpan-code/Shopify/react-native-skia/fabricexample/src/Examples/Graphs/Slider.tsx
import type { SkPath } from "@shopify/react-native-skia"; import { useFont, Group, Line, Canvas, Circle, Fill, LinearGradient, Path, Text as SkiaText, vec, } from "@shopify/react-native-skia"; import React, { useMemo } from "react"; import { StyleSheet, Text, View } from "react-native"; import { Ges...
6,841
0
petrpan-code/Shopify/react-native-skia/fabricexample/src/Examples
petrpan-code/Shopify/react-native-skia/fabricexample/src/Examples/Graphs/createGraphPath.ts
import { Skia } from "@shopify/react-native-skia"; export const createGraphPath = ( width: number, height: number, steps: number, round = true ) => { const retVal = Skia.Path.Make(); let y = height / 2; retVal.moveTo(0, y); const prevPt = { x: 0, y }; for (let i = 0; i < width; i += width / steps) { ...
6,842
0
petrpan-code/Shopify/react-native-skia/fabricexample/src/Examples
petrpan-code/Shopify/react-native-skia/fabricexample/src/Examples/Graphs/index.tsx
import React from "react"; import { View, StyleSheet, useWindowDimensions } from "react-native"; import { Interpolation } from "./Interpolation"; import { Slider } from "./Slider"; const Padding = 10; export const GraphsScreen: React.FC = () => { const { width, height } = useWindowDimensions(); return ( <Vie...
6,843
0
petrpan-code/Shopify/react-native-skia/fabricexample/src/Examples
petrpan-code/Shopify/react-native-skia/fabricexample/src/Examples/Graphs/types.ts
export type GraphProps = { height: number; width: number; };
6,844
0
petrpan-code/Shopify/react-native-skia/fabricexample/src/Examples
petrpan-code/Shopify/react-native-skia/fabricexample/src/Examples/Hue/Helpers.ts
import { mix } from "@shopify/react-native-skia"; const TAU = Math.PI * 2; const quadraticIn = (t: number) => { "worklet"; return t * t; }; const fract = (x: number) => { "worklet"; return x - Math.floor(x); }; const clamp = (value: number, lowerBound: number, upperBound: number) => { "worklet"; return ...
6,845
0
petrpan-code/Shopify/react-native-skia/fabricexample/src/Examples
petrpan-code/Shopify/react-native-skia/fabricexample/src/Examples/Hue/Hue.tsx
import React, { useMemo } from "react"; import type { Color } from "@shopify/react-native-skia"; import { Canvas, Circle, vec, Fill, Skia, ShaderLib, BlurMask, canvas2Polar, polar2Canvas, Shader, } from "@shopify/react-native-skia"; import { StyleSheet, View, useWindowDimensions } from "react-native...
6,846
0
petrpan-code/Shopify/react-native-skia/fabricexample/src/Examples
petrpan-code/Shopify/react-native-skia/fabricexample/src/Examples/Hue/index.ts
export { Hue } from "./Hue";
6,847
0
petrpan-code/Shopify/react-native-skia/fabricexample/src/Examples
petrpan-code/Shopify/react-native-skia/fabricexample/src/Examples/Matrix/Matrix.tsx
import { BlurMask, Canvas, Fill, Group, useFont, } from "@shopify/react-native-skia"; import React from "react"; import { useWindowDimensions } from "react-native"; import { useClock } from "../../components/Animations"; import { COLS, ROWS, Symbol } from "./Symbol"; const cols = new Array(COLS).fill(0).ma...
6,848
0
petrpan-code/Shopify/react-native-skia/fabricexample/src/Examples
petrpan-code/Shopify/react-native-skia/fabricexample/src/Examples/Matrix/Symbol.tsx
import React, { useRef } from "react"; import type { SkFont } from "@shopify/react-native-skia"; import { interpolateColors, vec, Glyphs } from "@shopify/react-native-skia"; import { useDerivedValue, type SharedValue } from "react-native-reanimated"; export const COLS = 15; export const ROWS = 30; const pos = vec(0, 0...
6,849
0
petrpan-code/Shopify/react-native-skia/fabricexample/src/Examples
petrpan-code/Shopify/react-native-skia/fabricexample/src/Examples/Matrix/index.ts
export { Matrix } from "./Matrix";
6,850
0
petrpan-code/Shopify/react-native-skia/fabricexample/src/Examples
petrpan-code/Shopify/react-native-skia/fabricexample/src/Examples/Neumorphism/BoxShadow.tsx
import React, { useMemo } from "react"; import { FitBox, Path, Paint, Box, Canvas, Fill, vec, rrect, rect, Shadow, BoxShadow, } from "@shopify/react-native-skia"; import { useWindowDimensions } from "react-native"; export const Neumorphism = () => { const { width } = useWindowDimensions(); co...
6,851
0
petrpan-code/Shopify/react-native-skia/fabricexample/src/Examples
petrpan-code/Shopify/react-native-skia/fabricexample/src/Examples/Neumorphism/Neumorphism.tsx
import { Shadow, Canvas, Fill, Group, Paint, RoundedRect, } from "@shopify/react-native-skia"; import React from "react"; const PADDING = 32; const SIZE = 256 - 64; const R = 32; export const Neumorphism = () => { return ( <Canvas> <Fill color="lightblue" /> <Group> <Paint> ...
6,852
0
petrpan-code/Shopify/react-native-skia/fabricexample/src/Examples
petrpan-code/Shopify/react-native-skia/fabricexample/src/Examples/Neumorphism/index.ts
export { Neumorphism } from "./Elements";
6,853
0
petrpan-code/Shopify/react-native-skia/fabricexample/src/Examples/Neumorphism
petrpan-code/Shopify/react-native-skia/fabricexample/src/Examples/Neumorphism/Dashboard/Dashboard.tsx
import React from "react"; import { useWindowDimensions } from "react-native"; import { mix, Blur, Canvas, Circle, Fill, Group, LinearGradient, rect, useFont, vec, fitRects, rect2rect, } from "@shopify/react-native-skia"; import { useDerivedValue, useSharedValue } from "react-native-reanimated";...
6,854
0
petrpan-code/Shopify/react-native-skia/fabricexample/src/Examples/Neumorphism
petrpan-code/Shopify/react-native-skia/fabricexample/src/Examples/Neumorphism/Dashboard/index.ts
export * from "./Dashboard";
6,855
0
petrpan-code/Shopify/react-native-skia/fabricexample/src/Examples/Neumorphism/Dashboard
petrpan-code/Shopify/react-native-skia/fabricexample/src/Examples/Neumorphism/Dashboard/components/Button.tsx
import { Blur, Circle, Group, LinearGradient, RadialGradient, translate, vec, } from "@shopify/react-native-skia"; import type { ReactNode } from "react"; import React from "react"; export const BUTTON_SIZE = 62; const PADDING = 6; const r2 = BUTTON_SIZE / 2; const r1 = r2 - 6; interface ButtonProps { ...
6,856
0
petrpan-code/Shopify/react-native-skia/fabricexample/src/Examples/Neumorphism/Dashboard
petrpan-code/Shopify/react-native-skia/fabricexample/src/Examples/Neumorphism/Dashboard/components/Control.tsx
import { Shadow, vec, Group, translate, Text, Circle, LinearGradient, } from "@shopify/react-native-skia"; import type { SkFont } from "@shopify/react-native-skia"; import type { ReactNode } from "react"; import React from "react"; import type { SharedValue } from "react-native-reanimated"; import { Slid...
6,857
0
petrpan-code/Shopify/react-native-skia/fabricexample/src/Examples/Neumorphism/Dashboard
petrpan-code/Shopify/react-native-skia/fabricexample/src/Examples/Neumorphism/Dashboard/components/Knob.tsx
import React from "react"; import { RoundedRect, Group, LinearGradient, vec, } from "@shopify/react-native-skia"; export const Knob = () => { return ( <Group> <Group> <LinearGradient start={vec(0, 0)} end={vec(27.5, 17)} colors={["#2E3236", "#141515"]} ...
6,858
0
petrpan-code/Shopify/react-native-skia/fabricexample/src/Examples/Neumorphism/Dashboard
petrpan-code/Shopify/react-native-skia/fabricexample/src/Examples/Neumorphism/Dashboard/components/Mode.tsx
import { BackdropBlur, rect, rrect, Fill, RoundedRect, Group, useImage, Image, } from "@shopify/react-native-skia"; import React from "react"; import { useDerivedValue, type SharedValue } from "react-native-reanimated"; const clip = rrect(rect(0, 596, 390, 844), 40, 40); interface ModeProps { transl...
6,859
0
petrpan-code/Shopify/react-native-skia/fabricexample/src/Examples/Neumorphism/Dashboard
petrpan-code/Shopify/react-native-skia/fabricexample/src/Examples/Neumorphism/Dashboard/components/ProgressBar.tsx
import { BoxShadow, rect, rrect, Group, LinearGradient, translate, Circle, Skia, vec, Path, SweepGradient, useFont, Text, Box, } from "@shopify/react-native-skia"; import React from "react"; import type { SharedValue } from "react-native-reanimated"; import { useDerivedValue } from "react-na...
6,860
0
petrpan-code/Shopify/react-native-skia/fabricexample/src/Examples/Neumorphism/Dashboard
petrpan-code/Shopify/react-native-skia/fabricexample/src/Examples/Neumorphism/Dashboard/components/Slider.tsx
import { BoxShadow, Box, rect, rrect, RoundedRect, Group, translate, LinearGradient, vec, } from "@shopify/react-native-skia"; import React from "react"; import type { SharedValue } from "react-native-reanimated"; import { useDerivedValue } from "react-native-reanimated"; import { Knob } from "./Knob...
6,861
0
petrpan-code/Shopify/react-native-skia/fabricexample/src/Examples/Neumorphism/Dashboard
petrpan-code/Shopify/react-native-skia/fabricexample/src/Examples/Neumorphism/Dashboard/components/Title.tsx
import { Group, Text, useFont } from "@shopify/react-native-skia"; import React from "react"; import { Button, BUTTON_SIZE } from "./Button"; import { ChervronLeft } from "./icons/ChevronLeft"; import { Cog } from "./icons/Cog"; interface Title { title: string; } export const Title = ({ title }: Title) => { cons...
6,862
0
petrpan-code/Shopify/react-native-skia/fabricexample/src/Examples/Neumorphism/Dashboard/components
petrpan-code/Shopify/react-native-skia/fabricexample/src/Examples/Neumorphism/Dashboard/components/icons/ChevronLeft.tsx
import React from "react"; import { Group, Points, vec } from "@shopify/react-native-skia"; export const ChervronLeft = () => { return ( <Group style="stroke" strokeWidth={2} strokeCap="round" strokeJoin="round"> <Points points={[vec(15, 18), vec(9, 12), vec(15, 6)]} mode="polygon" /> </Group> ); };
6,863
0
petrpan-code/Shopify/react-native-skia/fabricexample/src/Examples/Neumorphism/Dashboard/components
petrpan-code/Shopify/react-native-skia/fabricexample/src/Examples/Neumorphism/Dashboard/components/icons/Cog.tsx
/* eslint-disable max-len */ import { Circle, Group, Path } from "@shopify/react-native-skia"; import React from "react"; export const Cog = () => { return ( <Group style="stroke" strokeWidth={2} strokeCap="round" strokeJoin="round"> <Circle cx={12} cy={12} r={3} /> <Path path="M19.4 15a1.65 1.65 0 0...
6,864
0
petrpan-code/Shopify/react-native-skia/fabricexample/src/Examples/Neumorphism/Dashboard/components
petrpan-code/Shopify/react-native-skia/fabricexample/src/Examples/Neumorphism/Dashboard/components/icons/Power.tsx
import React from "react"; import { Path, Line, Group, vec } from "@shopify/react-native-skia"; export const Power = () => { return ( <Group style="stroke" strokeWidth={2} strokeCap="round" strokeJoin="round"> <Path path="M18.36 6.64a9 9 0 1 1-12.73 0" /> <Line p1={vec(12, 2)} p2={vec(12, 12)} /> ...
6,865
0
petrpan-code/Shopify/react-native-skia/fabricexample/src/Examples/Neumorphism/Dashboard/components
petrpan-code/Shopify/react-native-skia/fabricexample/src/Examples/Neumorphism/Dashboard/components/icons/Snow.tsx
import { Group, Path, Line, vec } from "@shopify/react-native-skia"; import React from "react"; export const Snow = () => { return ( <Group strokeCap="round" strokeJoin="round" strokeWidth={2} style="stroke"> <Path path="M20 17.58A5 5 0 0 0 18 8h-1.26A8 8 0 1 0 4 16.25" /> <Line p1={vec(8, 16)} p2={v...
6,866
0
petrpan-code/Shopify/react-native-skia/fabricexample/src/Examples/Neumorphism/Dashboard/components
petrpan-code/Shopify/react-native-skia/fabricexample/src/Examples/Neumorphism/Dashboard/components/icons/Sun.tsx
import { Group, Circle, Line, vec } from "@shopify/react-native-skia"; import React from "react"; export const Sun = () => { return ( <Group strokeWidth={2} strokeCap="round" strokeJoin="round" style="stroke"> <Circle cx={12} cy={12} r={5} /> <Line p1={vec(12, 1)} p2={vec(12, 3)} /> <Line p1={v...
6,867
0
petrpan-code/Shopify/react-native-skia/fabricexample/src/Examples/Neumorphism/Dashboard/components
petrpan-code/Shopify/react-native-skia/fabricexample/src/Examples/Neumorphism/Dashboard/components/icons/Wind.tsx
import { Group, Path } from "@shopify/react-native-skia"; import React from "react"; export const Wind = () => { return ( <Group style="stroke" strokeWidth={2} strokeCap="round" strokeJoin="round"> <Path path="M9.59 4.59A2 2 0 1 1 11 8H2m10.59 11.41A2 2 0 1 0 14 16H2m15.73-8.27A2.5 2.5 0 1 1 19.5 12H2" /> ...
6,868
0
petrpan-code/Shopify/react-native-skia/fabricexample/src/Examples/Neumorphism
petrpan-code/Shopify/react-native-skia/fabricexample/src/Examples/Neumorphism/Elements/Elements.tsx
import React from "react"; import { Pressable, useWindowDimensions } from "react-native"; import { Canvas, Fill } from "@shopify/react-native-skia"; import { useSharedValue, withTiming } from "react-native-reanimated"; import { Switch } from "./components/Switch"; const PADDING = 32; const x = PADDING; const y = 75; ...
6,869
0
petrpan-code/Shopify/react-native-skia/fabricexample/src/Examples/Neumorphism
petrpan-code/Shopify/react-native-skia/fabricexample/src/Examples/Neumorphism/Elements/index.ts
export * from "./Elements";
6,870
0
petrpan-code/Shopify/react-native-skia/fabricexample/src/Examples/Neumorphism/Elements
petrpan-code/Shopify/react-native-skia/fabricexample/src/Examples/Neumorphism/Elements/components/Button.tsx
import { FitBox, rect, rrect, Box, BoxShadow, mix, } from "@shopify/react-native-skia"; import type { ReactNode } from "react"; import React from "react"; import type { SharedValue } from "react-native-reanimated"; import { useDerivedValue } from "react-native-reanimated"; import { Theme } from "./Theme"; ...
6,871
0
petrpan-code/Shopify/react-native-skia/fabricexample/src/Examples/Neumorphism/Elements
petrpan-code/Shopify/react-native-skia/fabricexample/src/Examples/Neumorphism/Elements/components/ProgressBar.tsx
import React from "react"; import { Shadow, Group, Paint, mix, rrect, FitBox, rect, RoundedRect, } from "@shopify/react-native-skia"; import type { SharedValue } from "react-native-reanimated"; import { useDerivedValue } from "react-native-reanimated"; import { Theme } from "./Theme"; const container ...
6,872
0
petrpan-code/Shopify/react-native-skia/fabricexample/src/Examples/Neumorphism/Elements
petrpan-code/Shopify/react-native-skia/fabricexample/src/Examples/Neumorphism/Elements/components/Switch.tsx
import { mix, Group, BoxShadow, Box, FitBox, rect, rrect, Circle, } from "@shopify/react-native-skia"; import React from "react"; import { useDerivedValue, type SharedValue } from "react-native-reanimated"; import { Theme } from "./Theme"; const border = rrect(rect(0, 0, 48, 24), 12, 12); const contai...
6,873
0
petrpan-code/Shopify/react-native-skia/fabricexample/src/Examples/Neumorphism/Elements
petrpan-code/Shopify/react-native-skia/fabricexample/src/Examples/Neumorphism/Elements/components/Theme.ts
export const Theme = { white1: "#F0F0F3", white2: "#EEEEEE", };
6,874
0
petrpan-code/Shopify/react-native-skia/fabricexample/src/Examples
petrpan-code/Shopify/react-native-skia/fabricexample/src/Examples/Performance/PerformanceCanvases.tsx
import { Canvas, useImage, Image } from "@shopify/react-native-skia"; import React, { useState, useEffect } from "react"; import { StyleSheet, View } from "react-native"; const oslo = require("../../assets/oslo.jpg"); const SIZE = 26; const PADDING = 2; const numberOfItems = 100; export const PerformanceDrawingTest:...
6,875
0
petrpan-code/Shopify/react-native-skia/fabricexample/src/Examples
petrpan-code/Shopify/react-native-skia/fabricexample/src/Examples/Performance/PerformanceRects.tsx
import { Canvas, Rect, Skia, Group } from "@shopify/react-native-skia"; import type { SkRect } from "@shopify/react-native-skia"; import React, { useMemo, useState } from "react"; import { StyleSheet, useWindowDimensions, View, Text, Button, } from "react-native"; import { Gesture, GestureDetector } from "rea...
6,876
0
petrpan-code/Shopify/react-native-skia/fabricexample/src/Examples
petrpan-code/Shopify/react-native-skia/fabricexample/src/Examples/Performance/index.ts
export { PerformanceDrawingTest } from "./PerformanceRects"; //export { PerformanceDrawingTest } from "./PerformanceCanvases";
6,877
0
petrpan-code/Shopify/react-native-skia/fabricexample/src/Examples
petrpan-code/Shopify/react-native-skia/fabricexample/src/Examples/Reanimated/AnimateTextOnPath.tsx
import React, { useEffect, useMemo } from "react"; import { StyleSheet, useWindowDimensions } from "react-native"; import { Canvas, Fill, TextPath, useFont, Skia, } from "@shopify/react-native-skia"; import { useSharedValue, Easing, withTiming, withRepeat, useDerivedValue, } from "react-native-reani...
6,878
0
petrpan-code/Shopify/react-native-skia/fabricexample/src/Examples
petrpan-code/Shopify/react-native-skia/fabricexample/src/Examples/Reanimated/AnimationWithTouchHandler.tsx
import React from "react"; import { StyleSheet, useWindowDimensions } from "react-native"; import { Canvas, Circle, Fill } from "@shopify/react-native-skia"; import { GestureDetector, Gesture } from "react-native-gesture-handler"; import { useSharedValue, withDecay } from "react-native-reanimated"; import { AnimationD...
6,879
0
petrpan-code/Shopify/react-native-skia/fabricexample/src/Examples
petrpan-code/Shopify/react-native-skia/fabricexample/src/Examples/Reanimated/BokehExample.tsx
import { Dimensions, StyleSheet } from "react-native"; import React from "react"; import { Easing, useDerivedValue, useSharedValue, withTiming, } from "react-native-reanimated"; import { Canvas, Circle, Fill } from "@shopify/react-native-skia"; import { AnimationDemo } from "./Components"; const { width } = D...
6,880
0
petrpan-code/Shopify/react-native-skia/fabricexample/src/Examples
petrpan-code/Shopify/react-native-skia/fabricexample/src/Examples/Reanimated/Components.tsx
import type { ReactNode } from "react"; import React from "react"; import { StyleSheet, Text, View } from "react-native"; export const Size = 20; export const Padding = 10; export const AnimationDemo: React.FC<{ title: string; children: ReactNode | ReactNode[]; }> = ({ title, children }) => { return ( <View...
6,881
0
petrpan-code/Shopify/react-native-skia/fabricexample/src/Examples
petrpan-code/Shopify/react-native-skia/fabricexample/src/Examples/Reanimated/InterpolationWithEasing.tsx
import React, { useEffect } from "react"; import { StyleSheet, useWindowDimensions } from "react-native"; import { Canvas, Circle, Fill } from "@shopify/react-native-skia"; import { useDerivedValue, useSharedValue, withRepeat, withTiming, Easing, } from "react-native-reanimated"; import { AnimationDemo, Size...
6,882
0
petrpan-code/Shopify/react-native-skia/fabricexample/src/Examples
petrpan-code/Shopify/react-native-skia/fabricexample/src/Examples/Reanimated/SimpleAnimation.tsx
import React, { useEffect } from "react"; import { StyleSheet, useWindowDimensions } from "react-native"; import { useDerivedValue, useSharedValue, withRepeat, withTiming, } from "react-native-reanimated"; import { Canvas, Fill, Rect } from "@shopify/react-native-skia"; import { AnimationDemo, Size } from "./C...
6,883
0
petrpan-code/Shopify/react-native-skia/fabricexample/src/Examples
petrpan-code/Shopify/react-native-skia/fabricexample/src/Examples/Reanimated/SpringBackTouch.tsx
import React from "react"; import { StyleSheet, useWindowDimensions } from "react-native"; import { Canvas, Circle, Fill, Line } from "@shopify/react-native-skia"; import { useDerivedValue, useSharedValue, withSpring, } from "react-native-reanimated"; import { GestureDetector, Gesture } from "react-native-gesture...
6,884
0
petrpan-code/Shopify/react-native-skia/fabricexample/src/Examples
petrpan-code/Shopify/react-native-skia/fabricexample/src/Examples/Reanimated/index.tsx
import React from "react"; import { StyleSheet } from "react-native"; import { ScrollView } from "react-native-gesture-handler"; import { AnimateTextOnPath } from "./AnimateTextOnPath"; import { AnimationWithTouchHandler } from "./AnimationWithTouchHandler"; import { BokehExample } from "./BokehExample"; import { Inte...
6,885
0
petrpan-code/Shopify/react-native-skia/fabricexample/src/Examples
petrpan-code/Shopify/react-native-skia/fabricexample/src/Examples/Severance/CRT.tsx
import { Group, Skia, RuntimeShader, Paint, vec, } from "@shopify/react-native-skia"; import type { ReactNode } from "react"; import React from "react"; import { useWindowDimensions } from "react-native"; const source = Skia.RuntimeEffect.Make(` uniform shader image; uniform vec2 resolution; vec2 curve(vec2...
6,886
0
petrpan-code/Shopify/react-native-skia/fabricexample/src/Examples
petrpan-code/Shopify/react-native-skia/fabricexample/src/Examples/Severance/Severance.tsx
import { Canvas, Fill, Group, useFont } from "@shopify/react-native-skia"; import React from "react"; import { useWindowDimensions, StyleSheet, View } from "react-native"; import { useSharedValue } from "react-native-reanimated"; import { Gesture, GestureDetector } from "react-native-gesture-handler"; import { useCloc...
6,887
0
petrpan-code/Shopify/react-native-skia/fabricexample/src/Examples
petrpan-code/Shopify/react-native-skia/fabricexample/src/Examples/Severance/Symbol.tsx
import type { SkFont, Vector } from "@shopify/react-native-skia"; import { interpolate, dist, vec, Group, Text, } from "@shopify/react-native-skia"; import React from "react"; import { useWindowDimensions } from "react-native"; import { useDerivedValue, type SharedValue } from "react-native-reanimated"; impo...
6,888
0
petrpan-code/Shopify/react-native-skia/fabricexample/src/Examples
petrpan-code/Shopify/react-native-skia/fabricexample/src/Examples/Severance/Theme.ts
export const BG = "#010A13"; export const FG = "rgb(171, 255, 233)";
6,889
0
petrpan-code/Shopify/react-native-skia/fabricexample/src/Examples
petrpan-code/Shopify/react-native-skia/fabricexample/src/Examples/Severance/index.ts
export * from "./Severance";
6,890
0
petrpan-code/Shopify/react-native-skia/fabricexample/src/Examples
petrpan-code/Shopify/react-native-skia/fabricexample/src/Examples/Stickers/GestureHandler.tsx
import type { SkMatrix, SkRect } from "@shopify/react-native-skia"; import { Skia } from "@shopify/react-native-skia"; import React from "react"; import { Gesture, GestureDetector } from "react-native-gesture-handler"; import type { SharedValue } from "react-native-reanimated"; import Animated, { useAnimatedStyle, ...
6,891
0
petrpan-code/Shopify/react-native-skia/fabricexample/src/Examples
petrpan-code/Shopify/react-native-skia/fabricexample/src/Examples/Stickers/HelloSticker.tsx
/* eslint-disable max-len */ import type { SkMatrix } from "@shopify/react-native-skia"; import { fitbox, Group, LinearGradient, Path, rect, Skia, } from "@shopify/react-native-skia"; import React from "react"; import type { SharedValue } from "react-native-reanimated"; const path = Skia.Path.MakeFromSVGSt...
6,892
0
petrpan-code/Shopify/react-native-skia/fabricexample/src/Examples
petrpan-code/Shopify/react-native-skia/fabricexample/src/Examples/Stickers/LocationSticker.tsx
/* eslint-disable max-len */ import React from "react"; import type { SkFont, SkMatrix } from "@shopify/react-native-skia"; import { Skia, vec, rrect, RoundedRect, Group, LinearGradient, Path, rect, Text, } from "@shopify/react-native-skia"; import type { SharedValue } from "react-native-reanimated"; ...
6,893
0
petrpan-code/Shopify/react-native-skia/fabricexample/src/Examples
petrpan-code/Shopify/react-native-skia/fabricexample/src/Examples/Stickers/MatrixHelpers.ts
import type { SkMatrix, Vector } from "@shopify/react-native-skia"; import { Skia, MatrixIndex } from "@shopify/react-native-skia"; export const scale = (matrix: SkMatrix, s: number, origin: Vector) => { "worklet"; const source = Skia.Matrix(matrix.get()); source.translate(origin.x, origin.y); source.scale(s, ...
6,894
0
petrpan-code/Shopify/react-native-skia/fabricexample/src/Examples
petrpan-code/Shopify/react-native-skia/fabricexample/src/Examples/Stickers/Picture.tsx
import type { SkMatrix, SkImage } from "@shopify/react-native-skia"; import { Group, Image, rect } from "@shopify/react-native-skia"; import React from "react"; import { Dimensions } from "react-native"; import type { SharedValue } from "react-native-reanimated"; const { width, height } = Dimensions.get("window"); exp...
6,895
0
petrpan-code/Shopify/react-native-skia/fabricexample/src/Examples
petrpan-code/Shopify/react-native-skia/fabricexample/src/Examples/Stickers/Stickers.tsx
import { Canvas, Skia, useFont, useImage } from "@shopify/react-native-skia"; import React from "react"; import { Dimensions, View } from "react-native"; import { useSharedValue } from "react-native-reanimated"; import { HelloSticker, HelloStickerDimensions } from "./HelloSticker"; import { LocationSticker, LocationSt...
6,896
0
petrpan-code/Shopify/react-native-skia/fabricexample/src/Examples
petrpan-code/Shopify/react-native-skia/fabricexample/src/Examples/Stickers/index.ts
export * from "./Stickers";
6,897
0
petrpan-code/Shopify/react-native-skia/fabricexample/src/Examples
petrpan-code/Shopify/react-native-skia/fabricexample/src/Examples/Transitions/Assets.ts
import { useImage } from "@shopify/react-native-skia"; export const useAssets = () => { const image1 = useImage(require("./assets/1.jpg")); const image2 = useImage(require("./assets/2.jpg")); const image3 = useImage(require("./assets/3.jpg")); const image4 = useImage(require("./assets/4.jpg")); const image5 ...
6,898
0
petrpan-code/Shopify/react-native-skia/fabricexample/src/Examples
petrpan-code/Shopify/react-native-skia/fabricexample/src/Examples/Transitions/Hue.tsx
import React from "react"; import { Dimensions } from "react-native"; import { Canvas, Fill, ImageShader, rect, useImage, } from "@shopify/react-native-skia"; import { HueRotation } from "./HueRotation"; const { width, height } = Dimensions.get("window"); export const Transitions = () => { const image = ...
6,899