Skip to content

Commit

Permalink
add title and better buttons
Browse files Browse the repository at this point in the history
  • Loading branch information
MichaelLesirge committed Nov 11, 2024
1 parent 238d626 commit d8b012d
Showing 1 changed file with 18 additions and 13 deletions.
31 changes: 18 additions & 13 deletions one-second/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,16 @@
<title>One Second Game</title>
<style>
body {
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;

background-color: #000;
color: #fff;
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;

display: flex;
flex-direction: column;
align-items: center;
justify-content: center;

min-height: 100vh;
margin: 0;
}
Expand All @@ -32,19 +35,28 @@
}

button {
width: 7.6rem;
font-size: 18px;

padding: 15px 40px;
border-radius: 25px;
border: none;
font-size: 18px;

cursor: pointer;
transition: all 0.3s;

/* transition: all 0.3s; */
}

body button:hover {
button:hover {
transform: scale(1.01);
filter: brightness(0.9);
}

button:active {
transform: scale(0.99);
filter: brightness(1.1);
}

#start {
background-color: #34c759;
color: white;
Expand Down Expand Up @@ -80,6 +92,8 @@
</head>

<body>
<h1>One Second</h1>

<div id="timer">00:00:00</div>
<div class="buttons">
<button id="reset">Reset</button>
Expand Down Expand Up @@ -140,7 +154,6 @@
}

function checkWin() {
console.log(timerDisplay.textContent);
if (timerDisplay.textContent === '00:01.00') {

localStorage.setItem('wins', (parseInt(localStorage.getItem('wins')) || 0) + 1);
Expand Down Expand Up @@ -175,14 +188,6 @@
}
});

startButton.addEventListener('mousedown', (event) => {
event.preventDefault();
});

resetButton.addEventListener('mousedown', (event) => {
event.preventDefault();
});

updateDisplay();

</script>
Expand Down

0 comments on commit d8b012d

Please sign in to comment.