Skip to content

Commit

Permalink
Merge pull request #2388 from SanikaBhalerao1345/main
Browse files Browse the repository at this point in the history
added adopt-a-pet gllery
  • Loading branch information
iamrahulmahato authored Nov 10, 2024
2 parents 442d597 + f085f41 commit 9cb8e82
Show file tree
Hide file tree
Showing 7 changed files with 157 additions and 0 deletions.
Binary file added assets/image/1-yr-parrot.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/image/3year-cat.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/image/4 year dog.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/image/bella-dog.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/image/pet-adopt.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
12 changes: 12 additions & 0 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -337,6 +337,18 @@ <h3 class="card-heading">Generate Gradient</h3>
</div>
</a>

<a href="./pet.html" class="card Generators" target="_blank">
<div class="card-cover">
<img src="assets/image/pet-adopt.png" alt="">
</div>
<div class="card-content">
<h3 class="card-heading">Adopt-a-Pet Gallery </h3>
<p class="card-description">
Lets befriend a cute pet.
</p>
</div>
</a>

<a href="./projects/iRadio/index.html" class="card Generators" target="_blank">
<div class="card-cover">
<img src="https://img.freepik.com/free-photo/retro-microphone-isolated-color-background_1387-912.jpg?t=st=1730179005~exp=1730182605~hmac=d159adfba6c053946368bf47299cc468447ac975a45dcab478adc7dac4d252fb&w=740" alt="Generate Gradient">
Expand Down
145 changes: 145 additions & 0 deletions pet.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,145 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Adopt-a-Pet Gallery</title>
<style>
* {
margin: 0;
padding: 0;
box-sizing: border-box;
font-family: Arial, sans-serif;
}
body {
display: flex;
justify-content: center;
align-items: center;
min-height: 100vh;
background: #f3f4f6;
color: #333;
}
.gallery-container {
width: 90%;
max-width: 800px;
padding: 20px;
background: #ffffff;
border-radius: 8px;
box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}
h1 {
text-align: center;
margin-bottom: 20px;
color: #007bff;
}
.pet-card {
background: #f8f9fa;
border: 1px solid #ddd;
border-radius: 8px;
padding: 15px;
margin-bottom: 20px;
display: flex;
align-items: center;
gap: 15px;
}
.pet-image {
width: 100px;
height: 100px;
border-radius: 50%;
object-fit: cover;
border: 2px solid #007bff;
}
.pet-info {
flex-grow: 1;
}
.pet-name {
font-size: 1.3em;
color: #007bff;
margin-bottom: 5px;
}
.pet-details {
color: #666;
font-size: 0.9em;
margin-bottom: 10px;
}
.adopt-btn {
padding: 8px 12px;
background-color: #007bff;
color: white;
border: none;
border-radius: 5px;
cursor: pointer;
transition: background-color 0.3s;
}
.adopt-btn:hover {
background-color: #0056b3;
}
</style>
</head>
<body>
<div class="gallery-container">
<h1>Adopt-a-Pet Gallery</h1>
<div id="petGallery"></div>
</div>

<script>
const pets = [
{
name: "Bella",
type: "Dog",
age: "2 years",
description: "A friendly Labrador who loves playing fetch.",
image: "./assets/image/bella-dog.jpg"
},
{
name: "Whiskers",
type: "Cat",
age: "3 years",
description: "A calm and cuddly Persian cat.",
image: "./assets/image/3year-cat.jpg"
},
{
name: "Charlie",
type: "Dog",
age: "4 years",
description: "An energetic Beagle with a big heart.",
image: "./assets/image/4 year dog.jpg"
},
{
name: "Polly",
type: "Parrot",
age: "1 year",
description: "A chatty parrot who loves company.",
image: "./assets/image/1-yr-parrot.jpg"
}
];

function loadPets() {
const gallery = document.getElementById("petGallery");

pets.forEach((pet) => {
const petCard = document.createElement("div");
petCard.classList.add("pet-card");

petCard.innerHTML = `
<img src="${pet.image}" alt="${pet.name}" class="pet-image">
<div class="pet-info">
<h2 class="pet-name">${pet.name}</h2>
<p class="pet-details">Type: ${pet.type} | Age: ${pet.age}</p>
<p>${pet.description}</p>
</div>
<button class="adopt-btn" onclick="adoptPet('${pet.name}')">Adopt Me!</button>
`;

gallery.appendChild(petCard);
});
}

function adoptPet(name) {
alert(`Thank you for showing interest in adopting ${name}!`);
}

window.onload = loadPets;
</script>
</body>
</html>

0 comments on commit 9cb8e82

Please sign in to comment.