Skip to content

Commit

Permalink
Added
Browse files Browse the repository at this point in the history
  • Loading branch information
TunanshV committed Jun 11, 2024
1 parent 452aad9 commit 6e4a518
Show file tree
Hide file tree
Showing 8 changed files with 4,022 additions and 0 deletions.
35 changes: 35 additions & 0 deletions index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="stylesheet" href="main.css">
<title>Increment and Decrement Project</title>
</head>
<body>
<!-- wrapper -->
<div class="w-[100vw] h-[100vh] flex flex-col items-center justify-center bg-[#390000] gap-10">
<!-- heading -->
<div class="text-[#0398d4] font-medium text-[20px]">Increment And Decrement</div>
<!-- secondary wrapper -->

<div class="bg-white flex text-[25px] text-[#344151] rounded-sm gap-12 p-3 px-5">
<!-- negative button -->
<button onclick="decrement()" class="border-r-2 border-[#bfbfbf] pr-5">
<i class="fa-solid fa-minus"></i>
</button>
<div id="counter" class="font-bold">
0
</div>
<!-- positive button -->
<button onclick="increment()" class="border-l-2 border-[#bfbfbf] pl-5">
<i class="fa-solid fa-plus"></i>
</button>
</div>
</div>

<script src="https://kit.fontawesome.com/58a810656e.js"> crossorigin="anonymous"</script>
<script src="index.js"></script>

</body>
</html>
19 changes: 19 additions & 0 deletions index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
let countValue= document.querySelector('#counter');

let increment=()=>{
// get the value from UI
let value= parseInt(countValue.innerText);
// Update the value
value=value+1;
// set the value onto UI
countValue.innerText= value;
};

let decrement=()=>{
// get the value from UI
let value= parseInt(countValue.innerText);
// Update the value
value=value-1;
// set the value onto UI
countValue.innerText= value;
};
3 changes: 3 additions & 0 deletions main.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
@tailwind base;
@tailwind components;
@tailwind utilities;
Loading

0 comments on commit 6e4a518

Please sign in to comment.