forked from iamrahulmahato/master-web-development
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
85 additions
and
0 deletions.
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,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> |
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,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); | ||
} | ||
}); |
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,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; | ||
} |