Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
77 changes: 35 additions & 42 deletions bug-hercules/score-keeper-project/score_keeper.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,20 +8,21 @@ playerOneScore.value = "0";
playerTwoScore.value = "0";
let scoreOfOne = 0;
let scoreOfTwo = 0;
let winner = false ;
let winner = false;

function scoreIncreaserbtn1(){
function scoreIncreaserbtn1() {
scoreOfOne = parseInt(playerOneScore.value);
if(playerOneScore.value < input.value && winner === false ){
scoreOfOne += 1 ;
if (playerOneScore.value < input.value && winner === false) {
scoreOfOne += 1;
}
playerOneScore.value = `${scoreOfOne}`;
playerOneScore.innerText = `${playerOneScore.value}`;
}
function scoreIncreaserbtn2(){

function scoreIncreaserbtn2() {
scoreOfTwo = parseInt(playerTwoScore.value);
if(playerTwoScore.value < input.value && winner === false ){
scoreOfTwo += 1 ;
if (playerTwoScore.value < input.value && winner === false) {
scoreOfTwo += 1;
}
playerTwoScore.value = `${scoreOfTwo}`;
playerTwoScore.innerText = `${playerTwoScore.value}`;
Expand All @@ -37,60 +38,52 @@ function reset() {
input.value = "";
}

playerOneBtn.addEventListener('click' , function(e){
console.log("btn 1 clicked")
if(playerOneScore.value == input.value){
if(playerOneScore.value < playerTwoScore.value){
playerOneScore.style.color = "red";
playerTwoScore.style.color = "green";
}
else {
playerOneScore.style.color = "green";
playerTwoScore.style.color = "red" ;
}
}
if(playerOneScore.value === input.value){
playerOneBtn.classList.add("disabled");
playerTwoBtn.classList.add("disabled");
winner = true ;
playerOneBtn.addEventListener('click', function(e) {
console.log("btn 1 clicked")
if (playerOneScore.value == input.value) {
if (playerOneScore.value < playerTwoScore.value) {
playerOneScore.style.color = "red";
playerTwoScore.style.color = "green";
} else {
playerOneScore.style.color = "green";
playerTwoScore.style.color = "red";
}
}
if (playerOneScore.value === input.value) {
playerOneBtn.classList.add("disabled");
playerTwoBtn.classList.add("disabled");
winner = true;
}
})
playerTwoBtn.addEventListener('click' , function(e){
playerTwoBtn.addEventListener('click', function(e) {
console.log("btn 2 clicked");
if(playerTwoScore.value == input.value ){
if(playerOneScore.value < playerTwoScore.value){
if (playerTwoScore.value == input.value) {
if (playerOneScore.value < playerTwoScore.value) {
playerOneScore.style.color = "red";
playerTwoScore.style.color = "green";
}
else {
playerOneScore.style.color = "green";
playerTwoScore.style.color = "red" ;
} else {
playerOneScore.style.color = "green";
playerTwoScore.style.color = "red";
}
}
if(playerTwoScore.value === input.value){
if (playerTwoScore.value === input.value) {
playerOneBtn.classList.add("disabled");
playerTwoBtn.classList.add("disabled");
winner = true ;
winner = true;
}
})

resetBtn.addEventListener('click' , function(e){
resetBtn.addEventListener('click', function(e) {
console.log("btn reset clicked");
playerOneScore.value = "0";
playerTwoScore.value = "0";
input.value = "";
input.value = "7";
playerOneScore.innerText = `${playerOneScore.value}`;
playerTwoScore.innerText = `${playerTwoScore.value}`;
playerOneScore.style.color = "black";
playerTwoScore.style.color = "black";
playerOneBtn.classList.remove("disabled");
playerTwoBtn.classList.remove("disabled");
winner = false ;

})





winner = false;

})
Binary file added bug-hercules/weather_app-main/assets/sunrise.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added bug-hercules/weather_app-main/assets/temp.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
44 changes: 33 additions & 11 deletions bug-hercules/weather_app-main/index.html
Original file line number Diff line number Diff line change
@@ -1,18 +1,19 @@
<!DOCTYPE html>
<html lang="en">

<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
<link rel="preconnect" href="https://fonts.googleapis.com" />
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin />
<link href="https://fonts.googleapis.com/css2?family=Merriweather+Sans:wght@300;400;500;600;700&display=swap"
rel="stylesheet" />
<link href="https://fonts.googleapis.com/css2?family=Merriweather+Sans:wght@300;400;500;600;700&display=swap" rel="stylesheet" />
<link rel="stylesheet" href="styles.css">
</head>

<body>

<div class="wrapper">

<h1>Weather App</h1>
Expand Down Expand Up @@ -67,38 +68,59 @@ <h1>Weather App</h1>

<!--card 1-->
<div class="parameter">
<img src="./assets/wind.png" >
<img src="./assets/wind.png">
<p>windspeed</p>
<p data-windspeed></p>
</div>

<!--card 2-->
<div class="parameter">
<img src="./assets/humidity.png" >
<img src="./assets/humidity.png">
<p>humidity</p>
<p data-humidity></p>
</div>

<!--card 3-->
<div class="parameter">
<img src="./assets/cloud.png" >
<img src="./assets/cloud.png">
<p>Clouds</p>
<p data-cloudiness></p>
</div>

</div>
<!--card 4-->
<div class="parameter">
<img src="./assets/sunrise.png">
<p>Sunrise Timings</p>
<p data-sun>5:05 am</p>
</div>

<!--card 5-->
<div class="parameter">
<img src="./assets/sunrise.png">
<p>Sunset Timings</p>
<p data-sun>5:30 pm</p>
</div>

</div>
<!--card 6-->
<div class="parameter">
<img src="./assets/temp.png">
<p>Max Min Temperatures</p>
<p data-sun>17C - 38C</p>
</div>



</div>
</div>


</div>

</div>


<script src="index.js"></script>
</div>


<script src="index.js"></script>
</body>

</html>