亚洲国产日韩欧美一区二区三区,精品亚洲国产成人av在线,国产99视频精品免视看7,99国产精品久久久久久久成人热,欧美日韩亚洲国产综合乱

React ? ??? CSS? ???? Apple ????? ??
P粉729436537
P粉729436537 2024-01-10 17:08:30
0
1
536

?? HTML? CSS, ??? ???? TypeScript? ???? React?? ? ?????? ?? ???? ???. ??? ??? ??? ??? ??? ?? ??? ???? ?????. ??? ?????. ???? ????. ?? ? ???? ??? ? ??????. ???? ???? ?? ? ???? ?? ? ????.

??? ?? ?? ????? ??? ?? Codepen ?????: Apple Animation

??? ? ?????

import React from 'react';

const styles = {
    
    '@keyframes showTopText': {
        '0%': { transform: 'translate3d(0, 100%, 0)' },
        '40%, 60%': { transform: 'translate3d(0, 50%, 0)' },
        '100%': { transform: 'translate3d(0, 0, 0)' },
    },
    '@keyframes showBottomText': {
        '0%': { transform: 'translate3d(0, -100%, 0)' },
        '100%': { transform: 'translate3d(0, 0, 0)' },
    },

    animatedTitle: {
        color: '#222',
        fontFamily: 'Roboto, Arial, sans-serif',
        height: '90vmin',
        left: '50%',
        top: '50%',
        transform: 'translate(-50%, -50%)',
        width: '90vmin',
    },
    'animatedTitle > div': {
        height: '50%',
        overflow: 'hidden',
        position: 'absolute',
        width: '100%',
    },
    'animatedTitle > div div': {
        fontSize: '12vmin',
        padding: '2vmin 0',
        position: 'absolute',
    },
    'animatedTitle > div div span': {
        display: 'block',
    },
    'animated-title > div.text-top': {
        borderBottom: '1vmin solid #000',
        top: 0,
    },
    'animatedTitle > div.text-top div': {
        animation: 'showTopText 1s',
        animationDelay: '0.5s',
        animationFillMode: 'forwards',
        bottom: 0,
        transform: 'translate(0, 100%)',
    },
    'animatedTitle > div.text-top div span:first-child': {
        color: '#767676',
    },
    'animatedTitle > div.text-bottom': {
        bottom: 0,
    },
    'animatedTitle > div.text-bottom div': {
        animation: 'showBottomText 0.5s',
        animationDelay: '1.75s',
        animationFillMode: 'forwards',
        top: 0,
        transform: 'translate(0, -100%)',
    },
};

function Design() {
    return (
        <div style={styles.animatedTitle}>
            <div style={styles['animatedTitle > div.text-top div']}>
                <div>
                    <span>mimicking</span>
                    <span>apple's design</span>
                </div>
            </div>
            <div style={styles['animatedTitle > div.text-bottom']}>
                <div>for the win!</div>
            </div>
        </div>
    );
}

export { Design };

P粉729436537
P粉729436537

?? ??(1)
P粉115840076

styled-components 來(lái)使您的組件更靈活和兼容。我使用 styled-componentscodepen ??? ???? ?? ??? ? ?? ? ??? ? ? ????.

??? TopAnimateBlock ? BottomAnimateBlock?? ?? ?? ??? ? ?? ??? ???? TopAnimateBlockBottomAnimateBlock 都有 numOfLine 屬性,表示塊內(nèi)有多少行。在 BottomAnimateBlock 中的第二個(gè)屬性是 delayTopLine,它應(yīng)該與 TopAnimateBlocknumOfLine ??? ????. BottomAnimateBlock? ? ?? ??? delayTopLine

??, ? ? ?? ??? ??? ???? ?? ??? TopAnimateBlock?

numOfLineTextStyle ?? ???? ???. ?? ? color ??? ?? ??? ??? ?? ??? ? ??? ?? ?, HEX ?? ?? rgba()

/

hsla()

? ??? ? ????.

TextAnimation.tsx ???

  1. 2? ?? 3?? ?????? ????? ??? ??/?????. TextStyle
  2. ? TopAnimateBlock 中將 numOfLine 從2更改為3,在 BottomAnimateBlock ???? ?? TopAnimateBlock??
  3. numOfLine
  4. ? 2?? 3?? ???? BottomAnimateBlock??
  5. delayTopLine
? 2?? 3???? ??????. ??????? ?? ???? ?????. ?? ?? ???