Skip to content

Instantly share code, notes, and snippets.

View mattThousand's full-sized avatar
👨‍🚀

Matt Buckley mattThousand

👨‍🚀
View GitHub Profile
import React, { FunctionComponent } from 'react';
import { View, StyleSheet, Dimensions, Animated, Easing } from 'react-native';
import Svg, { Path, Rect } from 'react-native-svg';
const { width, height } = Dimensions.get('screen');
const AnimatedChart: FunctionComponent = () => {
const AnimatedRect = Animated.createAnimatedComponent(Rect);
const animatedVal = React.useRef(new Animated.Value(0)).current;
@mattThousand
mattThousand / CustomPageControlWithProgrammaticPagination.tsx.tsx
Created January 23, 2021 18:52
Tapping an individual dot animates the flatlist's scroll position.
import React, {FunctionComponent, useRef} from 'react';
import {
Animated,
Dimensions,
FlatList,
Image,
Pressable,
StyleSheet,
View,
} from 'react-native';
import { BlurView } from 'expo-blur';
import React, { FunctionComponent, useEffect, useState } from 'react';
import { View, StyleSheet, Dimensions, Animated, Pressable, Text, Easing } from 'react-native';
import { LinearGradient } from 'expo-linear-gradient';
const { width, height } = Dimensions.get('screen');
const BreathAnimation: FunctionComponent = () => {
const animatedScale = React.useRef(new Animated.Value(1)).current;
const animatedLeftText = React.useRef(new Animated.Value(10)).current;
import { BlurView } from 'expo-blur';
import React, { FunctionComponent, useEffect } from 'react';
import { View, StyleSheet, Dimensions, Animated, Pressable, Easing, Text } from 'react-native';
import { LinearGradient } from 'expo-linear-gradient';
const { width, height } = Dimensions.get('screen');
const BreathAnimation: FunctionComponent = () => {
const animatedScale = React.useRef(new Animated.Value(1)).current;
const animatedTextScale = React.useRef(new Animated.Value(1)).current;
import React, {FunctionComponent, useEffect} from 'react';
import {Animated, Dimensions, FlatList, StyleSheet, View} from 'react-native';
const {width} = Dimensions.get('screen');
const AnimatedProgress: FunctionComponent = () => {
return (
<FlatList
contentContainerStyle={style.contentContainer}
data={[1, 2, 3, 4, 5]}
import React, {FunctionComponent, useRef} from 'react';
import {
Animated,
Dimensions,
FlatList,
Image,
StyleSheet,
View,
} from 'react-native';
import { BlurView } from 'expo-blur';
import React, { FunctionComponent, useEffect, useState } from 'react';
import { View, StyleSheet, Dimensions, Animated, Pressable, Text, Easing } from 'react-native';
import { LinearGradient } from 'expo-linear-gradient';
const { width, height } = Dimensions.get('screen');
const BreathAnimation: FunctionComponent = () => {
const animatedScale = React.useRef(new Animated.Value(1)).current;
const animatedLeftText = React.useRef(new Animated.Value(10)).current;
import React, {FunctionComponent, useEffect, useRef} from 'react';
import {View, StyleSheet, Pressable, Text, Animated} from 'react-native';
const SpringButton: FunctionComponent = () => {
const animatedScale = useRef(new Animated.Value(0)).current;
useEffect(() => {
animatedScale.setValue(1);
}, []);
import SwiftUI
struct PaginatedView<Page: View & Identifiable>: View {
@State private var totalOffset: CGFloat = 0
@State private var pageOffset: CGFloat = 0
@State private var currentPageIndex: Int = 0
var pages: [Page]
var spacing: CGFloat
var body: some View {