This React component mimics the LED signage moving text display.
You can customize the color, size, length and speed.
Currently, it only supports alphanumeric characters but can be easily extended.
This is a fun coding exercise in time for the holiday!
import DotText from './components/DotText'
const HolidayGreetings = () => {
return (
<div style={styles.container}>
<DotText
text="Merry Christmas and Happy New Year"
play={true}
length={60}
/>
</div>
)
}
const styles = {
container: {
position: 'relative',
height: '100vh',
display: 'flex',
justifyContent: 'center',
alignItems: 'center',
}
}
export default HolidayGreetingsThis React project is bootstrapped using Vite.
$ npm create vite@latestTo successfully install Storybook in a React+Vite project, please use the command below:
$ npx sb@next init --builder=viteThe explanation is written in this blog post.).
Clone the repository, install the dependencies and run
$ git clone https://github.com/supershaneski/react-moving-dottext.git myproject
$ cd myproject
$ npm install
$ npm startOpen your browser to http://localhost:5173/ or some other port depending on the availability.
To run Storybook
$ npm run storybookYour browser will open to http://localhost:6006.
