TIMBOVILL commited on
Commit
fc5ebc4
·
verified ·
1 Parent(s): 986a9c2

Update script.js

Browse files
Files changed (1) hide show
  1. script.js +16 -3
script.js CHANGED
@@ -29,12 +29,25 @@ function showTime() {
29
  time += " " + session;
30
  }
31
 
32
- document.getElementById("MyClockDisplay").innerText = time;
33
- document.getElementById("MyClockDisplay").textContent = time;
 
 
 
34
 
35
  setTimeout(showTime, 1000);
36
  }
37
 
 
 
 
 
 
 
 
 
 
 
38
  function toggleMenu() {
39
  const menu = document.getElementById('menu');
40
  if (menu.style.display === 'none' || menu.style.display === '') {
@@ -60,4 +73,4 @@ function toggleAmPm() {
60
  showAmPm = !showAmPm;
61
  }
62
 
63
- showTime();
 
29
  time += " " + session;
30
  }
31
 
32
+ const clockDisplay = document.getElementById("MyClockDisplay");
33
+ clockDisplay.innerText = time;
34
+ clockDisplay.textContent = time;
35
+
36
+ adjustFontSize(clockDisplay);
37
 
38
  setTimeout(showTime, 1000);
39
  }
40
 
41
+ function adjustFontSize(element) {
42
+ if (showSeconds && showAmPm) {
43
+ element.style.fontSize = "180px";
44
+ } else if (showSeconds || showAmPm) {
45
+ element.style.fontSize = "200px";
46
+ } else {
47
+ element.style.fontSize = "240px";
48
+ }
49
+ }
50
+
51
  function toggleMenu() {
52
  const menu = document.getElementById('menu');
53
  if (menu.style.display === 'none' || menu.style.display === '') {
 
73
  showAmPm = !showAmPm;
74
  }
75
 
76
+ showTime();;