-
Notifications
You must be signed in to change notification settings - Fork 394
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added Website Bandwidth Calculator (#616)
- Loading branch information
Showing
5 changed files
with
144 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,22 @@ | ||
# <p align="center">Website Bandwidth Estimator</p> | ||
|
||
This is a simple website calculator that estimates the bandwidth needs of a website based on three factors: | ||
|
||
#### Page Views: The total number of times your website is loaded in a given period. | ||
#### Average Page Size: The average size of a webpage on your website in megabytes (MB). | ||
#### Page Views Per Visitor: The average number of pages a visitor views on your website during a single visit (also known as redundancy factor). | ||
|
||
## Tech Stacks :- | ||
|
||
- HTML | ||
- CSS | ||
- JavaScript | ||
|
||
### Note: | ||
|
||
> This is a basic estimation tool and may not reflect the exact bandwidth requirements of your website. | ||
Other factors, such as the use of multimedia content and traffic patterns, can also affect bandwidth usage. | ||
|
||
## Screenshots :- | ||
|
||
![image](https://github.com/Rakesh9100/CalcDiverse/assets/146326636/02d4e968-1d60-4fad-894b-d515dd9118b3) |
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,32 @@ | ||
<!DOCTYPE html> | ||
<html lang="en"> | ||
|
||
<head> | ||
<title>Website Bandwidth Estimator</title> | ||
<link rel="stylesheet" href="style.css"> | ||
</head> | ||
|
||
<body> | ||
<div class="container"> | ||
<h1>Website Bandwidth Estimator</h1> | ||
<label for="pageViews">Page Views:</label> | ||
<br><br> | ||
<input type="number" id="pageViews" name="pageViews"> | ||
<br><br> | ||
<label for="pageSize">Average Page Size (MB):</label> | ||
<br><br> | ||
<input type="number" id="pageSize" name="pageSize"> | ||
<br><br> | ||
<label for="redundancyFactor">Page Views Per Visitor:</label> | ||
<br><br> | ||
<input type="number" id="redundancyFactor" name="redundancyFactor"> | ||
<br><br> | ||
<button type="button" onclick="calculateBandwidth()">Calculate</button> | ||
<button type="button" onclick="reset()">Clear</button> | ||
<div id="result" class="result"></div> | ||
</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 calculateBandwidth() { | ||
const pageViews = document.getElementById("pageViews").value; | ||
const pageSize = document.getElementById("pageSize").value; | ||
const redundancyFactor = document.getElementById("redundancyFactor").value; | ||
|
||
let bandwidth = ((pageViews * pageSize) / redundancyFactor).toFixed(2); | ||
|
||
document.getElementById("result").innerHTML = | ||
"Estimated Website Bandwidth: " + bandwidth + " MB"; | ||
} | ||
|
||
function reset() { | ||
document.getElementById("pageViews").value = ""; | ||
document.getElementById("pageSize").value = ""; | ||
document.getElementById("redundancyFactor").value = ""; | ||
document.getElementById("result").innerHTML = " "; | ||
} |
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,59 @@ | ||
* { | ||
margin: 0; | ||
padding: 0; | ||
} | ||
|
||
body { | ||
font-family: Arial, sans-serif; | ||
background: linear-gradient(to right, #265073, #59D5E0); | ||
} | ||
|
||
.container { | ||
max-width: 600px; | ||
padding: 30px; | ||
border: 1px solid black; | ||
/* Add 3d box shadow */ | ||
box-shadow: 0 0 10px 5px #333A73, | ||
0 0 20px 10px #333A73; | ||
|
||
border-radius: 20px; | ||
margin-top: calc(50vh - 280px); | ||
margin-left: calc(50vw - 300px); | ||
background: #9AD0C2; | ||
} | ||
|
||
input[type="number"] { | ||
width: 100%; | ||
height: 35px; | ||
font-size: 15px; | ||
border-radius: 10px; | ||
} | ||
|
||
h1 { | ||
text-align: center; | ||
margin-top: 20px; | ||
margin-bottom: 30px; | ||
} | ||
|
||
button { | ||
width: 100%; | ||
height: 40px; | ||
outline: none; | ||
border-radius: 20px; | ||
background: #6420AA; | ||
color: white; | ||
transition: all 0.3s ease; | ||
font-size: large; | ||
cursor: pointer; | ||
margin-bottom: 10px; | ||
} | ||
|
||
button:hover { | ||
background: #265073; | ||
} | ||
|
||
.result { | ||
margin-top: 20px; | ||
text-align: center; | ||
font-size: 20px; | ||
} |
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