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/example/src/Examples/API | petrpan-code/Shopify/react-native-skia/example/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,600 |
0 | petrpan-code/Shopify/react-native-skia/example/src/Examples/API/components | petrpan-code/Shopify/react-native-skia/example/src/Examples/API/components/drawings/backface.tsx | 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;
const scale = 0.6;
const str... | 6,601 |
0 | petrpan-code/Shopify/react-native-skia/example/src/Examples | petrpan-code/Shopify/react-native-skia/example/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,602 |
0 | petrpan-code/Shopify/react-native-skia/example/src/Examples | petrpan-code/Shopify/react-native-skia/example/src/Examples/Aurora/index.ts | export * from "./Aurora";
| 6,603 |
0 | petrpan-code/Shopify/react-native-skia/example/src/Examples/Aurora | petrpan-code/Shopify/react-native-skia/example/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,604 |
0 | petrpan-code/Shopify/react-native-skia/example/src/Examples/Aurora | petrpan-code/Shopify/react-native-skia/example/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,
useClock,
} from "@shopify/react-native-skia";
import { View, useWindowDimensions, StyleSheet } from "react-nativ... | 6,605 |
0 | petrpan-code/Shopify/react-native-skia/example/src/Examples/Aurora | petrpan-code/Shopify/react-native-skia/example/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,606 |
0 | petrpan-code/Shopify/react-native-skia/example/src/Examples/Aurora | petrpan-code/Shopify/react-native-skia/example/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,607 |
0 | petrpan-code/Shopify/react-native-skia/example/src/Examples/Aurora | petrpan-code/Shopify/react-native-skia/example/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,608 |
0 | petrpan-code/Shopify/react-native-skia/example/src/Examples/Aurora | petrpan-code/Shopify/react-native-skia/example/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,609 |
0 | petrpan-code/Shopify/react-native-skia/example/src/Examples | petrpan-code/Shopify/react-native-skia/example/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,610 |
0 | petrpan-code/Shopify/react-native-skia/example/src/Examples | petrpan-code/Shopify/react-native-skia/example/src/Examples/Breathe/index.ts | export { Breathe } from "./Breathe";
| 6,611 |
0 | petrpan-code/Shopify/react-native-skia/example/src/Examples | petrpan-code/Shopify/react-native-skia/example/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,612 |
0 | petrpan-code/Shopify/react-native-skia/example/src/Examples | petrpan-code/Shopify/react-native-skia/example/src/Examples/Filters/index.tsx | export { Filters } from "./Filters";
| 6,613 |
0 | petrpan-code/Shopify/react-native-skia/example/src/Examples | petrpan-code/Shopify/react-native-skia/example/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,614 |
0 | petrpan-code/Shopify/react-native-skia/example/src/Examples | petrpan-code/Shopify/react-native-skia/example/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,615 |
0 | petrpan-code/Shopify/react-native-skia/example/src/Examples | petrpan-code/Shopify/react-native-skia/example/src/Examples/Glassmorphism/index.ts | export * from "./Glassmorphism";
| 6,616 |
0 | petrpan-code/Shopify/react-native-skia/example/src/Examples/Glassmorphism | petrpan-code/Shopify/react-native-skia/example/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,617 |
0 | petrpan-code/Shopify/react-native-skia/example/src/Examples/Glassmorphism | petrpan-code/Shopify/react-native-skia/example/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,618 |
0 | petrpan-code/Shopify/react-native-skia/example/src/Examples | petrpan-code/Shopify/react-native-skia/example/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,619 |
0 | petrpan-code/Shopify/react-native-skia/example/src/Examples | petrpan-code/Shopify/react-native-skia/example/src/Examples/Gooey/index.ts | export * from "./Gooey";
| 6,620 |
0 | petrpan-code/Shopify/react-native-skia/example/src/Examples/Gooey | petrpan-code/Shopify/react-native-skia/example/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,621 |
0 | petrpan-code/Shopify/react-native-skia/example/src/Examples/Gooey | petrpan-code/Shopify/react-native-skia/example/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,622 |
0 | petrpan-code/Shopify/react-native-skia/example/src/Examples/Gooey | petrpan-code/Shopify/react-native-skia/example/src/Examples/Gooey/components/Theme.ts | export const BG = "lightblue";
export const FG = "#ade6bb";
| 6,623 |
0 | petrpan-code/Shopify/react-native-skia/example/src/Examples | petrpan-code/Shopify/react-native-skia/example/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,624 |
0 | petrpan-code/Shopify/react-native-skia/example/src/Examples | petrpan-code/Shopify/react-native-skia/example/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,625 |
0 | petrpan-code/Shopify/react-native-skia/example/src/Examples | petrpan-code/Shopify/react-native-skia/example/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,626 |
0 | petrpan-code/Shopify/react-native-skia/example/src/Examples | petrpan-code/Shopify/react-native-skia/example/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,627 |
0 | petrpan-code/Shopify/react-native-skia/example/src/Examples | petrpan-code/Shopify/react-native-skia/example/src/Examples/Graphs/types.ts | export type GraphProps = {
height: number;
width: number;
};
| 6,628 |
0 | petrpan-code/Shopify/react-native-skia/example/src/Examples | petrpan-code/Shopify/react-native-skia/example/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,629 |
0 | petrpan-code/Shopify/react-native-skia/example/src/Examples | petrpan-code/Shopify/react-native-skia/example/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,630 |
0 | petrpan-code/Shopify/react-native-skia/example/src/Examples | petrpan-code/Shopify/react-native-skia/example/src/Examples/Hue/index.ts | export { Hue } from "./Hue";
| 6,631 |
0 | petrpan-code/Shopify/react-native-skia/example/src/Examples | petrpan-code/Shopify/react-native-skia/example/src/Examples/Matrix/Matrix.tsx | import {
BlurMask,
Canvas,
Fill,
Group,
useClock,
useFont,
} from "@shopify/react-native-skia";
import React from "react";
import { useWindowDimensions } from "react-native";
import { COLS, ROWS, Symbol } from "./Symbol";
const cols = new Array(COLS).fill(0).map((_, i) => i);
const rows = new Array(ROWS).... | 6,632 |
0 | petrpan-code/Shopify/react-native-skia/example/src/Examples | petrpan-code/Shopify/react-native-skia/example/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,633 |
0 | petrpan-code/Shopify/react-native-skia/example/src/Examples | petrpan-code/Shopify/react-native-skia/example/src/Examples/Matrix/index.ts | export { Matrix } from "./Matrix";
| 6,634 |
0 | petrpan-code/Shopify/react-native-skia/example/src/Examples | petrpan-code/Shopify/react-native-skia/example/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,635 |
0 | petrpan-code/Shopify/react-native-skia/example/src/Examples | petrpan-code/Shopify/react-native-skia/example/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,636 |
0 | petrpan-code/Shopify/react-native-skia/example/src/Examples | petrpan-code/Shopify/react-native-skia/example/src/Examples/Neumorphism/index.ts | export { Neumorphism } from "./Elements";
| 6,637 |
0 | petrpan-code/Shopify/react-native-skia/example/src/Examples/Neumorphism | petrpan-code/Shopify/react-native-skia/example/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,638 |
0 | petrpan-code/Shopify/react-native-skia/example/src/Examples/Neumorphism | petrpan-code/Shopify/react-native-skia/example/src/Examples/Neumorphism/Dashboard/index.ts | export * from "./Dashboard";
| 6,639 |
0 | petrpan-code/Shopify/react-native-skia/example/src/Examples/Neumorphism/Dashboard | petrpan-code/Shopify/react-native-skia/example/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,640 |
0 | petrpan-code/Shopify/react-native-skia/example/src/Examples/Neumorphism/Dashboard | petrpan-code/Shopify/react-native-skia/example/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,641 |
0 | petrpan-code/Shopify/react-native-skia/example/src/Examples/Neumorphism/Dashboard | petrpan-code/Shopify/react-native-skia/example/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,642 |
0 | petrpan-code/Shopify/react-native-skia/example/src/Examples/Neumorphism/Dashboard | petrpan-code/Shopify/react-native-skia/example/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,643 |
0 | petrpan-code/Shopify/react-native-skia/example/src/Examples/Neumorphism/Dashboard | petrpan-code/Shopify/react-native-skia/example/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,644 |
0 | petrpan-code/Shopify/react-native-skia/example/src/Examples/Neumorphism/Dashboard | petrpan-code/Shopify/react-native-skia/example/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,645 |
0 | petrpan-code/Shopify/react-native-skia/example/src/Examples/Neumorphism/Dashboard | petrpan-code/Shopify/react-native-skia/example/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,646 |
0 | petrpan-code/Shopify/react-native-skia/example/src/Examples/Neumorphism/Dashboard/components | petrpan-code/Shopify/react-native-skia/example/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,647 |
0 | petrpan-code/Shopify/react-native-skia/example/src/Examples/Neumorphism/Dashboard/components | petrpan-code/Shopify/react-native-skia/example/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,648 |
0 | petrpan-code/Shopify/react-native-skia/example/src/Examples/Neumorphism/Dashboard/components | petrpan-code/Shopify/react-native-skia/example/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,649 |
0 | petrpan-code/Shopify/react-native-skia/example/src/Examples/Neumorphism/Dashboard/components | petrpan-code/Shopify/react-native-skia/example/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,650 |
0 | petrpan-code/Shopify/react-native-skia/example/src/Examples/Neumorphism/Dashboard/components | petrpan-code/Shopify/react-native-skia/example/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,651 |
0 | petrpan-code/Shopify/react-native-skia/example/src/Examples/Neumorphism/Dashboard/components | petrpan-code/Shopify/react-native-skia/example/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,652 |
0 | petrpan-code/Shopify/react-native-skia/example/src/Examples/Neumorphism | petrpan-code/Shopify/react-native-skia/example/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,653 |
0 | petrpan-code/Shopify/react-native-skia/example/src/Examples/Neumorphism | petrpan-code/Shopify/react-native-skia/example/src/Examples/Neumorphism/Elements/index.ts | export * from "./Elements";
| 6,654 |
0 | petrpan-code/Shopify/react-native-skia/example/src/Examples/Neumorphism/Elements | petrpan-code/Shopify/react-native-skia/example/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,655 |
0 | petrpan-code/Shopify/react-native-skia/example/src/Examples/Neumorphism/Elements | petrpan-code/Shopify/react-native-skia/example/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,656 |
0 | petrpan-code/Shopify/react-native-skia/example/src/Examples/Neumorphism/Elements | petrpan-code/Shopify/react-native-skia/example/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,657 |
0 | petrpan-code/Shopify/react-native-skia/example/src/Examples/Neumorphism/Elements | petrpan-code/Shopify/react-native-skia/example/src/Examples/Neumorphism/Elements/components/Theme.ts | export const Theme = {
white1: "#F0F0F3",
white2: "#EEEEEE",
};
| 6,658 |
0 | petrpan-code/Shopify/react-native-skia/example/src/Examples | petrpan-code/Shopify/react-native-skia/example/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,659 |
0 | petrpan-code/Shopify/react-native-skia/example/src/Examples | petrpan-code/Shopify/react-native-skia/example/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,660 |
0 | petrpan-code/Shopify/react-native-skia/example/src/Examples | petrpan-code/Shopify/react-native-skia/example/src/Examples/Performance/index.ts | export { PerformanceDrawingTest } from "./PerformanceRects";
//export { PerformanceDrawingTest } from "./PerformanceCanvases";
| 6,661 |
0 | petrpan-code/Shopify/react-native-skia/example/src/Examples | petrpan-code/Shopify/react-native-skia/example/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,662 |
0 | petrpan-code/Shopify/react-native-skia/example/src/Examples | petrpan-code/Shopify/react-native-skia/example/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,663 |
0 | petrpan-code/Shopify/react-native-skia/example/src/Examples | petrpan-code/Shopify/react-native-skia/example/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,664 |
0 | petrpan-code/Shopify/react-native-skia/example/src/Examples | petrpan-code/Shopify/react-native-skia/example/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,665 |
0 | petrpan-code/Shopify/react-native-skia/example/src/Examples | petrpan-code/Shopify/react-native-skia/example/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,666 |
0 | petrpan-code/Shopify/react-native-skia/example/src/Examples | petrpan-code/Shopify/react-native-skia/example/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,667 |
0 | petrpan-code/Shopify/react-native-skia/example/src/Examples | petrpan-code/Shopify/react-native-skia/example/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,668 |
0 | petrpan-code/Shopify/react-native-skia/example/src/Examples | petrpan-code/Shopify/react-native-skia/example/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,669 |
0 | petrpan-code/Shopify/react-native-skia/example/src/Examples | petrpan-code/Shopify/react-native-skia/example/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,670 |
0 | petrpan-code/Shopify/react-native-skia/example/src/Examples | petrpan-code/Shopify/react-native-skia/example/src/Examples/Severance/Severance.tsx | import {
Canvas,
Fill,
Group,
useClock,
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-handle... | 6,671 |
0 | petrpan-code/Shopify/react-native-skia/example/src/Examples | petrpan-code/Shopify/react-native-skia/example/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,672 |
0 | petrpan-code/Shopify/react-native-skia/example/src/Examples | petrpan-code/Shopify/react-native-skia/example/src/Examples/Severance/Theme.ts | export const BG = "#010A13";
export const FG = "rgb(171, 255, 233)";
| 6,673 |
0 | petrpan-code/Shopify/react-native-skia/example/src/Examples | petrpan-code/Shopify/react-native-skia/example/src/Examples/Severance/index.ts | export * from "./Severance";
| 6,674 |
0 | petrpan-code/Shopify/react-native-skia/example/src/Examples | petrpan-code/Shopify/react-native-skia/example/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,675 |
0 | petrpan-code/Shopify/react-native-skia/example/src/Examples | petrpan-code/Shopify/react-native-skia/example/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,676 |
0 | petrpan-code/Shopify/react-native-skia/example/src/Examples | petrpan-code/Shopify/react-native-skia/example/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,677 |
0 | petrpan-code/Shopify/react-native-skia/example/src/Examples | petrpan-code/Shopify/react-native-skia/example/src/Examples/Stickers/MatrixHelpers.ts | import type { SkMatrix, Vector } from "@shopify/react-native-skia";
import { MatrixIndex, notifyChange } from "@shopify/react-native-skia";
import type { SharedValue } from "react-native-reanimated";
export const scale = (
matrix: SharedValue<SkMatrix>,
offset: SkMatrix,
s: number,
origin: Vector
) => {
"wor... | 6,678 |
0 | petrpan-code/Shopify/react-native-skia/example/src/Examples | petrpan-code/Shopify/react-native-skia/example/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,679 |
0 | petrpan-code/Shopify/react-native-skia/example/src/Examples | petrpan-code/Shopify/react-native-skia/example/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,680 |
0 | petrpan-code/Shopify/react-native-skia/example/src/Examples | petrpan-code/Shopify/react-native-skia/example/src/Examples/Stickers/index.ts | export * from "./Stickers";
| 6,681 |
0 | petrpan-code/Shopify/react-native-skia/example/src/Examples | petrpan-code/Shopify/react-native-skia/example/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,682 |
0 | petrpan-code/Shopify/react-native-skia/example/src/Examples | petrpan-code/Shopify/react-native-skia/example/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,683 |
0 | petrpan-code/Shopify/react-native-skia/example/src/Examples | petrpan-code/Shopify/react-native-skia/example/src/Examples/Transitions/HueRotation.tsx | import { Shader, Skia } from "@shopify/react-native-skia";
import type { ReactNode } from "react";
import React, { useEffect } from "react";
import {
useDerivedValue,
useSharedValue,
withRepeat,
withTiming,
} from "react-native-reanimated";
import { Dimensions } from "react-native";
const { width, height } = D... | 6,684 |
0 | petrpan-code/Shopify/react-native-skia/example/src/Examples | petrpan-code/Shopify/react-native-skia/example/src/Examples/Transitions/Math.ts | export const snapPoint = (
value: number,
velocity: number,
points: ReadonlyArray<number>
): number => {
"worklet";
const point = value + 0.2 * velocity;
const deltas = points.map((p) => Math.abs(point - p));
const minDelta = Math.min.apply(null, deltas);
return points.filter((p) => Math.abs(point - p) ... | 6,685 |
0 | petrpan-code/Shopify/react-native-skia/example/src/Examples | petrpan-code/Shopify/react-native-skia/example/src/Examples/Transitions/Transitions.tsx | import React, { useCallback, useMemo } from "react";
import { Dimensions, View } from "react-native";
import { Gesture, GestureDetector } from "react-native-gesture-handler";
import {
runOnJS,
useDerivedValue,
useSharedValue,
withTiming,
} from "react-native-reanimated";
import {
Canvas,
Fill,
ImageShader... | 6,686 |
0 | petrpan-code/Shopify/react-native-skia/example/src/Examples | petrpan-code/Shopify/react-native-skia/example/src/Examples/Transitions/index.ts | export * from "./Transitions";
| 6,687 |
0 | petrpan-code/Shopify/react-native-skia/example/src/Examples/Transitions | petrpan-code/Shopify/react-native-skia/example/src/Examples/Transitions/transitions/Base.ts | import { frag } from "../../../components/ShaderLib";
export type Transition = string;
export const transition = (t: Transition) => {
return frag`
uniform shader image1;
uniform shader image2;
uniform float progress;
uniform float2 resolution;
half4 getFromColor(float2 uv) {
return image1.eval(uv ... | 6,688 |
0 | petrpan-code/Shopify/react-native-skia/example/src/Examples/Transitions | petrpan-code/Shopify/react-native-skia/example/src/Examples/Transitions/transitions/cube.ts | import { glsl } from "../../../components/ShaderLib";
import type { Transition } from "./Base";
export const cube: Transition = glsl`
// Author: gre
// License: MIT
const float persp = 0.7;
const float unzoom = 0.3;
const float reflection = 0.4;
const float floating = 3.0;
vec2 project (vec2 p) {
return p * vec2(1... | 6,689 |
0 | petrpan-code/Shopify/react-native-skia/example/src/Examples/Transitions | petrpan-code/Shopify/react-native-skia/example/src/Examples/Transitions/transitions/glitchMemories.ts | /* eslint-disable max-len */
import { glsl } from "../../../components/ShaderLib";
import type { Transition } from "./Base";
export const glitchMemories: Transition = glsl`
vec4 transition(vec2 p) {
vec2 block = floor(p.xy / vec2(16));
vec2 uv_noise = block / vec2(64);
uv_noise += floor(vec2(progress) * vec2(12... | 6,690 |
0 | petrpan-code/Shopify/react-native-skia/example/src/Examples/Transitions | petrpan-code/Shopify/react-native-skia/example/src/Examples/Transitions/transitions/index.ts | export * from "./Base";
export * from "./linear";
export * from "./glitchMemories";
export * from "./waterDrops";
export * from "./swirl";
export * from "./cube";
export * from "./swap";
export * from "./pageCurl";
| 6,691 |
0 | petrpan-code/Shopify/react-native-skia/example/src/Examples/Transitions | petrpan-code/Shopify/react-native-skia/example/src/Examples/Transitions/transitions/linear.ts | import { glsl } from "../../../components/ShaderLib";
import type { Transition } from "./Base";
export const linear: Transition = glsl`
vec4 transition(vec2 uv) {
return mix(
getFromColor(uv),
getToColor(uv),
progress
);
}
`;
| 6,692 |
0 | petrpan-code/Shopify/react-native-skia/example/src/Examples/Transitions | petrpan-code/Shopify/react-native-skia/example/src/Examples/Transitions/transitions/pageCurl.ts | /* eslint-disable max-len */
import { glsl } from "../../../components/ShaderLib";
import type { Transition } from "./Base";
export const pageCurl: Transition = glsl`
// author: Hewlett-Packard
// license: BSD 3 Clause
// Adapted by Sergey Kosarevsky from:
// http://rectalogic.github.io/webvfx/examples_2transition-s... | 6,693 |
0 | petrpan-code/Shopify/react-native-skia/example/src/Examples/Transitions | petrpan-code/Shopify/react-native-skia/example/src/Examples/Transitions/transitions/swap.ts | /* eslint-disable max-len */
import { glsl } from "../../../components/ShaderLib";
import type { Transition } from "./Base";
export const swap: Transition = glsl`
const float reflection1 = 0.4;
const float perspective = 0.2;
const float depth = 3.0;
const vec4 black = vec4(0.0, 0.0, 0.0, 1.0);
const vec2 boundMin ... | 6,694 |
0 | petrpan-code/Shopify/react-native-skia/example/src/Examples/Transitions | petrpan-code/Shopify/react-native-skia/example/src/Examples/Transitions/transitions/swirl.ts | import { glsl } from "../../../components/ShaderLib";
import type { Transition } from "./Base";
export const swirl: Transition = glsl`
vec4 transition(vec2 UV) {
float Radius = 1.0;
float T = progress;
UV -= vec2( 0.5, 0.5 );
float Dist = length(UV);
if ( Dist < Radius )
{
float Percent = (Radius - Dist) ... | 6,695 |
0 | petrpan-code/Shopify/react-native-skia/example/src/Examples/Transitions | petrpan-code/Shopify/react-native-skia/example/src/Examples/Transitions/transitions/waterDrops.ts | import { glsl } from "../../../components/ShaderLib/Tags";
import type { Transition } from "./Base";
export const waterDrops: Transition = glsl`
const float amplitude = 30;
const float speed = 30;
vec4 transition(vec2 p) {
vec2 dir = p - vec2(.5);
float dist = length(dir);
if (dist > progress) {
return mi... | 6,696 |
0 | petrpan-code/Shopify/react-native-skia/example/src/Examples | petrpan-code/Shopify/react-native-skia/example/src/Examples/Vertices/Triangles.tsx | import type { Vector } from "@shopify/react-native-skia";
import { Path } from "@shopify/react-native-skia";
import React from "react";
import type { SharedValue } from "react-native-reanimated";
import { useDerivedValue } from "react-native-reanimated";
const f = ({ x, y }: Vector) => [x, y].join(",");
interface Tri... | 6,697 |
0 | petrpan-code/Shopify/react-native-skia/example/src/Examples | petrpan-code/Shopify/react-native-skia/example/src/Examples/Vertices/Vertices.tsx | import React, { useMemo } from "react";
import { useWindowDimensions } from "react-native";
import cdt2d from "cdt2d";
import {
Canvas,
vec,
Vertices,
Skia,
isEdge,
useClock,
} from "@shopify/react-native-skia";
import { useDerivedValue } from "react-native-reanimated";
import { getSeed, perlin } from "../... | 6,698 |
0 | petrpan-code/Shopify/react-native-skia/example/src/Examples | petrpan-code/Shopify/react-native-skia/example/src/Examples/Vertices/cdt2d.d.ts | declare module "cdt2d" {
// eslint-disable-next-line import/no-default-export
export default function (
vertices: [number, number][]
): [number, number, number][];
}
| 6,699 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.