From f6c1fde9d055efc5eb2c4484d57c82a48942810a Mon Sep 17 00:00:00 2001 From: Kosuri Indu <118645569+kosuri-indu@users.noreply.github.com> Date: Thu, 8 Aug 2024 19:06:22 +0530 Subject: [PATCH] Added: Time Capsule Center(VanillaJS) (#749) * Added: Time Capsule Center(VanillaJS) * Review changes --- .../Time-Capsule-Center/README.md | 68 ++++++ .../Time-Capsule-Center/index.html | 77 +++++++ .../Time-Capsule-Center/screenshot.webp | Bin 0 -> 18126 bytes .../Time-Capsule-Center/script.js | 214 ++++++++++++++++++ .../Time-Capsule-Center/style.css | 156 +++++++++++++ Vanilla-JS-Projects/README.md | 2 +- 6 files changed, 516 insertions(+), 1 deletion(-) create mode 100644 Vanilla-JS-Projects/Intermediate/Time-Capsule-Center/README.md create mode 100644 Vanilla-JS-Projects/Intermediate/Time-Capsule-Center/index.html create mode 100644 Vanilla-JS-Projects/Intermediate/Time-Capsule-Center/screenshot.webp create mode 100644 Vanilla-JS-Projects/Intermediate/Time-Capsule-Center/script.js create mode 100644 Vanilla-JS-Projects/Intermediate/Time-Capsule-Center/style.css diff --git a/Vanilla-JS-Projects/Intermediate/Time-Capsule-Center/README.md b/Vanilla-JS-Projects/Intermediate/Time-Capsule-Center/README.md new file mode 100644 index 00000000..278f34ed --- /dev/null +++ b/Vanilla-JS-Projects/Intermediate/Time-Capsule-Center/README.md @@ -0,0 +1,68 @@ +
+ + + +
+ +Total Capsules: 0
+Total Messages: 0
+Total Images: 0
+Total Videos: 0
+V^JD zx&PQt1_42cKXP-W61;q&T03jdqjuk+0QL(RvK>0=Adzu0AIo%oH-_KcGnd^RJtqvVEm93;Jh{{a#|P4C9|U2e%DH4bT39{$nr`c1B!(HIzhG zrOx1&nK^S-iuxWHVwD_|R0ji8^`{AU`b0YP%R?dNU-%#!NcghgJ>If*1_%?>*=VFh zVYxPc;vu^B;9anq%4`3Xv%m9`eE6S;AbpN#Um=)hI@tL$;bX4faRV+dMy+7@Kj8HT zShn)b$|w7bVaTxKmI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Kox8Cb~4?RX|H1BFz#;A+Z>> z0|1coW&!{hn~y%y&sFlHt?lH(>QNT(AnJd;D|Nb=nwLPeYoFhiF=0#^*|TR)9s7Hu z#Z-Z)-_G&j`D?pQ#r)CDyN2g8+at*_4GBUrKBuMAs8JXI2y_z?%cM7ZyWDEp8@w^< zZSdd6OF6qD%#~NS$#fN|wurm@&+HxgNTRHGvF|;wUpWWfu7Jrk4!g~tcx(MXtn`-n literal 0 HcmV?d00001 diff --git a/Vanilla-JS-Projects/Intermediate/Time-Capsule-Center/script.js b/Vanilla-JS-Projects/Intermediate/Time-Capsule-Center/script.js new file mode 100644 index 00000000..075d3db9 --- /dev/null +++ b/Vanilla-JS-Projects/Intermediate/Time-Capsule-Center/script.js @@ -0,0 +1,214 @@ +document.addEventListener('DOMContentLoaded', () => { + const form = document.getElementById('timeCapsuleForm'); + const capsuleList = document.getElementById('capsuleList'); + const searchBar = document.getElementById('searchBar'); + const notification = document.getElementById('notification'); + const statisticsContainer = document.getElementById('statisticsContainer'); + let capsules = []; + + form.addEventListener('submit', (e) => { + e.preventDefault(); + + const capsuleName = document.getElementById('capsuleName').value; + const openDate = new Date(document.getElementById('openDate').value); + const tags = document.getElementById('tags').value.split(',').map(tag => tag.trim()); + const message = document.getElementById('message').value; + const image = document.getElementById('image').files[0]; + const video = document.getElementById('video').files[0]; + + const capsule = { + name: capsuleName, + openDate: openDate, + tags: tags, + message: message, + image: image ? URL.createObjectURL(image) : null, + video: video ? URL.createObjectURL(video) : null, + }; + + capsules.push(capsule); + updateDashboard(); + updateStatistics(); + showNotification('New capsule added successfully!'); + form.reset(); + }); + + searchBar.addEventListener('input', updateDashboard); + + function updateDashboard() { + capsuleList.innerHTML = ''; + const searchQuery = searchBar.value.toLowerCase(); + const filteredCapsules = capsules.filter(capsule => + capsule.name.toLowerCase().includes(searchQuery) || + capsule.tags.some(tag => tag.toLowerCase().includes(searchQuery)) + ); + + filteredCapsules.forEach((capsule, index) => { + const capsuleItem = document.createElement('div'); + capsuleItem.classList.add('capsule-item'); + + const nameSpan = document.createElement('span'); + nameSpan.textContent = capsule.name; + capsuleItem.appendChild(nameSpan); + + const dateSpan = document.createElement('span'); + dateSpan.textContent = capsule.openDate.toDateString(); + capsuleItem.appendChild(dateSpan); + + const tagsSpan = document.createElement('span'); + tagsSpan.textContent = capsule.tags.join(', '); + capsuleItem.appendChild(tagsSpan); + + const countdownSpan = document.createElement('span'); + countdownSpan.id = `countdown${index}`; + capsuleItem.appendChild(countdownSpan); + + const editButton = document.createElement('button'); + editButton.classList.add('edit-btn'); + editButton.textContent = 'Delete'; + editButton.addEventListener('click', () => editCapsule(index)); + capsuleItem.appendChild(editButton); + + capsuleItem.addEventListener('click', (e) => { + if (e.target.tagName !== 'BUTTON') { + showCapsuleDetails(capsule); + } + }); + + capsuleList.appendChild(capsuleItem); + updateCountdown(capsule, index); + }); + } + + function updateCountdown(capsule, index) { + const countdownElement = document.getElementById(`countdown${index}`); + const interval = setInterval(() => { + const now = new Date(); + const distance = capsule.openDate - now; + + if (distance < 0) { + clearInterval(interval); + countdownElement.textContent = 'Available to open'; + return; + } + + const days = Math.floor(distance / (1000 * 60 * 60 * 24)); + const hours = Math.floor((distance % (1000 * 60 * 60 * 24)) / (1000 * 60 * 60)); + const minutes = Math.floor((distance % (1000 * 60 * 60)) / (1000 * 60)); + const seconds = Math.floor((distance % (1000 * 60)) / 1000); + + countdownElement.textContent = `${days}d ${hours}h ${minutes}m ${seconds}s`; + }, 1000); + } + + function showCapsuleDetails(capsule) { + const modal = document.getElementById('capsuleModal'); + const modalCapsuleName = document.getElementById('modalCapsuleName'); + const modalCapsuleMessage = document.getElementById('modalCapsuleMessage'); + const modalCapsuleImage = document.getElementById('modalCapsuleImage'); + const modalCapsuleVideo = document.getElementById('modalCapsuleVideo'); + const closeBtn = document.querySelector('.close'); + + if (new Date() < capsule.openDate) { + alert('This capsule cannot be opened yet.'); + return; + } + + modalCapsuleName.textContent = capsule.name; + modalCapsuleMessage.textContent = capsule.message; + + if (capsule.image) { + modalCapsuleImage.style.display = 'block'; + } else { + modalCapsuleImage.style.display = 'none'; + } + + if (capsule.video) { + modalCapsuleVideo.style.display = 'block'; + } else { + modalCapsuleVideo.style.display = 'none'; + } + + modal.style.display = 'block'; + + closeBtn.onclick = function () { + modal.style.display = 'none'; + }; + + window.onclick = function (event) { + if (event.target == modal) { + modal.style.display = 'none'; + } + }; + } + + function editCapsule(index) { + const capsule = capsules[index]; + document.getElementById('capsuleName').value = capsule.name; + document.getElementById('openDate').value = capsule.openDate.toISOString().split('T')[0]; + document.getElementById('tags').value = capsule.tags.join(', '); + document.getElementById('message').value = capsule.message; + capsules.splice(index, 1); + updateDashboard(); + updateStatistics(); + } + + function showNotification(message) { + notification.textContent = message; + notification.style.display = 'block'; + setTimeout(() => { + notification.style.display = 'none'; + }, 3000); + } + + function updateStatistics() { + const totalCapsules = capsules.length; + const tagCounts = capsules.reduce((acc, capsule) => { + capsule.tags.forEach(tag => { + acc[tag] = (acc[tag] || 0) + 1; + }); + return acc; + }, {}); + + const mostCommonTags = Object.entries(tagCounts) + .sort((a, b) => b[1] - a[1]) + .slice(0, 5) + .map(([tag, count]) => `${tag} (${count})`) + .join(', '); + + const dateCounts = capsules.reduce((acc, capsule) => { + const date = capsule.openDate.toDateString(); + acc[date] = (acc[date] || 0) + 1; + return acc; + }, {}); + + const distribution = Object.entries(dateCounts) + .map(([date, count]) => `${date}: ${count}`) + .join('
'); + + statisticsContainer.innerHTML = ''; + const statsTitle = document.createElement('h3'); + statsTitle.textContent = 'Capsule Statistics'; + statisticsContainer.appendChild(statsTitle); + + const totalCapsulesP = document.createElement('p'); + totalCapsulesP.textContent = `Total Capsules: ${totalCapsules}`; + statisticsContainer.appendChild(totalCapsulesP); + + const mostCommonTagsP = document.createElement('p'); + mostCommonTagsP.textContent = `Most Common Tags: ${mostCommonTags}`; + statisticsContainer.appendChild(mostCommonTagsP); + + const distributionP = document.createElement('p'); + distributionP.innerHTML = `Distribution by Opening Date:
${distribution}`; + statisticsContainer.appendChild(distributionP); + } + + document.querySelectorAll('.nav-link').forEach(link => { + link.addEventListener('click', function () { + document.querySelectorAll('.page').forEach(page => page.classList.remove('active')); + document.querySelector(this.getAttribute('href')).classList.add('active'); + }); + }); + + document.getElementById('addCapsule').classList.add('active'); +}); \ No newline at end of file diff --git a/Vanilla-JS-Projects/Intermediate/Time-Capsule-Center/style.css b/Vanilla-JS-Projects/Intermediate/Time-Capsule-Center/style.css new file mode 100644 index 00000000..298de640 --- /dev/null +++ b/Vanilla-JS-Projects/Intermediate/Time-Capsule-Center/style.css @@ -0,0 +1,156 @@ +body { + font-family: 'Roboto', sans-serif; + background-color: #f0f2f5; + margin: 0; + padding: 0; + color: #333; +} +header { + background-color: #4a90e2; + color: white; + padding: 20px; + text-align: center; +} +header nav ul { + list-style: none; + padding: 0; +} +header nav ul li { + display: inline; + margin: 0 10px; +} +header nav ul li a { + color: white; + text-decoration: none; + font-weight: bold; +} +header nav ul li a:hover { + text-decoration: underline; +} +.container { + max-width: 900px; + margin: 40px auto; + padding: 20px; + background: #fff; + border-radius: 8px; + box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1); +} +h1, h2 { + text-align: center; + color: #4a90e2; + margin-bottom: 20px; +} +.form-container { + margin-bottom: 30px; +} +form { + display: flex; + flex-direction: column; + gap: 15px; +} +label { + font-weight: bold; + margin-bottom: 5px; +} +input, textarea, button { + padding: 12px; + border: 1px solid #ddd; + border-radius: 4px; + font-size: 16px; +} +input:focus, textarea:focus { + border-color: #4a90e2; + outline: none; + box-shadow: 0 0 5px rgba(74, 144, 226, 0.5); +} +button { + background-color: #4a90e2; + color: white; + border: none; + cursor: pointer; +} +button:hover { + background-color: #357ab8; +} +.dashboard-container { + margin-bottom: 30px; +} +#capsuleCount, #lastCapsuleTime, #nextCapsuleCountdown { + font-size: 18px; + margin-bottom: 15px; +} +#capsuleList { + margin-top: 20px; +} +.capsule-item { + padding: 15px; + border-bottom: 1px solid #ddd; + display: flex; + justify-content: space-between; + align-items: center; + cursor: pointer; +} +.capsule-item span { + display: block; + font-size: 16px; +} +.capsule-item span:first-child { + font-weight: bold; + color: #4a90e2; +} +.modal { + display: none; + position: fixed; + z-index: 1; + left: 0; + top: 0; + width: 100%; + height: 100%; + overflow: auto; + background-color: rgb(0,0,0); + background-color: rgba(0,0,0,0.4); +} +.modal-content { + background-color: #fefefe; + margin: 15% auto; + padding: 20px; + border: 1px solid #888; + width: 80%; + max-width: 600px; + border-radius: 8px; +} +.close { + color: #aaa; + float: right; + font-size: 28px; + font-weight: bold; +} +.close:hover, +.close:focus { + color: black; + text-decoration: none; + cursor: pointer; +} +.chart-container { + position: relative; + margin: 20px auto; + height: 400px; + width: 80%; +} +.notification { + display: none; + position: fixed; + bottom: 20px; + right: 20px; + background-color: #4a90e2; + color: white; + padding: 15px; + border-radius: 5px; + box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1); +} +.page { + display: none; +} +.page.active { + display: block; +} \ No newline at end of file diff --git a/Vanilla-JS-Projects/README.md b/Vanilla-JS-Projects/README.md index d9294454..c99c9fe2 100644 --- a/Vanilla-JS-Projects/README.md +++ b/Vanilla-JS-Projects/README.md @@ -116,7 +116,7 @@ | 89 | [Travel-Journal](./Intermediate/Travel-Journal/) | ![Intermediate](https://img.shields.io/badge/Intermediate-FFD700?style=for-the-badge) | | 90 | [Bulb-On-Off](./Basic/Bulb-On-Off/) | ![Basic](https://img.shields.io/badge/Basic-00FF00?style=for-the-badge) | | 91 | [Theme Cake Order Form](./Basic/Theme-Cake-Order-Form/) | ![Basic](https://img.shields.io/badge/Basic-00FF00?style=for-the-badge) | - +| 92 | [Time-Capsule-Center](./Intermediate/Time-Capsule-Center/) | ![Intermediate](https://img.shields.io/badge/Intermediate-FFD700?style=for-the-badge) |