mirror of
https://github.com/remvze/moodist.git
synced 2025-11-05 12:03:05 -05:00
fix: fixate the binary pattern
This commit is contained in:
parent
b171793040
commit
4996cc893c
7
src/components/binary.astro
Normal file
7
src/components/binary.astro
Normal file
@ -0,0 +1,7 @@
|
|||||||
|
---
|
||||||
|
import { generateRandomBinaryString } from '@/helpers/binary';
|
||||||
|
|
||||||
|
const binary = generateRandomBinaryString(1000);
|
||||||
|
---
|
||||||
|
|
||||||
|
<span>{binary}</span>
|
||||||
@ -1,17 +0,0 @@
|
|||||||
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,7 +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 Binary from './binary.astro';
|
||||||
---
|
---
|
||||||
|
|
||||||
<div class="source">
|
<div class="source">
|
||||||
@ -25,7 +25,7 @@ import { Binary } from './binary';
|
|||||||
</SpecialButton>
|
</SpecialButton>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="binary"><Binary client:load /></div>
|
<div class="binary"><Binary /></div>
|
||||||
</div>
|
</div>
|
||||||
</Container>
|
</Container>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user