-
Notifications
You must be signed in to change notification settings - Fork 2.8k
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
Demo #475
Open
Shreeya-Thirunagari
wants to merge
1
commit into
github:main
Choose a base branch
from
Shreeya-Thirunagari:Shreeya-Thirunagari-demo1
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+233
−0
Open
Demo #475
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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,83 @@ | ||
<!DOCTYPE html> | ||
<html lang="en"> | ||
|
||
<head> | ||
<meta charset="UTF-8"> | ||
<meta name="viewport" content="width=device-width, initial-scale=1.0"> | ||
<title>BOGO Offer</title> | ||
<link rel="stylesheet" href="style.css"> | ||
</head> | ||
|
||
<body> | ||
<div class="container"> | ||
<h1>YAY! It's BOGO</h1> | ||
<!-- 1 Unit Option --> | ||
<div class="option"> | ||
<label> | ||
<input type="radio" name="units" value="1" checked> | ||
<span>1 Unit</span> | ||
<span class="discount">10% Off</span> | ||
<span class="price">$10.00 USD</span> | ||
<span class="original-price">$24.00 USD</span> | ||
</label> | ||
</div> | ||
|
||
<!-- 2 Unit Option --> | ||
<div class="option most-popular"> | ||
<label> | ||
<input type="radio" name="units" value="2"> | ||
<span>2 Unit</span> | ||
<span class="discount">20% Off</span> | ||
<span class="price">$18.00 USD</span> | ||
<span class="original-price">$24.00 USD</span> | ||
<div class="size-colour"> | ||
<div> | ||
<span>#1</span> | ||
<select> | ||
<option>S</option> | ||
<option>M</option> | ||
<option>L</option> | ||
</select> | ||
<select> | ||
<option>Black</option> | ||
<option>Red</option> | ||
<option>White</option> | ||
</select> | ||
</div> | ||
<div> | ||
<span>#2</span> | ||
<select> | ||
<option>S</option> | ||
<option>M</option> | ||
<option>L</option> | ||
</select> | ||
<select> | ||
<option>Colour</option> | ||
<option>Red</option> | ||
<option>White</option> | ||
</select> | ||
</div> | ||
</div> | ||
</label> | ||
</div> | ||
|
||
<!-- 3 Unit Option --> | ||
<div class="option"> | ||
<label> | ||
<input type="radio" name="units" value="3"> | ||
<span>3 Unit</span> | ||
<span class="discount">30% Off</span> | ||
<span class="price">$24.00 USD</span> | ||
<span class="original-price">$24.00 USD</span> | ||
</label> | ||
</div> | ||
|
||
<!-- Footer Section --> | ||
<div class="footer"> | ||
<p>Free Delivery</p> | ||
<p>Total: <span id="total-price">$18.00 USD</span></p> | ||
</div> | ||
<button class="add-to-cart">+ Add to Cart</button> | ||
</div> | ||
</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,20 @@ | ||
document.addEventListener("DOMContentLoaded", function () { | ||
const radioButtons = document.querySelectorAll('input[name="units"]'); | ||
const totalPrice = document.getElementById("total-price"); | ||
|
||
radioButtons.forEach((radio) => { | ||
radio.addEventListener("change", function () { | ||
switch (radio.value) { | ||
case "1": | ||
totalPrice.textContent = "$10.00 USD"; | ||
break; | ||
case "2": | ||
totalPrice.textContent = "$18.00 USD"; | ||
break; | ||
case "3": | ||
totalPrice.textContent = "$24.00 USD"; | ||
break; | ||
} | ||
}); | ||
}); | ||
}); |
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,130 @@ | ||
/* General Reset */ | ||
* { | ||
margin: 0; | ||
padding: 0; | ||
box-sizing: border-box; | ||
} | ||
|
||
body { | ||
font-family: Arial, sans-serif; | ||
background-color: #f9f9f9; | ||
color: #333; | ||
} | ||
|
||
.container { | ||
width: 90%; | ||
max-width: 500px; | ||
margin: 20px auto; | ||
padding: 20px; | ||
background-color: #fff; | ||
border-radius: 10px; | ||
box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1); | ||
} | ||
|
||
h1 { | ||
text-align: center; | ||
color: #ff6680; | ||
margin-bottom: 20px; | ||
} | ||
|
||
/* Option Styles */ | ||
.option { | ||
border: 1px solid #ddd; | ||
padding: 15px; | ||
margin-bottom: 10px; | ||
border-radius: 8px; | ||
position: relative; | ||
} | ||
|
||
.option label { | ||
display: flex; | ||
justify-content: space-between; | ||
align-items: center; | ||
cursor: pointer; | ||
} | ||
|
||
.option input[type="radio"] { | ||
margin-right: 10px; | ||
} | ||
|
||
.discount { | ||
background-color: #ff6680; | ||
color: white; | ||
padding: 2px 6px; | ||
font-size: 12px; | ||
border-radius: 5px; | ||
} | ||
|
||
.price { | ||
font-weight: bold; | ||
color: #333; | ||
} | ||
|
||
.original-price { | ||
text-decoration: line-through; | ||
color: #aaa; | ||
font-size: 12px; | ||
} | ||
|
||
.most-popular { | ||
border: 2px solid #ff6680; | ||
background-color: #fff8fa; | ||
} | ||
|
||
.most-popular::before { | ||
content: "MOST POPULAR"; | ||
position: absolute; | ||
top: -10px; | ||
left: 10px; | ||
background-color: #ff6680; | ||
color: white; | ||
padding: 2px 8px; | ||
font-size: 10px; | ||
border-radius: 5px; | ||
} | ||
|
||
/* Size and Colour Selectors */ | ||
.size-colour { | ||
margin-top: 10px; | ||
} | ||
|
||
.size-colour div { | ||
display: flex; | ||
align-items: center; | ||
margin-top: 5px; | ||
} | ||
|
||
.size-colour span { | ||
margin-right: 10px; | ||
} | ||
|
||
select { | ||
margin-right: 10px; | ||
padding: 4px; | ||
font-size: 12px; | ||
} | ||
|
||
/* Footer Section */ | ||
.footer { | ||
display: flex; | ||
justify-content: space-between; | ||
margin-top: 20px; | ||
font-weight: bold; | ||
color: #ff6680; | ||
} | ||
|
||
.add-to-cart { | ||
width: 100%; | ||
padding: 10px; | ||
background-color: #ff6680; | ||
color: white; | ||
border: none; | ||
border-radius: 5px; | ||
font-size: 16px; | ||
cursor: pointer; | ||
margin-top: 10px; | ||
} | ||
|
||
.add-to-cart:hover { | ||
background-color: #e05570; | ||
} | ||
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
style.css