mirror of
https://github.com/remvze/moodist.git
synced 2025-12-17 00:44:14 +00:00
feat: add binary animation
This commit is contained in:
parent
29bebb3ec7
commit
699f49bfa3
2 changed files with 19 additions and 5 deletions
17
src/components/binary.tsx
Normal file
17
src/components/binary.tsx
Normal file
|
|
@ -0,0 +1,17 @@
|
|||
import { useState, useEffect } from 'react';
|
||||
|
||||
import { generateRandomBinaryString } from '@/helpers/binary';
|
||||
|
||||
export function Binary() {
|
||||
const [binary, setBinary] = useState('');
|
||||
|
||||
useEffect(() => {
|
||||
setBinary(generateRandomBinaryString(1000));
|
||||
|
||||
setInterval(() => {
|
||||
setBinary(generateRandomBinaryString(1000));
|
||||
}, 200);
|
||||
}, []);
|
||||
|
||||
return <span>{binary}</span>;
|
||||
}
|
||||
|
|
@ -3,10 +3,7 @@ import { FaGithub } from 'react-icons/fa/index';
|
|||
|
||||
import { SpecialButton } from './special-button';
|
||||
import { Container } from './container';
|
||||
|
||||
import { generateRandomBinaryString } from '@/helpers/binary';
|
||||
|
||||
const binary = generateRandomBinaryString(1000);
|
||||
import { Binary } from './binary';
|
||||
---
|
||||
|
||||
<div class="source">
|
||||
|
|
@ -28,7 +25,7 @@ const binary = generateRandomBinaryString(1000);
|
|||
</SpecialButton>
|
||||
</div>
|
||||
|
||||
<div class="binary">{binary}</div>
|
||||
<div class="binary"><Binary client:load /></div>
|
||||
</div>
|
||||
</Container>
|
||||
</div>
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue