-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathscript.js
More file actions
114 lines (99 loc) · 3.93 KB
/
Copy pathscript.js
File metadata and controls
114 lines (99 loc) · 3.93 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
function initCountdown() {
const examDate = new Date('June 1, 2026 10:00:00').getTime();
const counterElement = document.querySelector('.counter');
if (!counterElement) {
return;
}
const timer = setInterval(() => {
const now = new Date().getTime();
const distance = examDate - now;
const hours = Math.floor(distance / (1000 * 60 * 60));
counterElement.innerHTML = hours.toLocaleString();
if (distance < 0) {
clearInterval(timer);
counterElement.innerHTML = '<a href="couple.mp4" target="_blank" rel="noopener noreferrer">Наши выпускники</a>';
}
}, 1000);
}
function toggleTheme(isDark) {
const body = document.body;
const sunIcon = document.querySelector('.sun');
const moonIcon = document.querySelector('.moon');
body.classList.toggle('dark-theme', isDark);
sunIcon.style.opacity = isDark ? '0' : '1';
moonIcon.style.opacity = isDark ? '1' : '0';
}
document.addEventListener('DOMContentLoaded', () => {
const themeSwitch = document.getElementById('theme-switch');
if (themeSwitch) {
themeSwitch.checked = false;
toggleTheme(false);
themeSwitch.addEventListener('change', (e) => {
toggleTheme(e.target.checked);
});
}
initCountdown();
loadFipiNews();
const navButtons = document.querySelectorAll('.nav-btn');
if (navButtons[0]) {
navButtons[0].addEventListener('click', () => {
window.open('https://chat.infolimp.keenetic.pro', '_blank');
});
}
if (navButtons[1]) {
navButtons[1].addEventListener('click', () => {
window.open('https://t.me/infolimp_bot', '_blank');
});
}
if (navButtons[2]) {
navButtons[2].addEventListener('click', () => {
window.open('https://nickscherbakov.github.io/very-simple-tetris-created-by-Copilot/', '_blank');
});
}
navButtons.forEach(button => {
button.addEventListener('mouseenter', () => {
button.classList.add('hovered');
});
button.addEventListener('mouseleave', () => {
button.classList.remove('hovered');
});
});
});
function loadFipiNews() {
const newsContainer = document.querySelector('.news-feed');
if (!newsContainer) {
return;
}
const newsItems = [
{
date: '12.12.2024',
title: 'Онлайн-консультации по информатике для подготовки к ЕГЭ-2025',
link: 'https://www.youtube.com/watch?v=P9RDcMKU2dI'
},
{
date: '16.10.2024',
title: 'Онлайн-консультации по подготовке к ЕГЭ-2025',
link: 'https://fipi.ru/ege/videokonsultatsii-razrabotchikov-kim-yege'
},
{
date: '05.09.2024',
title: 'Методические рекомендации для учителей на основе анализа результатов ЕГЭ 2024 года',
link: 'https://fipi.ru/ege/analiticheskie-i-metodicheskie-materialy'
},
{
date: '23.08.2024',
title: 'Проекты КИМ ЕГЭ 2025 года',
link: 'https://fipi.ru/ege/demoversii-specifikacii-kodifikatory'
}
];
newsItems.forEach(news => {
const newsElement = document.createElement('div');
newsElement.classList.add('news-item');
newsElement.innerHTML = `
<span class="news-date">${news.date}</span>
<a href="${news.link}" target="_blank" rel="noopener noreferrer" class="news-link">${news.title}</a>
`;
newsContainer.appendChild(newsElement);
});
}
// CSS styles moved to a separate stylesheet for better maintainability