Skip to content

Instantly share code, notes, and snippets.

import React, {useState} from 'react';
import {
Alert,
PanResponder,
StyleSheet,
Text,
useWindowDimensions,
View,
} from 'react-native';
import React from 'react';
import {StyleSheet, Text, View} from 'react-native';
function LinearScore({score}: {score: number}) {
return (
<View style={styles.container}>
<View style={[styles.progress, {width: `${score}%`}]} />
<View
style={[
styles.scoreBox,
import React, {useState} from 'react';
import {
Alert,
PanResponder,
StyleSheet,
Text,
useWindowDimensions,
View,
} from 'react-native';
import React, {
ReactNode,
useRef,
useEffect,
useCallback,
useState,
} from 'react';
import {
View,
Text,
import React, {ReactNode, useRef, useState} from 'react';
import {View, StyleSheet, Animated, TouchableOpacity, Text} from 'react-native';
const FlipTile = ({children}: {children: ReactNode[]}) => {
const flipAnim = useRef(new Animated.Value(0)).current;
const [isFlipped, setIsFlipped] = useState(false);
const [isVerticalFlip, setIsVerticalFlip] = useState(true); // 플립 방향을 제어하는 상태
const flip = () => {
Animated.timing(flipAnim, {
import React, {useRef, useState, ReactNode} from 'react';
import {View, Animated, TouchableOpacity, Text} from 'react-native';
function ScaleBox({children}: {children: ReactNode}) {
const [currentElement, setCurrentElement] = useState(0); // 현재 보이는 요소를 추적하는 상태
const scaleAnim = useRef(new Animated.Value(1)).current; // 초기 크기 1로 설정
const opacityAnim = useRef(new Animated.Value(1)).current; // 초기 투명도 1로 설정
const elementsArray = React.Children.toArray(children); // children을 배열로 변환