Calculator Tools Calculator Tools
Create

365 Self Portraits Tracker

May 14, 2025

About this app

Track your 365 self portraits journey with themes and personal details like name and gender!

365 Self Portraits Tracker 365 Self Portraits Tracker Gender: Male Female Other Add 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 Tracker</title>
<meta name="description" content="Track your 365 self portraits journey with themes and personal details like name and gender!">
<meta name="keywords" content="self portraits, photo diary, personal tracking, themes, gallery upload">

<!-- 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.

let currentDay = 0;
const images = [];

document.addEventListener("DOMContentLoaded", function() {
const uploadForm = document.getElementById("upload-form");
const portraitList = document.getElementById("portrait-list");
const message = document.getElementById("message");
const themeInput = document.getElementById("theme");

uploadForm.onsubmit = function(e) {
e.preventDefault();
const fullName = document.getElementById("full-name").value;
const gender = document.querySelector('input[name="gender"]:checked').value;
const fileInput = document.getElementById("image-upload");

if (currentDay < 365 && fileInput.files.length > 0) {
const file = fileInput.files[0];
const theme = themeInput.value.trim();
const imageURL = URL.createObjectURL(file);
displayPortrait(imageURL, theme, fullName, gender);
images.push({ imageURL, theme, fullName, gender });
currentDay++;

if (currentDay === 365) {
showMessage();
}

uploadForm.reset();
} else if (currentDay >= 365) {
alert("You've already added your 365 self portraits!");
} else {
alert("Please select an image!");
}
};

function displayPortrait(imageURL, theme, fullName, gender) {
const card = `<div class="card m-2" style="width: 18rem;">
<img src="${imageURL}" class="card-img-top" alt="${fullName}'s Self Portrait">
<div class="card-body">
<h5 class="card-title">${fullName} (${gender})</h5>
<p class="card-text">Theme: ${theme}</p>
</div>
</div>`;
portraitList.innerHTML += card;
}

function showMessage() {
message.innerHTML = `<div class="alert alert-success mt-3">Hope you have 365 Self Portraits in April 21 2008 - April 20 2009!</div>`;
}
});

} catch (error) {
// This will throw the error to the parent window.
throw error;
}
</script>

<style>
body {
background: linear-gradient(90deg, #ffefba, #ffffff);
color: #333;
}
#main-container {
margin-top: 50px;
}
#portrait-list {
display: flex;
flex-wrap: wrap;
justify-content: center;
margin-top: 20px;
}
.card {
transition: transform 0.2s;
}
.card:hover {
transform: scale(1.05);
}
#message {
margin-top: 20px;
text-align: center;
}
</style>
</head>
<body>
<div id="main-container" class="container">
<h1 class="text-center">365 Self Portraits Tracker</h1>
<form id="upload-form" class="text-center mt-4">
<div class="mb-3">
<input type="text" id="full-name" class="form-control" placeholder="Full Name" required>
</div>
<div class="mb-3">
<label>Gender:</label><br>
<label><input type="radio" name="gender" value="Male" checked> Male</label>
<label><input type="radio" name="gender" value="Female"> Female</label>
<label><input type="radio" name="gender" value="Other"> Other</label>
</div>
<div class="mb-3">
<input type="file" id="image-upload" accept="image/*" class="form-control" required>
</div>
<div class="mb-3">
<input type="text" id="theme" class="form-control" placeholder="Theme" required>
</div>
<button type="submit" class="btn btn-primary">Add Self Portrait</button>
</form>
<div id="portrait-list" class="mt-4"></div>
<div id="message"></div>
</div>
</body>
</html>