Skip to content

Commit

Permalink
bug fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
arthur-adriansens authored Jan 6, 2024
1 parent 8e3be7d commit b6c22e7
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 10 deletions.
2 changes: 1 addition & 1 deletion src/js/piece.js
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ class Piece {
}

// color
ctx.fillStyle = clearTrail ? "white" : colors[this.piece];
ctx.fillStyle = clearTrail ? bgColor : colors[this.piece];

// fill blocks
for (let i in shape) {
Expand Down
2 changes: 2 additions & 0 deletions src/js/setup.js
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ let speed = 40 - Number(speedIcon.dataset.state) * 10;
let auto_speed = 750;
let username = window.localStorage.getItem("username");
let startScreen = false;
let bgColor = window.getComputedStyle(document.querySelector(".main_layout")).backgroundColor;

// event listeners
throphy_logo.onload = () => {
Expand Down Expand Up @@ -110,6 +111,7 @@ window.onload = () => {
document.body.classList.toggle("dark");

localStorage.setItem("theme", document.body.classList.contains("dark") ? "dark" : "light");
bgColor = window.getComputedStyle(document.querySelector(".main_layout")).backgroundColor;
});
}
};
Expand Down
4 changes: 1 addition & 3 deletions src/style-dark.css
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
@import url('https://fonts.googleapis.com/css2?family=Comfortaa&family=DM+Mono&family=Press+Start+2P&display=swap');

/* SETUP */
:root {
/*todo let them choose different black background shades*/
Expand Down Expand Up @@ -69,7 +67,7 @@
transition: fill 1s, opacity 1s, filter 1s;
}

.dark img.settingIcon2:hover {
.dark .settingIcon2:hover {
filter: brightness(200%);
}

Expand Down
11 changes: 5 additions & 6 deletions src/style.css
Original file line number Diff line number Diff line change
Expand Up @@ -216,7 +216,7 @@ p {
}

.left.column>div {
border-left: none;
border-left: none !important;
border-bottom-left-radius: 0px;
border-top-left-radius: 0px;
}
Expand Down Expand Up @@ -342,18 +342,17 @@ input.rang:invalid {
right: 0;
position: absolute;
margin: 10px;
transition: fill 1s;
transition: fill 1s, opacity 1s, filter 1s;
user-select: none;
}

.settingIcon2 {
margin-top: 5px;
margin-bottom: 5px;
opacity: var(--settingsOpacity);
transition: opacity 1s, filter 1s;
}

img.settingIcon2:hover {
.settingIcon2:hover {
filter: brightness(0%);
}

Expand All @@ -372,13 +371,13 @@ img.settingIcon2:hover {
.dropIcon,
.resetIcon {
fill: grey;
transition: fill 1s;
transition: fill 1s, filter 1s;
}

.settingIcon:hover,
.dropIcon:hover,
.resetIcon:hover {
fill: black;
filter: brightness(0%);
}

.logo {
Expand Down

0 comments on commit b6c22e7

Please sign in to comment.