This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React, {useState} from 'react'; | |
import { | |
Alert, | |
PanResponder, | |
StyleSheet, | |
Text, | |
useWindowDimensions, | |
View, | |
} from 'react-native'; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React, {useState} from 'react'; | |
import { | |
Alert, | |
PanResponder, | |
StyleSheet, | |
Text, | |
useWindowDimensions, | |
View, | |
} from 'react-native'; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React, { | |
ReactNode, | |
useRef, | |
useEffect, | |
useCallback, | |
useState, | |
} from 'react'; | |
import { | |
View, | |
Text, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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, { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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을 배열로 변환 |