diff --git a/.gitignore b/.gitignore
new file mode 100644
index 0000000..489ba42
--- /dev/null
+++ b/.gitignore
@@ -0,0 +1,9 @@
+
+
+*.zip
+META-INF/mozilla.rsa
+META-INF/cose.manifest
+META-INF/cose.sig
+META-INF/manifest.mf
+META-INF/mozilla.sf
+dashboard/KRÉTA Iskolai Alaprendszer.html
diff --git a/.idea/Firkaextension.iml b/.idea/Firkaextension.iml
new file mode 100644
index 0000000..d6ebd48
--- /dev/null
+++ b/.idea/Firkaextension.iml
@@ -0,0 +1,9 @@
+
+
+
+
+
+
+
+
+
+ Modern, testre szabható felhasználói felület az e-KRÉTA rendszerhez +
+ + + +## 📱 Funkciók + +- **Modern Dizájn**: Teljesen újratervezett, modern felhasználói felület +- **Személyre Szabható Témák**: Világos és sötét módok, kék és zöld színsémákkal +- **Továbbfejlesztett Felületek**: + - Átdolgozott bejelentkezési képernyő + - Átláthatóbb jegynapló + - Modernizált órarend + - Fejlett hiányzás kezelés + - Egyszerűsített szerepkör választó + - Új kezdőlap elrendezés + - Továbbfejlesztett profilkezelő + +## 🚀 Telepítés + +1. Töltsd le a legfrissebb verziót a [Releases](https://github.com/Zan1456/filc-extension/releases) oldalról +2. Csomagold ki a letöltött fájlt +3. Chrome böngészőben navigálj a `chrome://extensions` oldalra +4. Kapcsold be a "Fejlesztői mód"-ot a jobb felső sarokban +5. Kattints a "Kicsomagolt bővítmény betöltése" gombra +6. Válaszd ki a kicsomagolt mappát +7. Kész! A bővítmény automatikusan működésbe lép, amikor megnyitod az e-KRÉTA oldalt + +## ⚙️ Beállítások + +A bővítmény beállításait a böngésző eszköztárán található Filx ikonra kattintva érheted el. Itt módosíthatod: + +- A felület színsémáját (Világos/Sötét) +- Az fő színeket (Kék/Zöld) + +## 💡 Támogatott Oldalak + +A bővítmény jelenleg az alábbi e-KRÉTA oldalakat támogatja: + +- Bejelentkezési oldal +- Kijelentkezési oldal +- Szerepkör választó +- Elfelejtett jelszó (részlegesen) +- Kezdőlap/Faliújság +- Jegyek/Értékelések +- Órarend +- Hiányzások +- Profil (csak dizájn) + +## 👥 Csapat + +- **[Zan1456](https://github.com/Zan1456)** - Vezető Fejlesztő +- **[BalazsManus](https://github.com/BalazsManus)** - Fejlesztő +- **[Xou](https://github.com/Xou)** - Designer + +## 🤝 Közreműködés + +Örömmel fogadunk minden fejlesztési javaslatot és hibajelentést! Ha szeretnél hozzájárulni a projekthez: + +1. Fork-old a repository-t +2. Hozz létre egy új branch-et a fejlesztésednek +3. Commit-old a változtatásaidat +4. Push-old a branch-et +5. Nyiss egy Pull Request-et + +## 📝 Licensz + +A projekt [GNU General Public License v3.0](LICENSE) alatt jelent meg. További információért lásd a LICENSE fájlt. + +## 💬 Kapcsolat + +- Discord: [dc.refilc.hu](https://dc.refilc.hu) +- GitHub: [github.com/refilc](https://github.com/refilc) + +--- + ++ Készült ❤️-vel diákoktól diákoknak +
diff --git a/absences/absences.css b/absences/absences.css new file mode 100644 index 0000000..d31f76e --- /dev/null +++ b/absences/absences.css @@ -0,0 +1,520 @@ +* { + box-sizing: border-box; + margin: 0; + padding: 0; +} + +body { + margin: 0; + padding: 0; + color: var(--text-primary); + background-color: var(--background) !important; + font-family: "Montserrat", serif !important; + min-height: 100vh; + font-size: 16px; +} + +@media (max-width: 768px) { + body { + font-size: 14px; + } +} + +.kreta-container { + min-height: 100vh; + display: flex; + flex-direction: column; +} + +.kreta-header { + padding: clamp(1rem, 3vw, 2rem); + display: grid; + grid-template-columns: minmax(300px, 400px) 1fr minmax(200px, 300px); + align-items: center; + gap: 1rem; +} + +@media (max-width: 1200px) { + .kreta-header { + grid-template-columns: minmax(250px, 350px) 1fr minmax(180px, 250px); + } +} + +@media (max-width: 768px) { + .kreta-header { + grid-template-columns: 1fr auto; + grid-template-areas: + "school user" + "nav nav"; + padding: 1rem; + gap: 0.5rem; + } +} + +.school-info { + margin: 0; +} + +@media (max-width: 768px) { + .school-info { + grid-area: school; + max-width: none; + display: flex; + align-items: center; + gap: 0.5rem; + } +} + +.logo-text { + color: var(--text-primary); + font-size: 24px; + font-weight: 600; + margin: 0 0 0.5rem; + display: flex; + align-items: center; +} + +@media (max-width: 768px) { + .logo-text { + margin: 0; + font-size: 20px; + } +} + +.logo { + width: 24px; + border-radius: 8px; + margin-right: 0.5rem; +} + +.school-details { + color: var(--text-secondary); + font-size: 14px; +} + +.school-details span { + display: block; + white-space: nowrap; + overflow: hidden; + text-overflow: ellipsis; + max-width: 300px; +} + +@media (max-width: 768px) { + .school-details span { + max-width: 200px; + } + + .school-details { + font-size: 12px; + } +} + + +.kreta-nav { + padding: 0 clamp(0.5rem, 3vw, 1.5rem); + position: sticky; + top: 0; + z-index: 100; + overflow-x: auto; + -webkit-overflow-scrolling: touch; + scrollbar-width: none; + -ms-overflow-style: none; + display: flex; + justify-content: center; +} + +@media (max-width: 768px) { + .kreta-nav { + grid-area: nav; + padding: 0; + margin-top: 0.5rem; + } +} + +.nav-links { + display: flex; + gap: clamp(0.5rem, 2vw, 1rem); + padding: 0.25rem; + justify-content: center; +} + +@media (max-width: 768px) { + .nav-links { + justify-content: flex-start; + width: 100%; + gap: 0.25rem; + } +} + +.nav-links a { + color: var(--text-secondary); + text-decoration: none; + padding: clamp(0.5rem, 1.5vw, 1rem) 0.5rem; + font-weight: 500; + white-space: nowrap; + transition: all 0.2s ease; + display: flex; + align-items: center; + gap: 0.5rem; + border-radius: 8px; +} + +@media (max-width: 768px) { + .nav-links a { + padding: 0.5rem; + font-size: 13px; + } + + .nav-links a .material-icons-round { + font-size: 20px; + } +} + +.nav-links a:hover { + color: var(--text-primary); + background-color: var(--card-card); +} + +.nav-links a.active { + color: var(--accent-accent); +} + + +.user-profile { + position: relative; + justify-self: flex-end; +} + +@media (max-width: 768px) { + .user-profile { + grid-area: user; + } +} + +.user-dropdown-btn { + display: flex; + align-items: center; + gap: 1rem; + background: none; + border: none; + cursor: pointer; + padding: 0.5rem; + border-radius: 8px; + transition: background-color 0.2s; +} + +.user-dropdown-btn:hover { + background: var(--card-card); +} + +.user-info { + text-align: right; +} + +.user-name { + display: block; + color: var(--text-primary); + font-size: 16px; + font-weight: 500; +} + +.user-time { + display: block; + color: var(--text-secondary); + font-size: 14px; +} + +.user-dropdown { + position: absolute; + top: 100%; + right: 0; + margin-top: 0.5rem; + background: var(--card-card); + border-radius: 12px; + box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1); + width: 200px; + display: none; + z-index: 1000; +} + +.user-dropdown.show { + display: block; + animation: dropdownShow 0.2s ease; +} + +.dropdown-item { + display: flex; + align-items: center; + gap: 0.75rem; + padding: 0.75rem 1rem; + color: var(--text-primary); + text-decoration: none; + transition: background-color 0.2s; +} + +.dropdown-item:hover { + background: var(--button-secondaryFill); +} + + +.kreta-main { + flex: 1; + padding: clamp(1rem, 3vw, 2rem); + max-width: 1200px; + margin: 0 auto; + width: 100%; +} + + +.filter-card { + background: var(--card-card); + border-radius: 24px; + padding: 20px; + margin-bottom: 24px; + box-shadow: 0px 1px var(--shadow-blur) 0px var(--accent-shadow); +} + +.filter-header { + margin-bottom: 16px; +} + +.filter-header h2 { + font-size: 18px; + font-weight: 600; + color: var(--text-primary); + background-color: var(--card-card); +} + +.filter-content { + display: grid; + grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); + gap: 16px; +} + +.filter-group { + display: flex; + flex-direction: column; + gap: 8px; +} + +.filter-group label { + display: flex; + align-items: center; + gap: 8px; + color: var(--text-secondary); + font-size: 14px; +} + +.filter-input { + padding: 10px; + border: none; + border-radius: 8px; + background: var(--button-secondaryFill); + color: var(--text-primary); + font-family: inherit; + font-size: 14px; + transition: all 0.2s ease; +} + +.filter-input:focus { + outline: none; + box-shadow: 0 0 0 2px var(--accent-accent); +} + + +.absences-container { + display: flex; + flex-direction: column; + gap: 16px; +} + +.absence-group { + background: var(--card-card); + border-radius: 24px; + overflow: hidden; + animation: fadeIn 0.3s ease; + box-shadow: 0px 1px var(--shadow-blur) 0px var(--accent-shadow); +} + +.absence-date { + padding: 16px; + color: var(--text-primary); + font-weight: 600; + display: flex; + align-items: center; + gap: 8px; +} + +.absence-count { + margin-left: auto; + background: var(--accent-accent); + color: var(--button-secondaryFill); + padding: 4px 8px; + border-radius: 12px; + font-size: 14px; +} + +.absence-list { + padding: 16px; + display: flex; + flex-direction: column; + gap: 12px; +} + +.absence-item { + display: grid; + grid-template-columns: auto 1fr auto; + align-items: center; + gap: 16px; + padding: 12px; + background: var(--accent-15); + border-radius: 12px; + transition: transform 0.2s ease; +} + +.absence-item:hover { + transform: translateX(4px); +} + +.absence-time { + display: flex; + align-items: center; + gap: 4px; + color: var(--text-secondary); + font-size: 14px; +} + +.absence-details { + display: flex; + flex-direction: column; + gap: 4px; +} + +.absence-subject { + font-weight: 600; + color: var(--text-primary); +} + +.absence-topic { + color: var(--text-secondary); + font-size: 14px; +} + +.absence-status { + display: flex; + align-items: center; + gap: 4px; + font-size: 14px; + font-weight: 500; +} + +.absence-status.justified { + color: var(--grades-4); +} + +.absence-status.unjustified { + color: var(--grades-1); +} + +.absence-status.pending { + color: var(--grades-3); +} + + +.loading-overlay { + position: fixed; + top: 0; + left: 0; + width: 100%; + height: 100%; + background: var(--background); + display: flex; + flex-direction: column; + align-items: center; + justify-content: center; + z-index: 9999; +} + +.loading-container { + display: flex; + flex-direction: column; + align-items: center; + gap: 1rem; + padding: 2rem; + border-radius: 24px; +} + +.loading-text { + color: var(--Text-Primary); + text-align: center; + font-family: Montserrat; + font-size: 20px; + font-style: normal; + font-weight: 700; + line-height: normal; +} + +.loading-text2 { + align-self: stretch; + color: var(--Text-Secondary); + text-align: center; + font-family: Figtree; + font-size: 16px; + font-style: normal; + font-weight: 500; + line-height: 130%; +} + +.loading-logo { + width: 48px; + height: 48px; + margin-bottom: 1rem; + border-radius: 8px; +} + + +@keyframes fadeIn { + from { + opacity: 0; + transform: translateY(-10px); + } + to { + opacity: 1; + transform: translateY(0); + } +} + +@keyframes dropdownShow { + from { + opacity: 0; + transform: translateY(-10px); + } + to { + opacity: 1; + transform: translateY(0); + } +} + +@keyframes spin { + to { transform: rotate(360deg); } +} + + +::-webkit-scrollbar { + width: clamp(4px, 1vw, 8px); + height: clamp(4px, 1vw, 8px); +} + +::-webkit-scrollbar-track { + background: var(--background); +} + +::-webkit-scrollbar-thumb { + background: var(--text-secondary); + border-radius: 4px; +} + +::-webkit-scrollbar-thumb:hover { + background: var(--text-primary); +} \ No newline at end of file diff --git a/absences/absences.js b/absences/absences.js new file mode 100644 index 0000000..76f5783 --- /dev/null +++ b/absences/absences.js @@ -0,0 +1,462 @@ +function getCookie(name) { + const cookieName = `${name}=`; + const decodedCookie = decodeURIComponent(document.cookie); + const cookieArray = decodedCookie.split(';'); + + for(let i = 0; i < cookieArray.length; i++) { + let cookie = cookieArray[i]; + while (cookie.charAt(0) === ' ') { + cookie = cookie.substring(1); + } + if (cookie.indexOf(cookieName) === 0) { + return cookie.substring(cookieName.length, cookie.length); + } + } + return null; +} + +function shortenSchoolName(name, maxLength = 50) { + if (!name) return ''; + if (name.length <= maxLength) return name; + + const parts = name.split(' - '); + if (parts.length === 2) { + const [code, fullName] = parts; + if (fullName.length > maxLength - code.length - 3) { + return `${code} - ${fullName.substring(0, maxLength - code.length - 6)}...`; + } + } + return name.substring(0, maxLength - 3) + '...'; +} + +async function waitForElement(selector) { + return new Promise(resolve => { + if (document.querySelector(selector)) { + return resolve(document.querySelector(selector)); + } + + const observer = new MutationObserver(mutations => { + if (document.querySelector(selector)) { + observer.disconnect(); + resolve(document.querySelector(selector)); + } + }); + + observer.observe(document.body, { + childList: true, + subtree: true + }); + }); +} + +async function collectAbsencesData() { + await waitForElement('#HianyzasGrid'); + await new Promise(resolve => setTimeout(resolve, 1000)); + + const basicData = { + schoolInfo: { + name: getCookie('schoolName') || 'Iskola', + id: getCookie('schoolCode') || '' + }, + userData: { + name: getCookie('userName') || 'Felhasználó', + time: document.querySelector('.usermenu_timer')?.textContent?.trim() || '45:00' + } + }; + + const absences = []; + const rows = document.querySelectorAll('#HianyzasGrid .k-grid-content tr'); + rows.forEach(row => { + const cells = row.querySelectorAll('td'); + if (cells.length >= 9) { + absences.push({ + date: cells[1]?.textContent?.trim() || '', + lesson: cells[2]?.textContent?.trim() || '', + subject: cells[3]?.textContent?.trim() || '', + topic: cells[4]?.textContent?.trim() || '', + type: cells[5]?.textContent?.trim() || '', + justified: cells[6]?.textContent?.trim() === 'Igen', + justificationStatus: cells[6]?.textContent?.trim() === 'Igen' ? 'justified' : + cells[6]?.textContent?.trim() === 'Nem' ? 'unjustified' : 'pending', + purposeful: cells[7]?.textContent?.trim() || '', + justificationType: cells[8]?.textContent?.trim() || '' + }); + } + }); + + const groupedAbsences = {}; + absences.forEach(absence => { + if (!groupedAbsences[absence.date]) { + groupedAbsences[absence.date] = []; + } + groupedAbsences[absence.date].push(absence); + }); + + return { basicData, absences, groupedAbsences }; +} + +function showLoadingScreen() { + const loadingHTML = ` + + `; + + document.body.insertAdjacentHTML('beforeend', loadingHTML); +} + +function hideLoadingScreen() { + const loadingOverlay = document.querySelector('.loading-overlay'); + if (loadingOverlay) { + loadingOverlay.style.opacity = '0'; + loadingOverlay.style.transition = 'opacity 0.3s ease'; + setTimeout(() => loadingOverlay.remove(), 300); + } +} + +async function transformAbsencesPage() { + showLoadingScreen(); + const { basicData, absences, groupedAbsences } = await collectAbsencesData(); + + + const schoolNameFull = `${basicData.schoolInfo.id} - ${basicData.schoolInfo.name}`; + const shortenedSchoolName = shortenSchoolName(schoolNameFull); + + document.body.innerHTML = ` +
+
+ Firka
+
+
+ Firka
+
+
+ Firka
+
+
+
+ Firka
+
+
+ Firka
+
Nincs megjeleníthető házi feladat.
+Nincs a szűrési feltételeknek megfelelő házi feladat.
'; + homeworkList.appendChild(emptyState); + } + + + if (visibleItems.length === 0) { + emptyState.style.display = 'block'; + } else { + emptyState.style.display = 'none'; + } + }; + + + const resetFilters = () => { + subjectFilter.value = ''; + teacherFilter.value = ''; + deadlineFilter.value = ''; + + + document.querySelectorAll('.homework-item').forEach(item => { + item.style.display = 'block'; + }); + + document.querySelectorAll('.homework-date-group').forEach(group => { + group.style.display = 'block'; + }); + + + const homeworkList = document.getElementById('homeworkList'); + const existingEmptyState = homeworkList.querySelector('.empty-state'); + if (existingEmptyState) { + homeworkList.removeChild(existingEmptyState); + } + }; + + + subjectFilter.addEventListener('change', applyFilters); + teacherFilter.addEventListener('change', applyFilters); + deadlineFilter.addEventListener('change', applyFilters); +} + +function setupUserDropdown() { + const userBtn = document.querySelector('.user-dropdown-btn'); + const userDropdown = document.querySelector('.user-dropdown'); + + userBtn?.addEventListener('click', (e) => { + e.stopPropagation(); + userDropdown?.classList.toggle('show'); + }); + + document.addEventListener('click', () => { + userDropdown?.classList.remove('show'); + }); + + + document.getElementById('settingsBtn')?.addEventListener('click', (e) => { + e.preventDefault(); + e.stopPropagation(); + const url = chrome.runtime.getURL('settings/index.html'); + window.open(url, '_blank', 'width=400,height=600'); + }); +} + +function setupLogoutTimer() { + const timerElement = document.querySelector('.nav-logout-timer'); + if (!timerElement) return; + + const timeString = timerElement.textContent; + const startTime = parseInt(timeString?.match(/\d+/)?.[0] || "45"); + let timeLeft = startTime * 60; + + const updateTimer = () => { + const minutes = Math.floor(timeLeft / 60); + const seconds = timeLeft % 60; + timerElement.textContent = `${minutes}:${seconds.toString().padStart(2, '0')}`; + + if (timeLeft <= 0) { + window.location.href = '/Home/Logout'; + } + timeLeft--; + }; + + updateTimer(); + setInterval(updateTimer, 1000); +} + + +if (window.location.href.includes('/Tanulo/TanuloHaziFeladat')) { + transformHomeworkPage().catch(error => { + console.error('Error transforming homework page:', error); + }); +} \ No newline at end of file diff --git a/icons/absences-active.svg b/icons/absences-active.svg new file mode 100644 index 0000000..d67438d --- /dev/null +++ b/icons/absences-active.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/icons/absences-inactive.svg b/icons/absences-inactive.svg new file mode 100644 index 0000000..2d127f7 --- /dev/null +++ b/icons/absences-inactive.svg @@ -0,0 +1,5 @@ + \ No newline at end of file diff --git a/icons/close.svg b/icons/close.svg new file mode 100644 index 0000000..24b71a8 --- /dev/null +++ b/icons/close.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/icons/dashboard-active.svg b/icons/dashboard-active.svg new file mode 100644 index 0000000..3e0fa00 --- /dev/null +++ b/icons/dashboard-active.svg @@ -0,0 +1,3 @@ + \ No newline at end of file diff --git a/icons/dashboard-inactive.svg b/icons/dashboard-inactive.svg new file mode 100644 index 0000000..7007744 --- /dev/null +++ b/icons/dashboard-inactive.svg @@ -0,0 +1,5 @@ + \ No newline at end of file diff --git a/icons/dkt.svg b/icons/dkt.svg new file mode 100644 index 0000000..29f01d8 --- /dev/null +++ b/icons/dkt.svg @@ -0,0 +1,5 @@ + \ No newline at end of file diff --git a/icons/eye-off.svg b/icons/eye-off.svg new file mode 100644 index 0000000..e1b437f --- /dev/null +++ b/icons/eye-off.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/icons/eye-on.svg b/icons/eye-on.svg new file mode 100644 index 0000000..cba5af7 --- /dev/null +++ b/icons/eye-on.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/icons/grades-active.svg b/icons/grades-active.svg new file mode 100644 index 0000000..59bda98 --- /dev/null +++ b/icons/grades-active.svg @@ -0,0 +1,3 @@ + \ No newline at end of file diff --git a/icons/grades-inactive.svg b/icons/grades-inactive.svg new file mode 100644 index 0000000..1448963 --- /dev/null +++ b/icons/grades-inactive.svg @@ -0,0 +1,5 @@ + \ No newline at end of file diff --git a/icons/logout.svg b/icons/logout.svg new file mode 100644 index 0000000..00ec2a8 --- /dev/null +++ b/icons/logout.svg @@ -0,0 +1,4 @@ + \ No newline at end of file diff --git a/icons/naplo.svg b/icons/naplo.svg new file mode 100644 index 0000000..5b65937 --- /dev/null +++ b/icons/naplo.svg @@ -0,0 +1,3 @@ + \ No newline at end of file diff --git a/icons/open-link.svg b/icons/open-link.svg new file mode 100644 index 0000000..ed7ef75 --- /dev/null +++ b/icons/open-link.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/icons/others.svg b/icons/others.svg new file mode 100644 index 0000000..666094f --- /dev/null +++ b/icons/others.svg @@ -0,0 +1,5 @@ + \ No newline at end of file diff --git a/icons/profile.svg b/icons/profile.svg new file mode 100644 index 0000000..b750730 --- /dev/null +++ b/icons/profile.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/icons/settings.svg b/icons/settings.svg new file mode 100644 index 0000000..0f23909 --- /dev/null +++ b/icons/settings.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/icons/timetable-active.svg b/icons/timetable-active.svg new file mode 100644 index 0000000..54f0cb6 --- /dev/null +++ b/icons/timetable-active.svg @@ -0,0 +1,4 @@ + \ No newline at end of file diff --git a/icons/timetable-inactive.svg b/icons/timetable-inactive.svg new file mode 100644 index 0000000..58dd202 --- /dev/null +++ b/icons/timetable-inactive.svg @@ -0,0 +1,5 @@ + \ No newline at end of file diff --git a/images/firka_logo.png b/images/firka_logo.png new file mode 100644 index 0000000..19f5d49 Binary files /dev/null and b/images/firka_logo.png differ diff --git a/images/firka_logo_128.png b/images/firka_logo_128.png new file mode 100644 index 0000000..d6b5793 Binary files /dev/null and b/images/firka_logo_128.png differ diff --git a/images/loading.gif b/images/loading.gif new file mode 100644 index 0000000..8c4d0f6 Binary files /dev/null and b/images/loading.gif differ diff --git a/login/login.css b/login/login.css new file mode 100644 index 0000000..8bd87f0 --- /dev/null +++ b/login/login.css @@ -0,0 +1,385 @@ +@font-face { + font-family: 'Montserrat'; + src: url('chrome-extension://__MSG_@@extension_id__/fonts/Montserrat-Regular.woff2') format('woff2'); + font-weight: 400; + font-style: normal; +} +@font-face { + font-family: 'Montserrat'; + src: url('chrome-extension://__MSG_@@extension_id__/fonts/Montserrat-Medium.woff2') format('woff2'); + font-weight: 500; + font-style: normal; +} +@font-face { + font-family: 'Montserrat'; + src: url('chrome-extension://__MSG_@@extension_id__/fonts/Montserrat-SemiBold.woff2') format('woff2'); + font-weight: 600; + font-style: normal; +} +@font-face { + font-family: 'Figtree'; + src: url('chrome-extension://__MSG_@@extension_id__/fonts/Figtree-Regular.woff2') format('woff2'); + font-weight: 400; + font-style: normal; +} + +:root { + --icon-invert: 0.1; + --icon-sepia: 0.1; + --icon-saturate: 0.1; + --icon-hue-rotate: 0deg; + --icon-brightness: 0.1; +} + + +:root[data-theme="light-green"] { + --icon-invert: 0.1; + --icon-sepia: 0.1; + --icon-saturate: 0.1; + --icon-hue-rotate: 0deg; + --icon-brightness: 0.1; +} + + +:root[data-theme="dark-blue"] { + --icon-invert: 0.9; + --icon-sepia: 0.1; + --icon-saturate: 0.1; + --icon-hue-rotate: 0deg; + --icon-brightness: 1; +} + + +:root[data-theme="dark-green"] { + --icon-invert: 0.9; + --icon-sepia: 0.1; + --icon-saturate: 0.1; + --icon-hue-rotate: 0deg; + --icon-brightness: 1; +} + +* { + box-sizing: border-box; + margin: 0; + padding: 0; +} + +body { + margin: 0; + padding: 0; + color: var(--text-primary); + background-color: var(--background) !important; + font-family: "Montserrat", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif !important; + min-height: 100vh; + font-size: 16px; + display: flex; + align-items: center; + justify-content: center; +} + +.login-container { + width: 90%; + max-width: 500px; + padding: 20px; + margin: 0 auto; +} + +.login-card { + background: var(--card-card); + padding: 24px; + margin-bottom: 16px; + border-radius: 24px; + box-shadow: 0px 1px var(--shadow-blur) 0px var(--accent-shadow); +} + +.card-header { + display: flex; + flex-direction: column; + align-items: center; + gap: 8px; + margin: 16px 0; + background: var(--card-card) !important; + border-bottom: 1px solid rgba(0, 0, 0, 0) !important; +} + +.logo-text { + color: var(--text-primary); + text-align: center; + font-family: Montserrat; + font-size: 20px; + font-style: normal; + font-weight: 700; + line-height: normal; +} + +.logo { + width: 48px; + height: 48px; + border-radius: 12px; +} + +.school-name { + color: var(--text-secondary); + text-align: center; + font-family: Figtree; + font-size: 16px; + font-style: normal; + font-weight: 500; + line-height: 130%; +} + +.school-details { + color: var(--text-secondary); + text-align: center; + font-family: Figtree; + font-size: 16px; + font-style: normal; + font-weight: 500; + line-height: 130%; +} + +.login-form { + width: 100%; +} + +.form-group { + margin-bottom: 16px; +} + +.form-control { + display: flex; + height: 48px; + padding: 0px 14px; + align-items: center; + gap: 10px; + align-self: stretch; + border-radius: 12px; + background: var(--accent-15) !important; + border: 0px solid var(--accent-15) !important; + color: var(--text-primary) !important; +} + +.form-control:focus { + outline: none; + border-color: var(--accent-accent) !important; +} + +.form-control::placeholder { + color: var(--text-secondary) !important; +} + +.password-group { + position: relative; +} + +.show-password { + position: absolute; + right: 12px; + top: 50%; + transform: translateY(-50%); + background: none; + border: none; + padding: 4px; + cursor: pointer; + display: flex; + align-items: center; + justify-content: center; +} + +.icon-eye { + width: 20px; + height: 20px; + opacity: 0.6; + transition: opacity 0.2s ease; + filter: invert(var(--icon-invert)) sepia(var(--icon-sepia)) saturate(var(--icon-saturate)) hue-rotate(var(--icon-hue-rotate)) brightness(var(--icon-brightness)); +} + +.show-password:hover .icon-eye { + opacity: 1; +} + +.form-actions { + margin-top: 24px; +} + +.help-links { + margin-top: 16px; + display: flex; + flex-direction: column; + align-items: center; + gap: 8px; +} + +.help-link { + color: var(--text-primary); + font-size: 14px; + font-weight: 500; + text-decoration: none; + transition: color 0.2s ease; +} + +.help-link:hover { + color: var(--text-teritary); +} + +.btn-login { + width: 100%; + padding: 12px; + background: var(--accent-accent); + color: white; + border: none; + border-radius: 12px; + font-size: 16px; + font-weight: 600; + font-family: "Montserrat", serif; + cursor: pointer; + transition: background 0.2s ease; + position: relative; +} + +.btn-login:hover { + background: var(--text-teritary); +} + +.btn-login:disabled { + opacity: 0.7; + cursor: not-allowed; +} + +.btn-text { + color: var(--text-primary); + text-align: center; + font-family: Montserrat; + font-size: 18px; + font-style: normal; + font-weight: 700; + line-height: normal; + letter-spacing: -0.3px; +} + +.system-message { + display: flex; + padding: 20px; + flex-direction: column; + align-items: center; + gap: 12px; + align-self: stretch; + border-radius: 24px; + background: var(--card-card); + box-shadow: 0px 1px var(--shadow-blur) 0px var(--accent-shadow); +} + +.system-message h4 { + color: var(--text-primary); + text-align: center; + font-family: Montserrat; + font-size: 20px; + font-style: normal; + font-weight: 700; + line-height: normal; +} + +.system-message p { + color: var(--text-secondary); + text-align: center; + font-family: Figtree; + font-size: 16px; + font-style: normal; + font-weight: 500; + line-height: 130%; +} + +.login-footer { + align-self: stretch; + color: var(--text-secondary); + text-align: center; + font-family: Figtree; + font-size: 14px; + font-style: normal; + font-weight: 500; + line-height: 130%; +} + +.privacy-link { + align-self: stretch; + color: var(--text-secondary); + text-align: center; + font-family: Figtree; + font-size: 14px; + font-style: normal; + font-weight: 500; + line-height: 130%; + text-decoration: none; +} + +.privacy-link:hover { + color: var(--text-teritary); +} + + +.form-control.error { + border-color: var(--error-accent) !important; + background: var(--error-card) !important; +} + +.error-message { + color: var(--error-text); + font-size: 14px; + margin-top: 4px; + display: none; +} + +.error-message.show { + display: block; + animation: fadeIn 0.2s ease; +} + +@keyframes fadeIn { + from { opacity: 0; transform: translateY(-4px); } + to { opacity: 1; transform: translateY(0); } +} + +@keyframes spin { + to { transform: translate(-50%, -50%) rotate(360deg); } +} + +@media (max-width: 480px) { + .login-container { + padding: 16px; + } + + .login-card { + padding: 20px; + } + + .card-header { + margin-bottom: 20px; + padding-bottom: 16px; + } + + .logo-text { + font-size: 20px; + } + + .school-name { + font-size: 16px; + } + + .school-details { + font-size: 12px; + } + + .form-control { + height: 44px; + font-size: 14px; + } + + .btn-login { + padding: 10px; + font-size: 14px; + } + + .help-link { + font-size: 12px; + } +} \ No newline at end of file diff --git a/login/login.js b/login/login.js new file mode 100644 index 0000000..6d49112 --- /dev/null +++ b/login/login.js @@ -0,0 +1,201 @@ +async function transformLoginPage() { + try { + + if (document.readyState !== 'complete') { + await new Promise(resolve => { + window.addEventListener('load', resolve); + }); + } + + + const existingForm = document.querySelector('form'); + const formData = { + action: existingForm?.getAttribute('action') || '', + returnUrl: document.querySelector('#ReturnUrl')?.value || '', + instituteCode: document.querySelector('#instituteCode')?.value || '', + requestToken: document.querySelector('input[name="__RequestVerificationToken"]')?.value || '' + }; + + + const titleElement = document.querySelector('.page-title'); + const schoolInfo = { + name: titleElement?.querySelector('b')?.textContent?.trim() || '', + kretaId: '', + omCode: '' + }; + + + const spanElement = titleElement?.querySelector('span'); + if (spanElement) { + const lines = spanElement.textContent?.split('\n').map(line => line.trim()) || []; + schoolInfo.kretaId = lines[0] || ''; + schoolInfo.omCode = (lines[1] || '').replace('KRÉTA azonosító: ', ''); + } + + + const rawSystemMessage = document.querySelector('.alert-primary')?.textContent?.trim() || ''; + const systemMessage = rawSystemMessage.replace('Rendszerértesítés', '').trim(); + + + const newHTML = ` +
+
+ Firka
+
+
+ Firka
+
A kétfaktoros hitelesítés használatához telepítsen egy időalapú, egyszer használatos jelszó (TOTP) alkalmazást:
+ +
+
+ Firka
+
+
+ Firka
+
+
+ Firxa
+
A Firka egy nyílt forráskódú projekt, amely a KRÉTA rendszerhez készít saját felhasználói felületet.
+ + + GitHub + +Ha tetszik a munkánk és szeretnéd támogatni a fejlesztést, az alábbi módon teheted meg:
+ +
+ Kis türelmet!
+ `; + document.body.appendChild(loadingScreen); + } + + function hideLoadingScreen() { + const loadingScreen = document.querySelector('.loading-screen'); + if (loadingScreen) { + loadingScreen.style.opacity = '0'; + loadingScreen.style.transition = 'opacity 0.3s ease'; + setTimeout(() => loadingScreen.remove(), 300); + } + } + + // DOM elemek várása + function waitForElement(selector) { + return new Promise(resolve => { + if (document.querySelector(selector)) { + return resolve(document.querySelector(selector)); + } + + const observer = new MutationObserver(mutations => { + if (document.querySelector(selector)) { + observer.disconnect(); + resolve(document.querySelector(selector)); + } + }); + + observer.observe(document.body, { + childList: true, + subtree: true + }); + }); + } + + // Órarendi adatok gyűjtése + async function collectTimetableData() { + await waitForElement('#Calendar'); + await new Promise(resolve => setTimeout(resolve, 1000)); + + const calendar = document.querySelector('#Calendar'); + const dates = Array.from(document.querySelectorAll('.fc-day-header')).map(header => { + const fullText = header.textContent.trim(); + // Remove the day name from the beginning and clean up the format + const dateText = fullText.replace(/^(hétfő|kedd|szerda|csütörtök|péntek)/, '').trim(); + return { + date: fullText, + formattedDate: dateText + }; + }); + // Fix the Thursday issue by ensuring we have all 5 days + if (dates.length === 4) { + // Get Wednesday's date parts + const wedDate = dates[2].formattedDate; + const [month, day] = wedDate.split(' '); + const dayNum = parseInt(day.replace('.', '')); + + // Create Thursday's date + const thursdayDate = `${month} ${dayNum + 1}.`; + + dates.splice(3, 0, { + date: `csütörtök${thursdayDate}`, + formattedDate: thursdayDate + }); + } + // Set week selector based on the current date + const weekOptions = Array.from(document.querySelectorAll('#Calendar_tanevHetek_listbox li')); + const currentDate = dates[0]?.formattedDate; // Using Monday's date + const matchingWeek = weekOptions.find(opt => opt.textContent.includes(currentDate)); + + if (matchingWeek) { + const kendoCombo = document.querySelector('#Calendar_tanevHetek')?.__kendoWidget; + if (kendoCombo) { + const weekIndex = weekOptions.indexOf(matchingWeek); + kendoCombo.value(weekIndex.toString()); + kendoCombo.trigger('change'); + } + } + const timetableData = { + schoolInfo: { + name: getCookie('schoolName') || 'Iskola', + id: getCookie('schoolCode') || '' + }, + userData: { + name: getCookie('userName') || 'Felhasználó', + time: document.querySelector('.usermenu_timer')?.textContent?.trim() || '45:00' + }, + weekInfo: { + title: document.querySelector('.fc-center h2')?.textContent?.trim() || 'Hét', + options: Array.from(document.querySelectorAll('#Calendar_tanevHetek_listbox li')) + .map((li, i) => ({ + text: li.textContent.trim(), + value: i.toString(), + selected: li.classList.contains('k-state-selected') + })) + }, + weekDates: dates, // Add the dates to the data object + lessons: [] + }; + + // Órák adatainak gyűjtése + document.querySelectorAll('.fc-event').forEach(event => { + const timeEl = event.querySelector('.fc-time'); + const titleEl = event.querySelector('.fc-title'); + + if (timeEl && titleEl) { + const [startTime, endTime] = (timeEl.getAttribute('data-full') || timeEl.textContent || '').split(' - '); + const [fullSubject, teacher, room] = titleEl.innerHTML.split('
+
+ Firka
+