-
Notifications
You must be signed in to change notification settings - Fork 406
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
6 changed files
with
97 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
# <p align="center">Gaming Efficiency Calculator</p> | ||
|
||
## Description :- | ||
|
||
This calculator will help you calculate your gaming efficiency using kills, deaths, assists, headshots and time played. | ||
|
||
## Tech Stacks :- | ||
|
||
- HTML | ||
- CSS | ||
- JavaScript | ||
|
||
|
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
<!DOCTYPE html> | ||
<html lang="en"> | ||
<head> | ||
<meta charset="UTF-8"> | ||
<meta name="viewport" content="width=device-width, initial-scale=1.0"> | ||
<title>Advanced Gaming Efficiency Calculator</title> | ||
<link rel="stylesheet" href="style.css"> | ||
</head> | ||
<body> | ||
<div class="container"> | ||
<h2>Advanced Gaming Efficiency Calculator</h2> | ||
<label>Kills:</label> | ||
<input type="number" id="kills" placeholder="Enter kills"> | ||
<label>Deaths:</label> | ||
<input type="number" id="deaths" placeholder="Enter deaths"> | ||
<label>Assists:</label> | ||
<input type="number" id="assists" placeholder="Enter assists"> | ||
<label>Headshots:</label> | ||
<input type="number" id="headshots" placeholder="Enter headshots"> | ||
<label>Time Played (minutes):</label> | ||
<input type="number" id="time" placeholder="Enter time in minutes"> | ||
<button onclick="calculateEfficiency()">Calculate Efficiency</button> | ||
<p id="result"></p> | ||
</div> | ||
<script src="script.js"></script> | ||
</body> | ||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
function calculateEfficiency() { | ||
let kills = parseFloat(document.getElementById("kills").value); | ||
let deaths = parseFloat(document.getElementById("deaths").value); | ||
let assists = parseFloat(document.getElementById("assists").value); | ||
let headshots = parseFloat(document.getElementById("headshots").value); | ||
let time = parseFloat(document.getElementById("time").value); | ||
|
||
if (isNaN(kills) || isNaN(deaths) || isNaN(assists) || isNaN(headshots) || isNaN(time) || time <= 0) { | ||
document.getElementById("result").innerText = "Please enter valid numbers."; | ||
return; | ||
} | ||
|
||
let efficiency = ((kills + (assists * 0.5) + (headshots * 0.3)) - deaths) / time; | ||
|
||
document.getElementById("result").innerText = `Your advanced gaming efficiency is: ${efficiency.toFixed(2)}`; | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
|
||
body { | ||
font-family: Arial, sans-serif; | ||
text-align: center; | ||
padding: 20px; | ||
background: url('./assets/bg-image.jpg') no-repeat center center fixed; | ||
background-size: cover; | ||
} | ||
.container { | ||
max-width: 400px; | ||
margin: auto; | ||
background: rgba(244, 244, 244, 0.9); | ||
padding: 20px; | ||
border-radius: 10px; | ||
} | ||
input { | ||
width: 100%; | ||
padding: 2px; | ||
margin: 5px 0; | ||
} | ||
button { | ||
padding: 10px; | ||
background: #28a745; | ||
color: white; | ||
border: none; | ||
cursor: pointer; | ||
} | ||
button:hover { | ||
background: #218838; | ||
} | ||
#result { | ||
font-weight: bold; | ||
margin-top: 10px; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters