Skip to content

Commit

Permalink
added warning animation if temp is above 90c
Browse files Browse the repository at this point in the history
  • Loading branch information
epicX67 committed Jul 17, 2021
1 parent 1aca5cf commit 5b552a5
Show file tree
Hide file tree
Showing 4 changed files with 89 additions and 3 deletions.
44 changes: 43 additions & 1 deletion src/css/style.css

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion src/css/style.css.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

32 changes: 31 additions & 1 deletion src/css/style.scss
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,33 @@
background: var(--yellow);
}

@keyframes blink {
0% {
opacity: 0;
}

50% {
opacity: 1;
}

100% {
opacity: 0;
}
}

.warning {
position: relative;
&::after {
position: absolute;
content: "";
inset: 0;
background: radial-gradient(#ff002225, #ff00228e);
border-radius: 10px;
z-index: 0;
animation: blink 3000ms ease 0ms infinite;
}
}

* {
box-sizing: border-box;
padding: 0;
Expand Down Expand Up @@ -127,7 +154,6 @@ header {
animation: come 500ms ease 200ms 1 forwards;

.type {
background: red;
border-radius: 999px;
border: 1vmin solid var(--sbg);
background: var(--bg);
Expand All @@ -137,6 +163,7 @@ header {
justify-content: center;
gap: 0.5rem;
padding: 1.2vmin 3vmin;
z-index: 2;

position: absolute;
top: -4vmin;
Expand All @@ -155,6 +182,7 @@ header {

.pill {
//width: 10rem;
z-index: 2;
width: fit-content;
height: 4vmin;
background: var(--bg);
Expand Down Expand Up @@ -186,6 +214,7 @@ header {
}

.load {
z-index: 2;
font-size: 14vmin;
font-family: "productSans";
font-weight: 900;
Expand All @@ -204,6 +233,7 @@ header {
}

.pillDown {
z-index: 2;
//width: 10rem;
width: fit-content;
height: 4vmin;
Expand Down
14 changes: 14 additions & 0 deletions src/js/script.js
Original file line number Diff line number Diff line change
Expand Up @@ -228,6 +228,13 @@ function onCPU_Temp() {
document.getElementById(
"cpu_temp"
).innerHTML = `${Hardware.CPU.temperature.current.value}<span> ${Hardware.CPU.temperature.unit.value}</span>`;

const c = document.getElementById("cpu");
if (Hardware.CPU.temperature.current.value > 90) {
c.classList.add("warning");
} else {
c.classList.remove("warning");
}
}
function onCPU_Fan() {
const speed = 100 - (Hardware.CPU.fan.current.value / 3000) * 100;
Expand All @@ -250,6 +257,13 @@ function onGPU_Temp() {
document.getElementById(
"gpu_temp"
).innerHTML = `${Hardware.GPU.temperature.current.value}<span> ${Hardware.GPU.temperature.unit.value}</span>`;

const g = document.getElementById("gpu");
if (Hardware.GPU.temperature.current.value > 90) {
g.classList.add("warning");
} else {
g.classList.remove("warning");
}
}
function onGPU_Usage() {
document.getElementById(
Expand Down

0 comments on commit 5b552a5

Please sign in to comment.