Created
October 1, 2019 16:05
-
-
Save kitze/105401aab774ce945dfa8e5693e74e26 to your computer and use it in GitHub Desktop.
AnimatedTitle
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 { Reveal } from 'styles/reveal'; | |
import * as T from 'styles/shared-components/text'; | |
//styles | |
import * as S from './styles'; | |
import * as A from 'styles/shared-components'; | |
import * as L from 'layout-styled-components'; | |
const AnimatedTitle: React.FC<{ size?: number }> = ({ children='', size = 50 }) => { | |
return ( | |
<S.AnimatedTitle> | |
<L.Horizontal wrap center spaceAll={8}> | |
{(children as string).split(' ').map((word, index) => ( | |
<Reveal delay={index * 100}> | |
<S.Text bold size={size}> | |
{word} | |
</S.Text> | |
</Reveal> | |
))} | |
</L.Horizontal> | |
</S.AnimatedTitle> | |
); | |
}; | |
export default AnimatedTitle; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment