Skip to content

Commit

Permalink
dots-optimization
Browse files Browse the repository at this point in the history
  • Loading branch information
AB10110F committed Jul 18, 2023
1 parent a73e572 commit 00cae22
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 8 deletions.
15 changes: 10 additions & 5 deletions src/components/Dots.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,17 +8,22 @@ const Dots = () => {

useEffect(() => {
const dotSize:number = 4;
const spacing:number = dotSize * 16;
const spacing:number = dotSize * 8;
const minTvalue:number = 50;
const areaAffected:number = 80;
const areaAffected:number = 50;
let mouseIsMoving:boolean = false;
let dots:any[] = [];

const sketch = (p: p5) => {

p.disableFriendlyErrors = true;

p.setup = () => {
p.createCanvas(p.windowWidth, document.documentElement.scrollHeight);
for (let i = 0; i < p.width; i += spacing) {
for (let j = 0; j < p.height; j += spacing) {
p.createCanvas(p.windowWidth, p.windowHeight);
for (let i = 0; i < p.width; i += spacing)
{
for (let j = 0; j < p.height; j += spacing)
{
let dot = new Dot(i + spacing / 2, j + spacing / 2, dotSize);
dots.push(dot);
}
Expand Down
2 changes: 1 addition & 1 deletion src/css/dots.module.css
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
.background
{
position: absolute;
position: fixed;
z-index: -1;
top: 0;
}
4 changes: 2 additions & 2 deletions src/css/terminal.module.css
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,13 @@
{
height: 400px;
width: 70%;
background-color: rgb(26, 26, 26);
background-color: rgb(39, 39, 39);
color: white;
box-sizing: border-box;
font-size: 15px;
overflow-y:auto;
overflow-x: hidden;
border: 1px solid rgb(117, 117, 117);
border: 1px solid rgb(113, 113, 113);
}

.windowOptions
Expand Down

0 comments on commit 00cae22

Please sign in to comment.