mirror of
https://github.com/remvze/moodist.git
synced 2025-12-17 17:04:15 +00:00
fix: fixate the binary pattern
This commit is contained in:
parent
b171793040
commit
4996cc893c
3 changed files with 9 additions and 19 deletions
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…
Add table
Reference in a new issue