-
Notifications
You must be signed in to change notification settings - Fork 2.8k
Description
const subjects = ["Нийгмийн бүтэц","Улс төр","Хууль","Эдийн засаг","Соёл"];
const motivationalMessages = [
"Өнөөдөр чиний өдөр! 💪",
"Бид чадна! 🌟",
"ЭЭШ-д ойрхон байна! 🚀",
"Сайн хийж байна, үргэлжлүүл! ✨",
"Бэлтгэл чинь үр дүнгээ өгнө! 🔥"
];
const completed = {};
const subjectsDiv = document.getElementById("subjects");
const completedList = document.getElementById("completedList");
const countdownEl = document.getElementById("countdown");
const motivationEl = document.getElementById("motivation");
const quizDiv = document.getElementById("quiz");
// Өдрийн хичээлүүдийг үүсгэх
subjects.forEach(subj=>{
const div = document.createElement("div");
div.textContent = subj;
const checkbox = document.createElement("input");
checkbox.type = "checkbox";
checkbox.addEventListener("change", ()=>{
completed[subj] = checkbox.checked;
renderCompleted();
});
div.appendChild(checkbox);
subjectsDiv.appendChild(div);
});
// Completed list render
function renderCompleted(){
completedList.innerHTML = "";
for(const key in completed){
const li = document.createElement("li");
li.textContent = key + ": " + (completed[key]?"Дууссан":"Хийж байна");
if(completed[key]) li.style.textDecoration = "line-through";
completedList.appendChild(li);
}
}
// Countdown
const eeshDate = new Date();
eeshDate.setDate(eeshDate.getDate() + 140);
function updateCountdown(){
const now = new Date();
const diff = eeshDate - now;
const days = Math.floor(diff / (1000606024));
countdownEl.textContent = days + " өдөр ЭЕШ хүртэл";
}
updateCountdown();
setInterval(updateCountdown,100060*60);
// Урмын үг
function updateMotivation(){
const msg = motivationalMessages[Math.floor(Math.random()motivationalMessages.length)];
motivationEl.textContent = msg;
}
updateMotivation();
setInterval(updateMotivation,100060*60);
// Quiz (5 асуулт жишээ)
for(let i=1;i<=5;i++){
const qDiv = document.createElement("div");
const p = document.createElement("p");
p.textContent = "Асуулт " + i;
const input = document.createElement("input");
input.type="text";
input.placeholder="Хариулт бичнэ үү";
qDiv.appendChild(p);
qDiv.appendChild(input);
quizDiv.appendChild(qDiv);
}