From ebc4487d55e0f3c4a7470ea18da7f8eed1c1019f Mon Sep 17 00:00:00 2001 From: dkallen78 Date: Sun, 24 Dec 2023 12:42:21 -0600 Subject: [PATCH] added neon-pixel readme --- README.md | 2 ++ neon-pixel-1/README.md | 3 +++ neon-pixel-1/neonPixel1.js | 25 ------------------------- 3 files changed, 5 insertions(+), 25 deletions(-) create mode 100644 neon-pixel-1/README.md diff --git a/README.md b/README.md index 3d24da7..6fb4356 100644 --- a/README.md +++ b/README.md @@ -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) \ No newline at end of file diff --git a/neon-pixel-1/README.md b/neon-pixel-1/README.md new file mode 100644 index 0000000..edfe796 --- /dev/null +++ b/neon-pixel-1/README.md @@ -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. \ No newline at end of file diff --git a/neon-pixel-1/neonPixel1.js b/neon-pixel-1/neonPixel1.js index 7ad8bcf..91d60db 100644 --- a/neon-pixel-1/neonPixel1.js +++ b/neon-pixel-1/neonPixel1.js @@ -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++) { @@ -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"); @@ -194,5 +170,4 @@ let refreshInterval = setInterval(function() { shownSeconds = secondNow; } - //clearInterval(refreshInterval); }, 10);