Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Calendar #661

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
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
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
44 changes: 44 additions & 0 deletions 33-pricing-component-with-toggle/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Pricing Component</title>
<link rel="stylesheet" href="style.css">
</head>
<body>
<div class="pricing-container">
<div class="toggle">
<span>Monthly</span>
<label class="switch">
<input type="checkbox" id="toggleSwitch">
<span class="slider"></span>
</label>
<span>Yearly</span>
</div>

<div class="pricing-options">
<div class="pricing-plan" id="basicPlan">
<h2>Basic Plan</h2>
<p class="price" data-monthly="10" data-yearly="100">Rs10/month</p>
<p>Features: Feature 1, Feature 2, Feature 3</p>
<button>Select</button>
</div>
<div class="pricing-plan" id="proPlan">
<h2>Pro Plan</h2>
<p class="price" data-monthly="20" data-yearly="200">Rs20/month</p>
<p>Features: Feature A, Feature B, Feature C</p>
<button>Select</button>
</div>
<div class="pricing-plan" id="premiumPlan">
<h2>Premium Plan</h2>
<p class="price" data-monthly="30" data-yearly="300">Rs30/month</p>
<p>Features: Feature X, Feature Y, Feature Z</p>
<button>Select</button>
</div>
</div>
</div>

<script src="script.js"></script>
</body>
</html>
16 changes: 16 additions & 0 deletions 33-pricing-component-with-toggle/script.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
document.getElementById('toggleSwitch').addEventListener('change', function() {
const isYearly = this.checked;
const pricingPlans = document.querySelectorAll('.pricing-plan');

pricingPlans.forEach(plan => {
const priceElement = plan.querySelector('.price');
const monthlyPrice = priceElement.getAttribute('data-monthly');
const yearlyPrice = priceElement.getAttribute('data-yearly');

if (isYearly) {
priceElement.textContent = `Rs${yearlyPrice}/year`;
} else {
priceElement.textContent = `Rs${monthlyPrice}/month`;
}
});
});
97 changes: 97 additions & 0 deletions 33-pricing-component-with-toggle/style.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,97 @@
body {
font-family: Arial, sans-serif;
background-color: #f4f4f4;
display: flex;
justify-content: space-around;

justify-content: center;
align-items: center;
height: 100vh;
margin: 0;
}

.pricing-container {
background: white;
padding: 20px;
border-radius: 10px;
box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
text-align: center;
}

.toggle {
display: flex;
align-items: center;
justify-content: center;
margin-bottom: 20px;
}

.switch {
position: relative;
display: inline-block;
width: 60px;
height: 34px;
margin: 0 10px;
}

.switch input {
opacity: 0;
width: 0;
height: 0;
}

.slider {
position: absolute;
cursor: pointer;
top: 0;
left: 0;
right: 0;
bottom: 0;
background-color: #ccc;
border-radius: 34px;
transition: .4s;
}

.slider:before {

position: absolute;
content: "";
height: 26px;
width: 26px;
left: 4px;
bottom: 4px;
background-color: white;
border-radius: 50%;
transition: .4s;
}

input:checked + .slider {
background-color: #2196F3;
}

input:checked + .slider:before {
transform: translateX(26px);
}

.pricing-options {
display: flex;
gap: 9vh;
justify-content: space-around;
}

.pricing-plan {
background: #e0f7fa;
border-radius: 10px;
padding: 20px;
width: 200px;
}

.price {
font-size: 24px;
font-weight: bold;
}
button
{
background: #0f8dbf;
color: white;
height: 4vh;
}
Binary file added 34-calendar/design/desktop-design.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
66 changes: 66 additions & 0 deletions 34-calendar/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Simple Calendar</title>
<link rel="stylesheet" href="style.css">
</head>
<body>
<div class="calendar">
<header>
<h2>November 2024</h2>
<div class="navigation">
<button class="prev">❮</button>
<button class="next">❯</button>
</div>
</header>
<div class="days-of-week">
<div>Sun</div>
<div>Mon</div>
<div>Tue</div>
<div>Wed</div>
<div>Thu</div>
<div>Fri</div>
<div>Sat</div>
</div>
<div class="days">
<div class="day empty"></div>
<div class="day empty"></div>
<div class="day empty"></div>
<div class="day">1</div>
<div class="day">2</div>
<div class="day">3</div>
<div class="day">4</div>
<div class="day">5</div>
<div class="day">6</div>
<div class="day">7</div>
<div class="day">8</div>
<div class="day">9</div>
<div class="day">10</div>
<div class="day">11</div>
<div class="day">12</div>
<div class="day">13</div>
<div class="day">14</div>
<div class="day">15</div>
<div class="day">16</div>
<div class="day">17</div>
<div class="day">18</div>
<div class="day">19</div>
<div class="day">20</div>
<div class="day">21</div>
<div class="day">22</div>
<div class="day">23</div>
<div class="day">24</div>
<div class="day">25</div>
<div class="day">26</div>
<div class="day">27</div>
<div class="day">28</div>
<div class="day">29</div>
<div class="day">30</div>
<div class="day empty"></div>
<div class="day empty"></div>
</div>
</div>
</body>
</html>
76 changes: 76 additions & 0 deletions 34-calendar/style.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
body {
font-family: Arial, sans-serif;
background-color: #f0f0f0;
display: flex;
justify-content: center;
align-items: center;
height: 100vh;
margin: 0;
}

.calendar {
background: white;
border-radius: 8px;
box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
width: 350px;
}

header {
padding: 15px;
background: #007bff;
color: white;
border-top-left-radius: 8px;
border-top-right-radius: 8px;
}

h2 {
margin: 0;
font-size: 1.5rem;
}

.navigation {
display: flex;
justify-content: space-between;
}

.navigation button {
background: none;
border: none;
color: white;
font-size: 1.5rem;
cursor: pointer;
}

.days-of-week {
display: grid;
grid-template-columns: repeat(7, 1fr);
background: #f7f7f7;
padding: 10px 0;
font-weight: bold;
}

.days-of-week div {
padding: 10px;
text-align: center;
}

.days {
display: grid;
grid-template-columns: repeat(7, 1fr);
}

.day {
padding: 15px;
border: 1px solid #ddd;
box-sizing: border-box;
text-align: center;
}

.day.empty {
background: #f9f9f9;
}

.day:hover {
background: #e9e9e9;
cursor: pointer;
}
7 changes: 6 additions & 1 deletion script.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,12 @@ const projects = [
{ name: "28-Zomato-clone", tags: ["HTML", "CSS", "JavaScript"] },
{ name: "29-to-do-list", tags: ["HTML", "CSS", "JavaScript"] },
{ name: "30-currency-converter", tags: ["HTML", "CSS", "JavaScript"] },
{ name: "31-tic-tac-toe", tags: ["HTML", "CSS", "JavaScript"] }
{ name: "31-tic-tac-toe", tags: ["HTML", "CSS", "JavaScript"] },
{ name: "32-calculator-application", tags: ["HTML", "CSS", "JavaScript"] },
{ name: "33-pricing-component-with-toggle", tags: ["HTML", "CSS", "JavaScript"] },
{ name: "34-calendar", tags: ["HTML", "CSS"] }




];
Expand Down