Skip to content

Commit

Permalink
Add Mood Board Generator project
Browse files Browse the repository at this point in the history
  • Loading branch information
vyom10445 committed Oct 28, 2024
1 parent 0417768 commit 22a4aec
Show file tree
Hide file tree
Showing 3 changed files with 85 additions and 0 deletions.
19 changes: 19 additions & 0 deletions Mood Board Generator/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Mood Board Generator</title>
<link rel="stylesheet" href="style.css">
</head>
<body>
<div class="container">
<h1>Mood Board Generator</h1>
<input type="file" id="imageInput" multiple accept="image/*" />
<button id="addImageBtn">Add to Mood Board</button>
<div class="mood-board" id="moodBoard"></div>
</div>

<script src="script.js"></script>
</body>
</html>
17 changes: 17 additions & 0 deletions Mood Board Generator/script.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
document.getElementById('addImageBtn').addEventListener('click', function () {
const imageInput = document.getElementById('imageInput');
const moodBoard = document.getElementById('moodBoard');

for (let i = 0; i < imageInput.files.length; i++) {
const file = imageInput.files[i];
const reader = new FileReader();

reader.onload = function (e) {
const img = document.createElement('img');
img.src = e.target.result;
moodBoard.appendChild(img);
};

reader.readAsDataURL(file);
}
});
49 changes: 49 additions & 0 deletions Mood Board Generator/style.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
body {
font-family: Arial, sans-serif;
background-color: #f9f9f9;
color: #333;
margin: 0;
padding: 20px;
}

.container {
max-width: 600px;
margin: 0 auto;
}

h1 {
text-align: center;
margin-bottom: 20px;
}

input[type="file"] {
width: 100%;
margin-bottom: 10px;
}

button {
padding: 10px 20px;
background-color: #007bff;
color: white;
border: none;
cursor: pointer;
width: 100%;
}

button:hover {
background-color: #0056b3;
}

.mood-board {
display: flex;
flex-wrap: wrap;
gap: 10px;
margin-top: 20px;
}

.mood-board img {
max-width: 100px;
max-height: 100px;
object-fit: cover;
border: 2px solid #007bff;
}

0 comments on commit 22a4aec

Please sign in to comment.