Calculator Tools Calculator Tools
Create

365 Self Portraits App

May 14, 2025

About this app

Capture a self-portrait every day with a unique theme! Add your details and explore creativity in a fun, colorful way.

365 Self Portraits App 365 Self Portraits Full Name Gender Male Female Self Portrait Theme Upload Self Portrait

Related apps

Put this on your site

Source

                    <html>
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width,initial-scale=1">

<title>365 Self Portraits App</title>
<meta name="description" content="Capture a self-portrait every day with a unique theme! Add your details and explore creativity in a fun, colorful way.">
<meta name="keywords" content="self-portrait, creativity, photo gallery, daily challenge, themes">

<!-- Libraries -->
<!-- jQuery (3.6.0) -->
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.6.0/jquery.min.js" crossorigin="anonymous"></script>
<!-- Bootstrap CSS (5.3.3) -->
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.3/dist/css/bootstrap.min.css" crossorigin="anonymous">
<!-- Bootstrap JS (5.3.3) -->
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.3/dist/js/bootstrap.min.js" crossorigin="anonymous"></script>
<!-- Font Awesome (6.6.0) -->
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@fortawesome/fontawesome-free@6.6.0/css/fontawesome.min.css" crossorigin="anonymous">

<script type="text/javascript">
try {
// App Javascript Goes Here. Place your entire script content inside the try block for error handling.

document.addEventListener("DOMContentLoaded", function() {
const portraits = [];
let count = 0;

document.getElementById("upload-btn").onclick = function() {
document.getElementById("file-input").click();
}

document.getElementById("file-input").onchange = function(event) {
const files = event.target.files;
if(files.length > 0) {
const file = files[0];
const theme = document.getElementById("theme-input").value;
const name = document.getElementById("name-input").value;
const gender = document.querySelector('input[name="gender"]:checked') ? document.querySelector('input[name="gender"]:checked').value : "Not specified";

const reader = new FileReader();
reader.onload = function(e) {
portraits.push({image: e.target.result, theme, name, gender});
updateGallery();
}
reader.readAsDataURL(file);
document.getElementById("theme-input").value = '';
}
}

function updateGallery() {
const gallery = document.getElementById("portrait-gallery");
gallery.innerHTML = '';
portraits.forEach((portrait, index) => {
gallery.innerHTML += `
<div class="col-lg-4 col-md-6 mb-4">
<div class="card h-100">
<img src="${portrait.image}" class="card-img-top" alt="Self Portrait ${index+1}">
<div class="card-body text-center">
<h5>${portrait.theme}</h5>
<p><strong>${portrait.name}</strong> (${portrait.gender})</p>
</div>
</div>
</div>
`;
});
}
});

} catch (error) {
throw error;
}
</script>

<style>
body {
background: linear-gradient(to right, #f9f9f9, #ffecf1);
color: #333;
font-family: 'Arial', sans-serif;
}
#main-container {
margin-top: 50px;
}
.btn-custom {
background-color: #ff6b6b;
color: white;
}
.btn-custom:hover {
background-color: #ff3d3d;
}
.card {
border: none;
box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}
.card-img-top {
height: 200px;
object-fit: cover;
}
</style>
</head>
<body>
<div id="main-container" class="container">
<h1 class="text-center">365 Self Portraits</h1>
<div class="mb-4">
<label for="name-input" class="form-label">Full Name</label>
<input type="text" id="name-input" class="form-control" placeholder="Enter your name">
</div>
<div class="mb-4">
<label class="form-label">Gender</label>
<div>
<input type="radio" id="gender-male" name="gender" value="Male">
<label for="gender-male">Male</label>
<input type="radio" id="gender-female" name="gender" value="Female" class="ms-3">
<label for="gender-female">Female</label>
</div>
</div>
<div class="mb-4">
<label for="theme-input" class="form-label">Self Portrait Theme</label>
<input type="text" id="theme-input" class="form-control" placeholder="Enter the theme for your portrait">
</div>
<button id="upload-btn" class="btn btn-custom">Upload Self Portrait</button>
<input type="file" id="file-input" style="display: none;" accept="image/*">

<div class="row mt-4" id="portrait-gallery"></div>
</div>
</body>
</html>