Skip to content

Commit

Permalink
added neon-pixel readme
Browse files Browse the repository at this point in the history
  • Loading branch information
dkallen78 committed Dec 24, 2023
1 parent d58a467 commit ebc4487
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 25 deletions.
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,3 +15,5 @@ I like making clocks with web technology
[Spin Clock](https://github.com/dkallen78/clocks/tree/master/spin-clock)

[Twist Clock](https://github.com/dkallen78/clocks/tree/master/twist-clock)

[Neon Pixel Clock](https://github.com/dkallen78/clocks/tree/master/neon-pixel-1)
3 changes: 3 additions & 0 deletions neon-pixel-1/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
#[Neon Pixel Clock](https://dkallen.github.io/clocks/neon-pixel-1/neonPixel1.html)

My original plan was to make a seven-segment display clock but I went for the easy solution and made a 15-pixel display clock instead. There's nothing tricky here as far as programming goes. The numbers are defined in a 3x5 array with 1s and 0s representing active and inactive "pixels." Everything is arranged in the DOM with a grid box.
25 changes: 0 additions & 25 deletions neon-pixel-1/neonPixel1.js
Original file line number Diff line number Diff line change
Expand Up @@ -102,9 +102,6 @@ const digit = {

function makeDigit(target, digit) {

//target.innerHTML = "";
//console.log(target.id);

let pixels = document.querySelectorAll("#" + target.id + " > div");
if (pixels) {
for (let i = 0; i < pixels.length; i++) {
Expand All @@ -129,27 +126,6 @@ function makeDigit(target, digit) {
}
}, 760);


/*for (let i = 0; i < digit.length; i++) {
for (let j = 0; j < digit[0].length; j++) {
if (digit[i][j]) {
let div = document.createElement("div");
div.style.gridRow = `${i + 1} / ${i + 2}`;
div.style.gridColumn = `${j + 1} / ${j + 2}`;
target.appendChild(div);
}
}
}
let pixels = document.querySelectorAll("#" + target.id + " > div");
if (pixels) {
for (let i = 0; i < pixels.length; i++) {
pixels[i].style.width = "0rem";
}
}*/

}

let hour1 = document.getElementById("hour1");
Expand Down Expand Up @@ -194,5 +170,4 @@ let refreshInterval = setInterval(function() {
shownSeconds = secondNow;
}

//clearInterval(refreshInterval);
}, 10);

0 comments on commit ebc4487

Please sign in to comment.