Skip to content

Commit

Permalink
Add incremental buttons with up/down functionality and styles
Browse files Browse the repository at this point in the history
  • Loading branch information
sharmnten authored Jan 25, 2025
1 parent 8ef58d0 commit d2c7a47
Show file tree
Hide file tree
Showing 3 changed files with 58 additions and 0 deletions.
14 changes: 14 additions & 0 deletions scout/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,20 @@ <h3 class="logo">Badger Bets</h3>
<!-- Main Section -->
<section class="main-section">
<div class="content">

<!-- <form>
button
<input type="number" id="algae-input">
</form> -->
<div class="up-down-container">
<div class="up-down-buttons">
<div class="up incremental-button"></div>
<div class="up text ">+1</div>
<div class="up-down-number">0</div>
<div class="down incremental-button"></div>
<div class="down text">-1</div>
</div>
</div>
</section>

<!-- Footer Section -->
Expand Down
12 changes: 12 additions & 0 deletions scout/script.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
window.onbeforeunload = function() {
return "NOOOOOOOO DONT GO!!!!";
}
let upDown = 0;
$(".up.incremental-button").on("click", () => {
upDown++;
$(".up-down-number").text(upDown);
});
$(".down.incremental-button").on("click", () => {
upDown--;
$(".up-down-number").text(upDown);
});
32 changes: 32 additions & 0 deletions styles.css
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,38 @@ input:focus {
color: #B22222;
}

/* incremental button css */
.incremental-button{
&.up {
border-bottom: 20px solid crimson;
border-left: 20px solid transparent;
border-right: 20px solid transparent;
&:hover {
border-bottom-color: rgb(255, 94, 94);
}
}

&.down {
border-top: 20px solid purple;
border-left: 20px solid transparent;
border-right: 20px solid transparent;
&:hover {
border-top-color: rgb(255, 94, 94);
}
}
}
up-down-container {
display: flex;
justify-content: center;
align-items: center;
}
.up-down-number{
border: 1px solid red;
width: 40px;
text-align: center;
font-size: 15px;
height: 30px;
}
footer {
background-color: #B22222;
color: white;
Expand Down

0 comments on commit d2c7a47

Please sign in to comment.