-
Notifications
You must be signed in to change notification settings - Fork 0
Add animal hair ambassador website sample #2
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
base: master
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
<!DOCTYPE html> | ||
<html lang="en"> | ||
<head> | ||
<meta charset="UTF-8" /> | ||
<meta name="viewport" content="width=device-width, initial-scale=1.0" /> | ||
<title>Animal Hair Ambassador</title> | ||
<link rel="stylesheet" href="styles.css" /> | ||
</head> | ||
<body> | ||
<header> | ||
<h1>Animal Hair Ambassador</h1> | ||
<p>Adorable spokes-animals show off stylish hair accessories.</p> | ||
</header> | ||
<main> | ||
<section class="gallery"> | ||
<article class="card"> | ||
<img src="https://placehold.co/300x200" alt="Dog wearing a colorful clip" /> | ||
<h2>Playful Pup</h2> | ||
<p>Bright clips for a fun day out.</p> | ||
</article> | ||
<article class="card"> | ||
<img src="https://placehold.co/300x200" alt="Cat with elegant bow" /> | ||
<h2>Chic Kitty</h2> | ||
<p>Elegant bows for special occasions.</p> | ||
</article> | ||
<article class="card"> | ||
<img src="https://placehold.co/300x200" alt="Bunny with ribbon" /> | ||
<h2>Lovely Bunny</h2> | ||
<p>Soft ribbons that complement every hop.</p> | ||
</article> | ||
</section> | ||
</main> | ||
<footer> | ||
<p>© 2024 Animal Hair Ambassador</p> | ||
</footer> | ||
<script src="script.js"></script> | ||
</body> | ||
</html> |
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
@@ -0,0 +1,12 @@ | ||||||
// Simple theme toggle | ||||||
const header = document.querySelector('header'); | ||||||
const toggle = document.createElement('button'); | ||||||
toggle.textContent = 'Toggle Theme'; | ||||||
header.appendChild(toggle); | ||||||
|
||||||
let dark = false; | ||||||
toggle.addEventListener('click', () => { | ||||||
dark = !dark; | ||||||
document.body.style.background = dark ? '#333' : '#fdfdfd'; | ||||||
document.body.style.color = dark ? '#fdfdfd' : '#333'; | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The theme toggle only changes the body background and text color, but doesn't update other elements like cards, header, or footer. This creates an inconsistent dark theme experience. Consider using CSS classes or CSS custom properties for comprehensive theming.
Suggested change
Copilot uses AI. Check for mistakes. Positive FeedbackNegative Feedback |
||||||
}); |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
body { | ||
font-family: Arial, sans-serif; | ||
margin: 0; | ||
background: #fdfdfd; | ||
color: #333; | ||
} | ||
|
||
header { | ||
background: #ff6f91; | ||
color: #fff; | ||
padding: 1rem; | ||
text-align: center; | ||
} | ||
|
||
.gallery { | ||
display: flex; | ||
flex-wrap: wrap; | ||
gap: 1rem; | ||
justify-content: center; | ||
padding: 1rem; | ||
} | ||
|
||
.card { | ||
background: #fff; | ||
border: 1px solid #ddd; | ||
border-radius: 8px; | ||
width: 300px; | ||
box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1); | ||
text-align: center; | ||
} | ||
|
||
.card img { | ||
width: 100%; | ||
border-bottom: 1px solid #ddd; | ||
border-top-left-radius: 8px; | ||
border-top-right-radius: 8px; | ||
} | ||
|
||
.card h2 { | ||
margin: 0.5rem 0; | ||
} | ||
|
||
footer { | ||
text-align: center; | ||
padding: 1rem; | ||
background: #eee; | ||
margin-top: 1rem; | ||
} |
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.
The script assumes the DOM is ready when it executes, but it runs immediately when loaded. Since the script is placed at the end of the body, this should work, but it's fragile. Consider wrapping the code in a DOMContentLoaded event listener or moving the script to the end of the body tag.
Copilot uses AI. Check for mistakes.