mmm / index.html
Tuna11's picture
don't put your own options about the course content. i will enter everything manually. this program is for 1 day. so you don't need to take other days into account. you can just add a delete day option to the site. specify that day in the form of an excel table. remove the hints. and add this quote by ataturk at the bottom of the site: Hiçbir şeye ihtiyacımız yok, yalnız bir şeye ihtiyacımız vardır; çalışkan olmak! - Initial Deployment
40628c4 verified
Raw History Blame Contribute Delete
17.7 kB
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Study Program Planner</title>
<script src="https://cdn.tailwindcss.com"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/jspdf/2.5.1/jspdf.umd.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/html2canvas/1.4.1/html2canvas.min.js"></script>
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css">
<style>
.time-slot {
transition: all 0.3s ease;
}
.time-slot:hover {
transform: scale(1.02);
box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}
.subject-color {
width: 12px;
height: 12px;
border-radius: 50%;
display: inline-block;
margin-right: 8px;
}
#schedule-graph {
scrollbar-width: thin;
scrollbar-color: #cbd5e0 #f7fafc;
}
#schedule-graph::-webkit-scrollbar {
height: 8px;
}
#schedule-graph::-webkit-scrollbar-track {
background: #f7fafc;
}
#schedule-graph::-webkit-scrollbar-thumb {
background-color: #cbd5e0;
border-radius: 4px;
}
.day-column {
min-width: 200px;
}
@media (max-width: 768px) {
.day-column {
min-width: 150px;
}
}
</style>
</head>
<body class="bg-gray-50 min-h-screen">
<div class="container mx-auto px-4 py-8">
<header class="mb-8 text-center">
<h1 class="text-3xl md:text-4xl font-bold text-indigo-700 mb-2">Study Program Planner</h1>
<p class="text-gray-600 max-w-2xl mx-auto">Visualize and organize your study schedule with this interactive planner. Track your progress and optimize your learning time.</p>
</header>
<div class="bg-white rounded-xl shadow-lg p-6 mb-8">
<div class="flex flex-wrap justify-between items-center mb-6">
<h2 class="text-xl font-semibold text-gray-800">Create Your Schedule</h2>
<div class="flex space-x-2 mt-2 sm:mt-0">
<button id="add-day-btn" class="bg-indigo-100 hover:bg-indigo-200 text-indigo-700 px-4 py-2 rounded-lg flex items-center">
<i class="fas fa-plus mr-2"></i> Add Day
</button>
<button id="reset-btn" class="bg-red-100 hover:bg-red-200 text-red-700 px-4 py-2 rounded-lg flex items-center">
<i class="fas fa-trash-alt mr-2"></i> Reset
</button>
</div>
</div>
<div class="mb-6">
<div class="grid grid-cols-1 md:grid-cols-2 gap-4">
<div>
<label class="block text-sm font-medium text-gray-700 mb-1">Select Subject</label>
<select id="subject-select" class="w-full border border-gray-300 rounded-lg px-4 py-2 focus:ring-indigo-500 focus:border-indigo-500">
<option value="" disabled selected>Choose a subject</option>
<option value="Mathematics" data-color="bg-red-500">Mathematics</option>
<option value="Physics" data-color="bg-blue-500">Physics</option>
<option value="Chemistry" data-color="bg-green-500">Chemistry</option>
<option value="Biology" data-color="bg-yellow-500">Biology</option>
<option value="History" data-color="bg-purple-500">History</option>
<option value="Literature" data-color="bg-pink-500">Literature</option>
<option value="Computer Science" data-color="bg-indigo-500">Computer Science</option>
<option value="Language" data-color="bg-teal-500">Language</option>
</select>
</div>
<div>
<label class="block text-sm font-medium text-gray-700 mb-1">Duration (minutes)</label>
<input type="number" id="duration-input" min="15" max="240" value="60" class="w-full border border-gray-300 rounded-lg px-4 py-2 focus:ring-indigo-500 focus:border-indigo-500">
</div>
</div>
</div>
<div id="schedule-graph" class="overflow-x-auto pb-4">
<div id="days-container" class="flex space-x-4 min-w-max">
<!-- Days will be added here dynamically -->
</div>
</div>
<div class="mt-8 pt-6 border-t border-gray-200">
<div class="flex justify-between items-center">
<div>
<h3 class="text-lg font-medium text-gray-800">Daily Study Summary</h3>
<p id="total-time" class="text-2xl font-bold text-indigo-600">Total: 0 hours 0 minutes</p>
</div>
<button id="export-pdf" class="bg-indigo-600 hover:bg-indigo-700 text-white px-6 py-3 rounded-lg flex items-center">
<i class="fas fa-file-pdf mr-2"></i> Export as PDF
</button>
</div>
</div>
</div>
<div class="bg-white rounded-xl shadow-lg p-6">
<h2 class="text-xl font-semibold text-gray-800 mb-4">Study Tips</h2>
<div class="grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-4">
<div class="bg-blue-50 p-4 rounded-lg">
<h3 class="font-medium text-blue-700 mb-2"><i class="fas fa-clock mr-2"></i> Time Management</h3>
<p class="text-gray-700 text-sm">Use the Pomodoro technique: 25 minutes of focused study followed by a 5-minute break.</p>
</div>
<div class="bg-green-50 p-4 rounded-lg">
<h3 class="font-medium text-green-700 mb-2"><i class="fas fa-brain mr-2"></i> Active Recall</h3>
<p class="text-gray-700 text-sm">Test yourself frequently instead of just re-reading material to strengthen memory.</p>
</div>
<div class="bg-yellow-50 p-4 rounded-lg">
<h3 class="font-medium text-yellow-700 mb-2"><i class="fas fa-book-open mr-2"></i> Spaced Repetition</h3>
<p class="text-gray-700 text-sm">Review material at increasing intervals to improve long-term retention.</p>
</div>
</div>
</div>
</div>
<script>
// Initialize jsPDF
const { jsPDF } = window.jspdf;
document.addEventListener('DOMContentLoaded', function() {
const daysContainer = document.getElementById('days-container');
const addDayBtn = document.getElementById('add-day-btn');
const resetBtn = document.getElementById('reset-btn');
const subjectSelect = document.getElementById('subject-select');
const durationInput = document.getElementById('duration-input');
const totalTimeDisplay = document.getElementById('total-time');
const exportPdfBtn = document.getElementById('export-pdf');
let days = [];
let totalStudyTime = 0;
// Sample days for initial display
const sampleDays = ['Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday'];
// Add sample days on initial load
sampleDays.forEach(day => {
addDay(day);
});
// Add day function
function addDay(dayName) {
const dayId = `day-${Date.now()}`;
const dayElement = document.createElement('div');
dayElement.className = 'day-column bg-gray-50 rounded-lg p-4';
dayElement.id = dayId;
dayElement.innerHTML = `
<div class="flex justify-between items-center mb-4">
<h3 class="font-medium text-gray-800">${dayName}</h3>
<button class="add-slot-btn text-indigo-600 hover:text-indigo-800 p-1 rounded-full">
<i class="fas fa-plus-circle"></i>
</button>
</div>
<div class="time-slots space-y-3">
<!-- Time slots will be added here -->
</div>
<div class="mt-4 pt-2 border-t border-gray-200">
<p class="text-sm text-gray-600 day-total">Total: 0h 0m</p>
</div>
`;
daysContainer.appendChild(dayElement);
days.push({ id: dayId, name: dayName, slots: [], totalTime: 0 });
// Add event listener to the add slot button
dayElement.querySelector('.add-slot-btn').addEventListener('click', function() {
addTimeSlot(dayId);
});
}
// Add time slot function
function addTimeSlot(dayId) {
const subject = subjectSelect.value;
const duration = parseInt(durationInput.value);
if (!subject) {
alert('Please select a subject first');
return;
}
if (isNaN(duration) || duration < 15) {
alert('Please enter a valid duration (minimum 15 minutes)');
return;
}
const colorClass = subjectSelect.options[subjectSelect.selectedIndex].getAttribute('data-color');
const slotId = `slot-${Date.now()}`;
const dayIndex = days.findIndex(day => day.id === dayId);
if (dayIndex === -1) return;
const newSlot = {
id: slotId,
subject,
duration,
colorClass
};
days[dayIndex].slots.push(newSlot);
days[dayIndex].totalTime += duration;
totalStudyTime += duration;
updateDayDisplay(dayId);
updateTotalTimeDisplay();
// Scroll to the new slot
setTimeout(() => {
const slotElement = document.getElementById(slotId);
if (slotElement) {
slotElement.scrollIntoView({ behavior: 'smooth', block: 'nearest' });
}
}, 100);
}
// Update day display
function updateDayDisplay(dayId) {
const dayIndex = days.findIndex(day => day.id === dayId);
if (dayIndex === -1) return;
const day = days[dayIndex];
const dayElement = document.getElementById(dayId);
if (!dayElement) return;
const timeSlotsContainer = dayElement.querySelector('.time-slots');
timeSlotsContainer.innerHTML = '';
day.slots.forEach(slot => {
const hours = Math.floor(slot.duration / 60);
const minutes = slot.duration % 60;
const durationText = hours > 0 ? `${hours}h ${minutes}m` : `${minutes}m`;
const slotElement = document.createElement('div');
slotElement.className = `time-slot bg-white border-l-4 ${slot.colorClass} border-l-4 p-3 rounded-lg shadow-sm flex justify-between items-center`;
slotElement.id = slot.id;
slotElement.innerHTML = `
<div>
<span class="subject-color ${slot.colorClass}"></span>
<span class="font-medium">${slot.subject}</span>
</div>
<div class="flex items-center space-x-2">
<span class="text-sm text-gray-600">${durationText}</span>
<button class="delete-slot-btn text-gray-400 hover:text-red-500 p-1">
<i class="fas fa-times"></i>
</button>
</div>
`;
timeSlotsContainer.appendChild(slotElement);
// Add event listener to delete button
slotElement.querySelector('.delete-slot-btn').addEventListener('click', function() {
deleteTimeSlot(dayId, slot.id);
});
});
// Update day total
const dayTotalElement = dayElement.querySelector('.day-total');
const totalHours = Math.floor(day.totalTime / 60);
const totalMinutes = day.totalTime % 60;
dayTotalElement.textContent = `Total: ${totalHours}h ${totalMinutes}m`;
}
// Delete time slot
function deleteTimeSlot(dayId, slotId) {
const dayIndex = days.findIndex(day => day.id === dayId);
if (dayIndex === -1) return;
const slotIndex = days[dayIndex].slots.findIndex(slot => slot.id === slotId);
if (slotIndex === -1) return;
// Subtract the duration from totals
const slotDuration = days[dayIndex].slots[slotIndex].duration;
days[dayIndex].totalTime -= slotDuration;
totalStudyTime -= slotDuration;
// Remove the slot
days[dayIndex].slots.splice(slotIndex, 1);
updateDayDisplay(dayId);
updateTotalTimeDisplay();
}
// Update total time display
function updateTotalTimeDisplay() {
const totalHours = Math.floor(totalStudyTime / 60);
const totalMinutes = totalStudyTime % 60;
totalTimeDisplay.textContent = `Total: ${totalHours} hours ${totalMinutes} minutes`;
}
// Event listeners
addDayBtn.addEventListener('click', function() {
const dayName = prompt('Enter day name:');
if (dayName && dayName.trim() !== '') {
addDay(dayName.trim());
}
});
resetBtn.addEventListener('click', function() {
if (confirm('Are you sure you want to reset the entire schedule?')) {
daysContainer.innerHTML = '';
days = [];
totalStudyTime = 0;
updateTotalTimeDisplay();
// Re-add sample days
sampleDays.forEach(day => {
addDay(day);
});
}
});
exportPdfBtn.addEventListener('click', function() {
// Get the schedule element
const scheduleElement = document.querySelector('.container');
// Use html2canvas to capture the element as an image
html2canvas(scheduleElement).then(canvas => {
// Create a new PDF
const pdf = new jsPDF('p', 'mm', 'a4');
const imgData = canvas.toDataURL('image/png');
// Calculate dimensions to fit the PDF
const pdfWidth = pdf.internal.pageSize.getWidth();
const pdfHeight = pdf.internal.pageSize.getHeight();
const imgWidth = canvas.width;
const imgHeight = canvas.height;
const ratio = Math.min(pdfWidth / imgWidth, pdfHeight / imgHeight);
const finalWidth = imgWidth * ratio * 0.9;
const finalHeight = imgHeight * ratio * 0.9;
// Add the image to the PDF
pdf.addImage(imgData, 'PNG', (pdfWidth - finalWidth) / 2, 10, finalWidth, finalHeight);
// Save the PDF
pdf.save('study-schedule.pdf');
});
});
});
</script>
<p style="border-radius: 8px; text-align: center; font-size: 12px; color: #fff; margin-top: 16px;position: fixed; left: 8px; bottom: 8px; z-index: 10; background: rgba(0, 0, 0, 0.8); padding: 4px 8px;">Made with <img src="https://enzostvs-deepsite.hf.space/logo.svg" alt="DeepSite Logo" style="width: 16px; height: 16px; vertical-align: middle;display:inline-block;margin-right:3px;filter:brightness(0) invert(1);"><a href="https://enzostvs-deepsite.hf.space" style="color: #fff;text-decoration: underline;" target="_blank" >DeepSite</a> - 🧬 <a href="https://enzostvs-deepsite.hf.space?remix=Tuna11/mmm" style="color: #fff;text-decoration: underline;" target="_blank" >Remix</a></p></body>
</html>