mirror of
https://github.com/remvze/moodist.git
synced 2025-12-18 17:34:17 +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 { SpecialButton } from './special-button';
|
||||||
import { Container } from './container';
|
import { Container } from './container';
|
||||||
|
import { Binary } from './binary';
|
||||||
import { generateRandomBinaryString } from '@/helpers/binary';
|
|
||||||
|
|
||||||
const binary = generateRandomBinaryString(1000);
|
|
||||||
---
|
---
|
||||||
|
|
||||||
<div class="source">
|
<div class="source">
|
||||||
|
|
@ -28,7 +25,7 @@ const binary = generateRandomBinaryString(1000);
|
||||||
</SpecialButton>
|
</SpecialButton>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="binary">{binary}</div>
|
<div class="binary"><Binary client:load /></div>
|
||||||
</div>
|
</div>
|
||||||
</Container>
|
</Container>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue