Skip to content

Instantly share code, notes, and snippets.

View byteab's full-sized avatar
🏠
Working from home

Ehsan sarshar byteab

🏠
Working from home
View GitHub Profile
@byteab
byteab / hand-drawn-character-creator.html
Created August 17, 2026 15:28
Seeded procedural animated hand drawn like characters, Canvas2D brush strokes on a Three.js rig.
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Who are you?</title>
<link rel="preconnect" href="https://fonts.googleapis.com">
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
<link href="https://fonts.googleapis.com/css2?family=Patrick+Hand&display=swap" rel="stylesheet">
@byteab
byteab / BurningPhotoCard.tsx
Created August 3, 2026 16:27
Realistic burning paper effect. built with react-native
/**
* <BurningPhotoCard /> — a photo card printed on a sheet of paper that catches
* fire and burns away when you press Delete.
*
* Everything is in this one file: the WGSL shaders, the WebGPU burn simulation,
* the procedural paper grain, the Skia rasterizer that prints the card, and the
* React component. Drop it in your project and import it.
*
* ---------------------------------------------------------------------------
* INSTALL
@byteab
byteab / peel.tsx
Created July 24, 2026 23:46
text peel effect in react native
import MaskedView from '@react-native-masked-view/masked-view'
import { Stack } from 'expo-router'
import { useMemo } from 'react'
import { Platform, StyleSheet, Text, useWindowDimensions, View } from 'react-native'
import { Gesture, GestureDetector } from 'react-native-gesture-handler'
import Animated, {
cancelAnimation,
Easing,
useAnimatedStyle,
useDerivedValue,
@byteab
byteab / withBounce.tsx
Last active August 14, 2025 10:16
Achieve apple like spring motions with react native reanimated 3
import { withSpring } from 'react-native-reanimated'
export interface AppleSpringConfig {
duration?: number
bounciness?: number
velocity?: number
overshootClamping?: boolean
restSpeedThreshold?: number
restDisplacementThreshold?: number
}
@byteab
byteab / ReactNativeResponsiveUtilities.ts
Last active September 1, 2022 11:36
React Native Responsive Utility Functions
import { Dimensions } from 'react-native';
const { height: screenHeight, width: screenWidth } = Dimensions.get('window');
const EACH_HEIGHT_UNIT = screenHeight / 100
const EACH_WIDTH_UNIT = screenWidth / 100
/**
* device height percentage
*/
@byteab
byteab / middleware.ts
Last active June 3, 2021 16:31
persist middleware catch implemented correctly
import {
GetState,
PartialState,
SetState,
State,
StateCreator,
StoreApi,
} from './vanilla'
export const redux = <S extends State, A extends { type: unknown }>(