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
Binary file added 2300290120166.pptx
Binary file not shown.
Binary file added Project PDF.pdf
Binary file not shown.
Binary file added Recording 2024-10-30 201132.mp4
Binary file not shown.
Binary file added project1/AC.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
33 changes: 33 additions & 0 deletions project1/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Attendance Calculator</title>
<link rel="stylesheet" href="style.css">
</head>
<body>
<nav class="navbar">
<div class="navbar-brand">
<span>Let's Bunk - by Pratham Jasuja</span>
</div>
</nav>
<div class="container">
<h1>Attendance Calculator</h1>
<form id="attendanceForm">
<label for="attended">Classes Attended:</label>
<input type="number" id="attended" name="attended" required>
<br>
<label for="total">Total Classes:</label>
<input type="number" id="total" name="total" required>
<br>
<label for="desiredPercentage">Desired Percentage:</label>
<input type="number" id="desiredPercentage" name="desiredPercentage" required>
<br>
<button type="submit">Calculate</button>
</form>
<div id="results"></div>
</div>
<script src="script.js"></script>
</body>
</html>
32 changes: 32 additions & 0 deletions project1/script.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
const form = document.querySelector('form');

form.addEventListener('submit', function (e) {
e.preventDefault();

const attended = parseInt(document.querySelector('#attended').value);
const total = parseInt(document.querySelector('#total').value);
const desiredPercentage = parseInt(document.querySelector('#desiredPercentage').value);
const results = document.querySelector('#results');

if (isNaN(attended) || attended < 0) {
results.innerHTML = `Please enter a valid number of attended classes: ${attended}`;
} else if (isNaN(total) || total <= 0) {
results.innerHTML = `Please enter a valid total number of classes: ${total}`;
} else if (isNaN(desiredPercentage) || desiredPercentage <= 0 || desiredPercentage > 100) {
results.innerHTML = `Please enter a valid desired percentage: ${desiredPercentage}`;
} else {
const currentPercentage = ((attended / total) * 100).toFixed(2);

if (currentPercentage > desiredPercentage) {
const classesBunk = Math.round(Math.ceil((100*attended)- (desiredPercentage*total)) / (100+desiredPercentage));
results.innerHTML = `Your current attendance is ${currentPercentage} and You can bunk ${classesBunk} number of classes`;
}
else if(currentPercentage == desiredPercentage){
results.innerHTML = `Your current attendance is ${currentPercentage} and You cannot bunk any class as you already have desired percentage`;
}
else {
const classesNeeded = Math.ceil((total*desiredPercentage - (100*attended)) / (100-desiredPercentage));
results.innerHTML = `Your current attendance is ${currentPercentage} and You need to attend ${classesNeeded} more classes to reach the desired percentage of ${desiredPercentage}`;
}
}
});
141 changes: 141 additions & 0 deletions project1/style.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,141 @@
body {
font-family: Arial, sans-serif;
background-color: #f4f4f4;
margin: 0;
padding: 20px;
}

.navbar {
background-color: #333;
color: #fff;
padding: 1em;
text-align: center;
position: fixed;
top: 0;
left: 0;
width: 100%;
z-index: 1;
}

.navbar-brand {
font-size: 1.5em;
font-weight: bold;
margin-right: 1em;
}

.navbar-nav {
list-style: none;
margin: 0;
padding: 0;
display: flex;
justify-content: space-between;
}

.nav-item {
margin-right: 2em;
}

.nav-link {
color: #fff;
text-decoration: none;
transition: color 0.2s ease;
}

.nav-link:hover {
color: #ccc;
}

.navbar-toggle {
background-color: #333;
border: none;
color: #fff;
cursor: pointer;
font-size: 1.5em;
padding: 0.5em;
position: absolute;
right: 1em;
top: 1em;
border-radius: 4px; /* Add border radius for better appearance */
}

.container {
max-width: 400px;
margin: auto;
background: white;
padding: 20px;
border-radius: 5px;
box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
margin-top: 60px; /* Add margin to account for navbar height */
}

h1 {
text-align: center;
color: #333;
}

label {
display: block;
margin: 10px 0 5px;
}

input[type="number"] {
width: 100%;
padding: 10px;
margin-bottom: 10px;
border: 1px solid #ccc;
border-radius: 4px;
}

button {
width: 100%;
padding: 10px;
background-color: #28a745;
color: white;
border: none;
border-radius: 4px;
cursor: pointer;
}

button:hover {
background-color: #218838;
}

#results {
margin-top: 20px;
padding: 10px;
border: 1px solid #ccc;
border-radius: 4px;
background-color: #e9ecef;
}

/* Responsive design */
@media (max-width: 768px) {
.navbar-nav {
flex-direction: column;
align-items: center;
display: none; /* Hide the navbar items by default on small screens */
}

.navbar-nav.active {
display: flex; /* Show navbar items when active */
}

.nav-item {
margin-right: 0;
margin-bottom: 1em;
}

.navbar-toggle {
display: block; /* Show the toggle button */
}
}

@media (max-width: 480px) {
.navbar-brand {
font-size: 1em;
}

.nav-link {
font-size: 0.8em;
}
}
16 changes: 16 additions & 0 deletions project2/Calculator.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
function addToDisplay(value) {
document.getElementById('display').value += value;
}

function resetDisplay() {
document.getElementById('display').value = '';
}

function computeResult() {
const displayField = document.getElementById('display');
try {
displayField.value = eval(displayField.value) || '';
} catch (error) {
displayField.value = 'Error';
}
}
83 changes: 83 additions & 0 deletions project2/calculator.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
* {
box-sizing: border-box;
}

body {
font-family: 'Arial', sans-serif;
display: flex;
justify-content: center;
align-items: center;
height: 100vh;
margin: 0;
background: linear-gradient(to right, #4facfe, #00f2fe);
}

.calculator-container {
background: #ffffff;
border-radius: 15px;
box-shadow: 0 4px 30px rgba(0, 0, 0, 0.2);
padding: 20px;
width: 100%;
max-width: 400px;
}

#display {
width: 100%;
height: 70px;
font-size: 32px;
text-align: right;
margin-bottom: 15px;
border: 1px solid #dcdcdc;
border-radius: 8px;
padding: 10px;
background-color: #f9f9f9;
color: #333;
}

.keypad {
display: grid;
grid-template-columns: repeat(4, 1fr);
gap: 10px;
}

.btn {
height: 60px;
font-size: 24px;
background-color: #4a4a4a;
color: #fff;
border: none;
border-radius: 8px;
cursor: pointer;
transition: background-color 0.3s;
}

.btn:hover {
background-color: #575757;
}

.operator {
background-color: #ff6347; /* Tomato */
}

.operator:hover {
background-color: #e5533d; /* Darker Tomato */
}

.equal {
grid-column: span 2; /* Make equal button span two columns */
background-color: #28a745; /* Green */
}

.equal:hover {
background-color: #218838; /* Darker Green */
}

/* Responsive Design */
@media (max-width: 600px) {
#display {
font-size: 28px; /* Slightly smaller font for smaller screens */
}
.btn {
font-size: 20px; /* Adjust button font size */
}
}
33 changes: 33 additions & 0 deletions project2/calculator.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Calculator</title>
<link rel="stylesheet" href="calculator.css">
</head>
<body>
<div class="calculator-container">
<input type="text" id="display" disabled>
<div class="keypad">
<button class="btn clear" onclick="resetDisplay()">C</button>
<button class="btn" onclick="addToDisplay('7')">7</button>
<button class="btn" onclick="addToDisplay('8')">8</button>
<button class="btn" onclick="addToDisplay('9')">9</button>
<button class="btn operator" onclick="addToDisplay('/')">/</button>
<button class="btn" onclick="addToDisplay('4')">4</button>
<button class="btn" onclick="addToDisplay('5')">5</button>
<button class="btn" onclick="addToDisplay('6')">6</button>
<button class="btn operator" onclick="addToDisplay('*')">*</button>
<button class="btn" onclick="addToDisplay('1')">1</button>
<button class="btn" onclick="addToDisplay('2')">2</button>
<button class="btn" onclick="addToDisplay('3')">3</button>
<button class="btn operator" onclick="addToDisplay('-')">-</button>
<button class="btn" onclick="addToDisplay('0')">0</button>
<button class="btn equal" onclick="computeResult()">=</button>
<button class="btn operator" onclick="addToDisplay('+')">+</button>
</div>
</div>
<script src="Calculator.js"></script>
</body>
</html>