Compare commits
12 Commits
6e9efd2dbc
...
standalone
| Author | SHA1 | Date | |
|---|---|---|---|
| 28e3053a6a | |||
| eddba45f4e | |||
| 66ae665aae | |||
| bf936e395d | |||
| cd596d3753 | |||
| de21aff489 | |||
| 9050114508 | |||
| cefca66094 | |||
| 3ee0972888 | |||
| 5dae31e952 | |||
| 340aa33b23 | |||
| 02510fb224 |
5
about.html
Normal file → Executable file
5
about.html
Normal file → Executable file
@@ -3,6 +3,9 @@
|
|||||||
<head>
|
<head>
|
||||||
<meta charset="UTF-8">
|
<meta charset="UTF-8">
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||||
|
<meta name="description" content="SSNJ - Slovar Slovenskega Novega Jezika">
|
||||||
|
<meta name="robots" content="index,follow">
|
||||||
|
<meta name="author" content="Jonas Korene Novak / DcruBro">
|
||||||
<title>O projektu</title>
|
<title>O projektu</title>
|
||||||
<script src="./scripts/preload.js"></script>
|
<script src="./scripts/preload.js"></script>
|
||||||
<link rel="stylesheet" type="text/css" href="./styles/main.css">
|
<link rel="stylesheet" type="text/css" href="./styles/main.css">
|
||||||
@@ -21,7 +24,7 @@
|
|||||||
</p>
|
</p>
|
||||||
<br>
|
<br>
|
||||||
<p class="page-paragraph">
|
<p class="page-paragraph">
|
||||||
<a class="page-link" href="/">Glavna stran</a>
|
<a class="page-link" href="index.html" target="_top">Glavna stran</a>
|
||||||
</p>
|
</p>
|
||||||
</main>
|
</main>
|
||||||
|
|
||||||
|
|||||||
BIN
assets/1.jpg
Executable file
BIN
assets/1.jpg
Executable file
Binary file not shown.
|
After Width: | Height: | Size: 774 KiB |
BIN
assets/2.jpg
Executable file
BIN
assets/2.jpg
Executable file
Binary file not shown.
|
After Width: | Height: | Size: 519 KiB |
BIN
assets/3.jpg
Executable file
BIN
assets/3.jpg
Executable file
Binary file not shown.
|
After Width: | Height: | Size: 485 KiB |
7
contact.html
Normal file → Executable file
7
contact.html
Normal file → Executable file
@@ -3,6 +3,9 @@
|
|||||||
<head>
|
<head>
|
||||||
<meta charset="UTF-8">
|
<meta charset="UTF-8">
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||||
|
<meta name="description" content="SSNJ - Slovar Slovenskega Novega Jezika">
|
||||||
|
<meta name="robots" content="index,follow">
|
||||||
|
<meta name="author" content="Jonas Korene Novak / DcruBro">
|
||||||
<title>Kontakt</title>
|
<title>Kontakt</title>
|
||||||
<script src="./scripts/preload.js"></script>
|
<script src="./scripts/preload.js"></script>
|
||||||
<link rel="stylesheet" type="text/css" href="./styles/main.css">
|
<link rel="stylesheet" type="text/css" href="./styles/main.css">
|
||||||
@@ -15,6 +18,10 @@
|
|||||||
<hr>
|
<hr>
|
||||||
<div id="contact-form-container">
|
<div id="contact-form-container">
|
||||||
</div>
|
</div>
|
||||||
|
<br>
|
||||||
|
<p class="page-paragraph">
|
||||||
|
<a class="page-link" href="index.html" target="_top">Glavna stran</a>
|
||||||
|
</p>
|
||||||
</main>
|
</main>
|
||||||
|
|
||||||
<div class="page-footer"></div>
|
<div class="page-footer"></div>
|
||||||
|
|||||||
76
extras.html
Normal file → Executable file
76
extras.html
Normal file → Executable file
@@ -3,6 +3,9 @@
|
|||||||
<head>
|
<head>
|
||||||
<meta charset="UTF-8">
|
<meta charset="UTF-8">
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||||
|
<meta name="description" content="SSNJ - Slovar Slovenskega Novega Jezika">
|
||||||
|
<meta name="robots" content="index,follow">
|
||||||
|
<meta name="author" content="Jonas Korene Novak / DcruBro">
|
||||||
<title>Dodatki</title>
|
<title>Dodatki</title>
|
||||||
<script src="./scripts/preload.js"></script>
|
<script src="./scripts/preload.js"></script>
|
||||||
<link rel="stylesheet" type="text/css" href="./styles/main.css">
|
<link rel="stylesheet" type="text/css" href="./styles/main.css">
|
||||||
@@ -15,16 +18,48 @@
|
|||||||
<hr>
|
<hr>
|
||||||
<p class="page-paragraph">Ti dodatki so tukaj saj sem jih moral narediti za pogoje naloge. Nimajo praktične uporabe.</p>
|
<p class="page-paragraph">Ti dodatki so tukaj saj sem jih moral narediti za pogoje naloge. Nimajo praktične uporabe.</p>
|
||||||
<br>
|
<br>
|
||||||
<div class="page-btn-collection" style="margin-left: 20px;">
|
<div class="page-btn-collection" style="margin-left: 23px;">
|
||||||
<button id="open-fin-modal" class="page-btn">Finančni kalkulator</button>
|
<button id="open-fin-modal" class="page-btn">Finančni kalkulator</button>
|
||||||
<button id="open-game-modal" class="page-btn">Igra</button>
|
<button id="open-game-modal" class="page-btn">Igra</button>
|
||||||
</div>
|
</div>
|
||||||
|
<br>
|
||||||
|
<button style="margin-left: 23px; margin-bottom: 20px;" id="toggle-collapse" class="page-btn">Prikaži/Skrij galerijo slik</button>
|
||||||
|
<br>
|
||||||
|
<p class="page-paragraph">
|
||||||
|
<a class="page-link" href="index.html" target="_top">Glavna stran</a>
|
||||||
|
</p>
|
||||||
|
<div id="page-collapse" class="page-collapse">
|
||||||
|
<p class="page-paragraph">To je skrit del strani. Kliknite gumb zgoraj, da ga prikažete ali skrijete.</p>
|
||||||
|
<div class="page-image-gallery">
|
||||||
|
<img src="./assets/1.jpg" alt="Slika 1" class="page-gallery-image">
|
||||||
|
<img src="./assets/2.jpg" alt="Slika 2" class="page-gallery-image">
|
||||||
|
<img src="./assets/3.jpg" alt="Slika 3" class="page-gallery-image">
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
<div class="modal" id="fin-modal">
|
<div class="modal" id="fin-modal">
|
||||||
<div class="modal-content">
|
<div class="modal-content">
|
||||||
<span class="close-fin-modal close">×</span>
|
<span class="close-fin-modal close">×</span>
|
||||||
<h2>Finančni kalkulator</h2>
|
<h2>Finančni kalkulator</h2>
|
||||||
<br>
|
<br>
|
||||||
<p>To je finančni kalkulator. Kliknite gumb spodaj, da ga zaprete.</p>
|
<div class="fin-calculator-form">
|
||||||
|
<div class="form-group">
|
||||||
|
<label for="amount-input">Letna davčna osnova (EUR):</label>
|
||||||
|
<input type="text" id="amount-input" class="page-input" placeholder="Vnesite znesek (npr. 12.345,67)">
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="form-group checkbox-group">
|
||||||
|
<input type="checkbox" id="deduction-checkbox">
|
||||||
|
<label for="deduction-checkbox">Uporabi splošno olajšavo (5.551,93 EUR)</label>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div id="calculator-result" class="calculator-result" style="display: none;">
|
||||||
|
<p><strong>Razred:</strong> <span id="result-razred">-</span></p>
|
||||||
|
<p><strong>Stopnja dohodnjine:</strong> <span id="result-rate">-</span></p>
|
||||||
|
<p><strong>Davčna osnova (z olajšavo):</strong> <span id="result-basis">-</span></p>
|
||||||
|
<p><strong>Obdavčeni znesek:</strong> <span id="result-tax">-</span></p>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
<div class="modal-buttons">
|
<div class="modal-buttons">
|
||||||
<button class="close-fin-modal page-btn">Zapri modal</button>
|
<button class="close-fin-modal page-btn">Zapri modal</button>
|
||||||
</div>
|
</div>
|
||||||
@@ -35,7 +70,42 @@
|
|||||||
<span class="close-game-modal close">×</span>
|
<span class="close-game-modal close">×</span>
|
||||||
<h2>Igra</h2>
|
<h2>Igra</h2>
|
||||||
<br>
|
<br>
|
||||||
<p>To je igra. Kliknite gumb spodaj, da jo zaprete.</p>
|
<div id="game-start-screen" class="game-panel">
|
||||||
|
<p class="game-intro">Uganite besedo iz naključno izbranega vnosa. Imate 3 poskuse na besedo, točke pa padajo po zaporedju 100, 50 in 25.</p>
|
||||||
|
<div class="modal-buttons modal-buttons-left">
|
||||||
|
<button id="start-game-button" class="page-btn nav-btn-primary">Začni igro</button>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div id="game-play-screen" class="game-panel" hidden>
|
||||||
|
<p class="game-meta" style="margin-top: 10px;"><strong>Tip:</strong> <span id="game-word-type">-</span></p>
|
||||||
|
<div class="game-definition-box">
|
||||||
|
<p class="game-section-label">Definicije</p>
|
||||||
|
<div id="game-definitions" class="game-definitions"></div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="game-input-row">
|
||||||
|
<input id="game-guess-input" class="page-input game-guess-input" type="text" placeholder="Vnesite svojo rešitev">
|
||||||
|
<button id="submit-guess-button" class="page-btn nav-btn-primary">Preveri</button>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<p id="game-feedback" class="game-feedback" aria-live="polite"></p>
|
||||||
|
<p class="game-meta">Preostali poskusi: <strong id="game-attempts-left">3</strong></p>
|
||||||
|
<p class="game-meta">Točke v tej besedi: <strong id="game-round-points">100</strong></p>
|
||||||
|
</div>
|
||||||
|
<br>
|
||||||
|
|
||||||
|
<div id="game-stats-screen" class="game-panel" hidden>
|
||||||
|
<div class="game-stats-grid">
|
||||||
|
<p><strong>Skupne točke:</strong> <span id="game-stat-score">0</span></p>
|
||||||
|
<p><strong>Pravilno uganjene besede:</strong> <span id="game-stat-correct">0</span></p>
|
||||||
|
<p><strong>Spodletele besede:</strong> <span id="game-stat-failed">0</span></p>
|
||||||
|
<p><strong>Skupni poskusi:</strong> <span id="game-stat-guesses">0</span></p>
|
||||||
|
</div>
|
||||||
|
<div class="modal-buttons modal-buttons-left">
|
||||||
|
<button id="restart-game-button" class="page-btn nav-btn-primary">Igraj znova</button>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
<div class="modal-buttons">
|
<div class="modal-buttons">
|
||||||
<button class="close-game-modal page-btn">Zapri modal</button>
|
<button class="close-game-modal page-btn">Zapri modal</button>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
3
index.html
Normal file → Executable file
3
index.html
Normal file → Executable file
@@ -3,6 +3,9 @@
|
|||||||
<head>
|
<head>
|
||||||
<meta charset="UTF-8">
|
<meta charset="UTF-8">
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||||
|
<meta name="description" content="SSNJ - Slovar Slovenskega Novega Jezika">
|
||||||
|
<meta name="robots" content="index,follow">
|
||||||
|
<meta name="author" content="Jonas Korene Novak / DcruBro">
|
||||||
<title>Glavna Stran</title>
|
<title>Glavna Stran</title>
|
||||||
<script src="./scripts/preload.js"></script>
|
<script src="./scripts/preload.js"></script>
|
||||||
<link rel="stylesheet" type="text/css" href="./styles/main.css">
|
<link rel="stylesheet" type="text/css" href="./styles/main.css">
|
||||||
|
|||||||
8
login.html
Normal file → Executable file
8
login.html
Normal file → Executable file
@@ -3,6 +3,9 @@
|
|||||||
<head>
|
<head>
|
||||||
<meta charset="UTF-8">
|
<meta charset="UTF-8">
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||||
|
<meta name="description" content="SSNJ - Slovar Slovenskega Novega Jezika">
|
||||||
|
<meta name="robots" content="index,follow">
|
||||||
|
<meta name="author" content="Jonas Korene Novak / DcruBro">
|
||||||
<title>Prijava</title>
|
<title>Prijava</title>
|
||||||
<script src="./scripts/preload.js"></script>
|
<script src="./scripts/preload.js"></script>
|
||||||
<link rel="stylesheet" type="text/css" href="./styles/main.css">
|
<link rel="stylesheet" type="text/css" href="./styles/main.css">
|
||||||
@@ -27,9 +30,12 @@
|
|||||||
<button type="submit" class="page-btn">Prijavi se</button>
|
<button type="submit" class="page-btn">Prijavi se</button>
|
||||||
</div>
|
</div>
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<p>Še nimate računa? <a href="/register.html" class="page-link">Registrirajte se</a></p>
|
<p>Še nimate računa? <a href="register.html" class="page-link" target="_top">Registrirajte se</a></p>
|
||||||
</div>
|
</div>
|
||||||
</form>
|
</form>
|
||||||
|
<p class="page-paragraph">
|
||||||
|
<a class="page-link" href="index.html" target="_top">Glavna stran</a>
|
||||||
|
</p>
|
||||||
</main>
|
</main>
|
||||||
|
|
||||||
<div class="page-footer"></div>
|
<div class="page-footer"></div>
|
||||||
|
|||||||
6
new.html
Normal file → Executable file
6
new.html
Normal file → Executable file
@@ -3,6 +3,9 @@
|
|||||||
<head>
|
<head>
|
||||||
<meta charset="UTF-8">
|
<meta charset="UTF-8">
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||||
|
<meta name="description" content="SSNJ - Slovar Slovenskega Novega Jezika">
|
||||||
|
<meta name="robots" content="index,follow">
|
||||||
|
<meta name="author" content="Jonas Korene Novak / DcruBro">
|
||||||
<title>Nov vnos</title>
|
<title>Nov vnos</title>
|
||||||
<script src="./scripts/preload.js"></script>
|
<script src="./scripts/preload.js"></script>
|
||||||
<link rel="stylesheet" type="text/css" href="./styles/main.css">
|
<link rel="stylesheet" type="text/css" href="./styles/main.css">
|
||||||
@@ -15,6 +18,9 @@
|
|||||||
<hr>
|
<hr>
|
||||||
<div id="entry-form-container">
|
<div id="entry-form-container">
|
||||||
</div>
|
</div>
|
||||||
|
<p class="page-paragraph">
|
||||||
|
<a class="page-link" href="index.html" target="_top">Glavna stran</a>
|
||||||
|
</p>
|
||||||
<div class="modal" id="new-entry-form-modal">
|
<div class="modal" id="new-entry-form-modal">
|
||||||
<div class="modal-content">
|
<div class="modal-content">
|
||||||
<span id="close-modal" class="close">×</span>
|
<span id="close-modal" class="close">×</span>
|
||||||
|
|||||||
8
register.html
Normal file → Executable file
8
register.html
Normal file → Executable file
@@ -3,6 +3,9 @@
|
|||||||
<head>
|
<head>
|
||||||
<meta charset="UTF-8">
|
<meta charset="UTF-8">
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||||
|
<meta name="description" content="SSNJ - Slovar Slovenskega Novega Jezika">
|
||||||
|
<meta name="robots" content="index,follow">
|
||||||
|
<meta name="author" content="Jonas Korene Novak / DcruBro">
|
||||||
<title>Registracija</title>
|
<title>Registracija</title>
|
||||||
<script src="./scripts/preload.js"></script>
|
<script src="./scripts/preload.js"></script>
|
||||||
<link rel="stylesheet" type="text/css" href="./styles/main.css">
|
<link rel="stylesheet" type="text/css" href="./styles/main.css">
|
||||||
@@ -35,9 +38,12 @@
|
|||||||
<button type="submit" class="page-btn">Registriraj se</button>
|
<button type="submit" class="page-btn">Registriraj se</button>
|
||||||
</div>
|
</div>
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<p>Že imate račun? <a href="/login.html" class="page-link">Prijavite se</a></p>
|
<p>Že imate račun? <a href="login.html" class="page-link" target="_top">Prijavite se</a></p>
|
||||||
</div>
|
</div>
|
||||||
</form>
|
</form>
|
||||||
|
<p class="page-paragraph">
|
||||||
|
<a class="page-link" href="index.html" target="_top">Glavna stran</a>
|
||||||
|
</p>
|
||||||
</main>
|
</main>
|
||||||
|
|
||||||
<div class="page-footer"></div>
|
<div class="page-footer"></div>
|
||||||
|
|||||||
10
scripts/contact.js
Normal file → Executable file
10
scripts/contact.js
Normal file → Executable file
@@ -6,6 +6,10 @@ const form = `
|
|||||||
<p><em>Vaše sporočilo bo vezano na vaš račun, zato vam bomo lahko odgovorili na e-pošto, ki ste jo vnesli ob registraciji.</em></p>
|
<p><em>Vaše sporočilo bo vezano na vaš račun, zato vam bomo lahko odgovorili na e-pošto, ki ste jo vnesli ob registraciji.</em></p>
|
||||||
</form>`;
|
</form>`;
|
||||||
|
|
||||||
|
function navigateTop(page) {
|
||||||
|
window.open(new URL(page, window.location.href).href, "_top");
|
||||||
|
}
|
||||||
|
|
||||||
document.addEventListener("DOMContentLoaded", () => {
|
document.addEventListener("DOMContentLoaded", () => {
|
||||||
const contactFormContainer = document.getElementById("contact-form-container");
|
const contactFormContainer = document.getElementById("contact-form-container");
|
||||||
// Najdi cookie "token" v cookies
|
// Najdi cookie "token" v cookies
|
||||||
@@ -34,10 +38,16 @@ document.addEventListener("DOMContentLoaded", () => {
|
|||||||
.then(data => {
|
.then(data => {
|
||||||
console.log("Success:", data);
|
console.log("Success:", data);
|
||||||
document.getElementById("contact-form").innerHTML = `<p class="page-paragraph-success">Hvala za vaše sporočilo! Odgovorili vam bomo v najkrajšem možnem času.</p>`;
|
document.getElementById("contact-form").innerHTML = `<p class="page-paragraph-success">Hvala za vaše sporočilo! Odgovorili vam bomo v najkrajšem možnem času.</p>`;
|
||||||
|
setTimeout(() => {
|
||||||
|
navigateTop("index.html");
|
||||||
|
}, 3000);
|
||||||
})
|
})
|
||||||
.catch((error) => {
|
.catch((error) => {
|
||||||
console.error("Error:", error);
|
console.error("Error:", error);
|
||||||
document.getElementById("contact-form").innerHTML = `<p class="page-paragraph-error">Prišlo je do napake pri pošiljanju vašega sporočila. Prosimo, poskusite znova pozneje.</p>`;
|
document.getElementById("contact-form").innerHTML = `<p class="page-paragraph-error">Prišlo je do napake pri pošiljanju vašega sporočila. Prosimo, poskusite znova pozneje.</p>`;
|
||||||
|
setTimeout(() => {
|
||||||
|
navigateTop("index.html");
|
||||||
|
}, 3000);
|
||||||
});
|
});
|
||||||
|
|
||||||
// TODO: Popravi margin pri success in error textu da ne bo offsetan
|
// TODO: Popravi margin pri success in error textu da ne bo offsetan
|
||||||
|
|||||||
388
scripts/extras.js
Normal file → Executable file
388
scripts/extras.js
Normal file → Executable file
@@ -1,19 +1,405 @@
|
|||||||
document.getElementById("open-fin-modal").addEventListener("click", function() {
|
document.getElementById("open-fin-modal").addEventListener("click", function() {
|
||||||
document.getElementById("fin-modal").style.visibility = "visible";
|
document.getElementById("fin-modal").style.visibility = "visible";
|
||||||
|
if (window.lockBodyScroll) window.lockBodyScroll();
|
||||||
});
|
});
|
||||||
|
|
||||||
document.querySelectorAll(".close-fin-modal").forEach(function(button) {
|
document.querySelectorAll(".close-fin-modal").forEach(function(button) {
|
||||||
button.addEventListener("click", function() {
|
button.addEventListener("click", function() {
|
||||||
document.getElementById("fin-modal").style.visibility = "hidden";
|
document.getElementById("fin-modal").style.visibility = "hidden";
|
||||||
|
if (window.unlockBodyScroll) window.unlockBodyScroll();
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
document.getElementById("open-game-modal").addEventListener("click", function() {
|
document.getElementById("open-game-modal").addEventListener("click", function() {
|
||||||
document.getElementById("game-modal").style.visibility = "visible";
|
document.getElementById("game-modal").style.visibility = "visible";
|
||||||
|
if (window.lockBodyScroll) window.lockBodyScroll();
|
||||||
});
|
});
|
||||||
|
|
||||||
document.querySelectorAll(".close-game-modal").forEach(function(button) {
|
document.querySelectorAll(".close-game-modal").forEach(function(button) {
|
||||||
button.addEventListener("click", function() {
|
button.addEventListener("click", function() {
|
||||||
document.getElementById("game-modal").style.visibility = "hidden";
|
document.getElementById("game-modal").style.visibility = "hidden";
|
||||||
|
if (window.unlockBodyScroll) window.unlockBodyScroll();
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
document.getElementById("toggle-collapse").addEventListener("click", function() {
|
||||||
|
const collapseDiv = document.getElementById("page-collapse");
|
||||||
|
if (collapseDiv.style.visibility === "visible") {
|
||||||
|
collapseDiv.style.visibility = "hidden";
|
||||||
|
} else {
|
||||||
|
collapseDiv.style.visibility = "visible";
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
// Igra
|
||||||
|
|
||||||
|
const gameState = {
|
||||||
|
active: false,
|
||||||
|
loading: false,
|
||||||
|
currentEntry: null,
|
||||||
|
normalizedAnswer: "",
|
||||||
|
attemptsLeft: 3,
|
||||||
|
roundPoints: 100,
|
||||||
|
score: 0,
|
||||||
|
correct: 0,
|
||||||
|
failed: 0,
|
||||||
|
guesses: 0,
|
||||||
|
currentWordGuessed: false
|
||||||
|
};
|
||||||
|
|
||||||
|
const gameElements = {};
|
||||||
|
|
||||||
|
function stripHtmlTags(html) {
|
||||||
|
return String(html || "")
|
||||||
|
.replace(/<\s*br\s*\/?>/gi, "\n")
|
||||||
|
.replace(/<\s*\/p\s*>/gi, "\n")
|
||||||
|
.replace(/<\s*p[^>]*>/gi, "")
|
||||||
|
.replace(/<[^>]+>/g, "")
|
||||||
|
.replace(/ /g, " ")
|
||||||
|
.replace(/&/g, "&")
|
||||||
|
.replace(/</g, "<")
|
||||||
|
.replace(/>/g, ">")
|
||||||
|
.replace(/"/g, '"')
|
||||||
|
.replace(/'/g, "'")
|
||||||
|
.replace(/\n{3,}/g, "\n\n")
|
||||||
|
.trim();
|
||||||
|
}
|
||||||
|
|
||||||
|
function normalizeGuess(value) {
|
||||||
|
return String(value || "")
|
||||||
|
.toLowerCase()
|
||||||
|
.normalize("NFD")
|
||||||
|
.replace(/[\u0300-\u036f]/g, "")
|
||||||
|
.replace(/\s+/g, "")
|
||||||
|
.trim();
|
||||||
|
}
|
||||||
|
|
||||||
|
function parseDefinitions(html) {
|
||||||
|
const plain = stripHtmlTags(html);
|
||||||
|
return plain
|
||||||
|
.split(/\n+/)
|
||||||
|
.map(line => line.trim())
|
||||||
|
.filter(Boolean);
|
||||||
|
}
|
||||||
|
|
||||||
|
function setGameMessage(message, type) {
|
||||||
|
if (!gameElements.feedback) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
gameElements.feedback.textContent = message;
|
||||||
|
gameElements.feedback.classList.remove("is-success", "is-error", "is-neutral");
|
||||||
|
gameElements.feedback.classList.add(type || "is-neutral");
|
||||||
|
}
|
||||||
|
|
||||||
|
function updateGameStats() {
|
||||||
|
if (gameElements.attemptsLeft) {
|
||||||
|
gameElements.attemptsLeft.textContent = String(gameState.attemptsLeft);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (gameElements.roundPoints) {
|
||||||
|
gameElements.roundPoints.textContent = String(gameState.roundPoints);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (gameElements.score) {
|
||||||
|
gameElements.score.textContent = String(gameState.score);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (gameElements.correct) {
|
||||||
|
gameElements.correct.textContent = String(gameState.correct);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (gameElements.failed) {
|
||||||
|
gameElements.failed.textContent = String(gameState.failed);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (gameElements.guesses) {
|
||||||
|
gameElements.guesses.textContent = String(gameState.guesses);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
function setGameScreen(screen) {
|
||||||
|
const screens = ["start", "play", "stats"];
|
||||||
|
screens.forEach(name => {
|
||||||
|
const element = gameElements[`${name}Screen`];
|
||||||
|
if (element) {
|
||||||
|
element.hidden = name !== screen;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
function resetRoundState() {
|
||||||
|
gameState.loading = false;
|
||||||
|
gameState.attemptsLeft = 3;
|
||||||
|
gameState.roundPoints = 100;
|
||||||
|
gameState.currentWordGuessed = false;
|
||||||
|
updateGameStats();
|
||||||
|
setGameMessage("", "is-neutral");
|
||||||
|
if (gameElements.guessInput) {
|
||||||
|
gameElements.guessInput.value = "";
|
||||||
|
gameElements.guessInput.disabled = false;
|
||||||
|
gameElements.guessInput.focus();
|
||||||
|
}
|
||||||
|
if (gameElements.submitGuessButton) {
|
||||||
|
gameElements.submitGuessButton.disabled = false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
function renderCurrentEntry(entry) {
|
||||||
|
const definitions = parseDefinitions(entry?.Vsebina);
|
||||||
|
const typeText = entry?.Tip || "-";
|
||||||
|
|
||||||
|
if (gameElements.wordType) {
|
||||||
|
gameElements.wordType.textContent = typeText;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (gameElements.definitions) {
|
||||||
|
if (!definitions.length) {
|
||||||
|
gameElements.definitions.innerHTML = '<p class="game-empty-state">Opis za ta vnos ni na voljo.</p>';
|
||||||
|
} else {
|
||||||
|
gameElements.definitions.innerHTML = definitions
|
||||||
|
.map(definition => `<div class="game-definition-line">${definition}</div>`)
|
||||||
|
.join("");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
gameState.currentEntry = entry;
|
||||||
|
gameState.normalizedAnswer = normalizeGuess(entry?.Kljuc);
|
||||||
|
resetRoundState();
|
||||||
|
}
|
||||||
|
|
||||||
|
function showGameStats() {
|
||||||
|
if (gameElements.statScore) {
|
||||||
|
gameElements.statScore.textContent = String(gameState.score);
|
||||||
|
}
|
||||||
|
if (gameElements.statCorrect) {
|
||||||
|
gameElements.statCorrect.textContent = String(gameState.correct);
|
||||||
|
}
|
||||||
|
if (gameElements.statFailed) {
|
||||||
|
gameElements.statFailed.textContent = String(gameState.failed);
|
||||||
|
}
|
||||||
|
if (gameElements.statGuesses) {
|
||||||
|
gameElements.statGuesses.textContent = String(gameState.guesses);
|
||||||
|
}
|
||||||
|
setGameScreen("stats");
|
||||||
|
}
|
||||||
|
|
||||||
|
function nextWord() {
|
||||||
|
if (!gameState.active) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
gameState.loading = true;
|
||||||
|
setGameMessage("Nalagam nov vnos ...", "is-neutral");
|
||||||
|
|
||||||
|
fetch("https://ssnj.dcrubro.com/api/random-vnos", { method: "GET" })
|
||||||
|
.then(response => {
|
||||||
|
if (!response.ok) {
|
||||||
|
throw new Error(`HTTP ${response.status}`);
|
||||||
|
}
|
||||||
|
return response.json();
|
||||||
|
})
|
||||||
|
.then(data => {
|
||||||
|
if (!data || !data.success || !data.data) {
|
||||||
|
throw new Error("Neveljaven odgovor strežnika");
|
||||||
|
}
|
||||||
|
|
||||||
|
renderCurrentEntry(data.data);
|
||||||
|
setGameScreen("play");
|
||||||
|
setGameMessage("Ugibajte besedo glede na definicijo.", "is-neutral");
|
||||||
|
})
|
||||||
|
.catch(error => {
|
||||||
|
console.error("random-vnos error", error);
|
||||||
|
setGameMessage("Napaka pri nalaganju novega vnosa. Poskusite znova.", "is-error");
|
||||||
|
gameState.loading = false;
|
||||||
|
})
|
||||||
|
.finally(() => {
|
||||||
|
gameState.loading = false;
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
function finishCurrentWord(correctlyGuessed) {
|
||||||
|
if (correctlyGuessed) {
|
||||||
|
gameState.correct += 1;
|
||||||
|
} else {
|
||||||
|
gameState.failed += 1;
|
||||||
|
gameState.score = Math.max(0, gameState.score - 30);
|
||||||
|
}
|
||||||
|
|
||||||
|
updateGameStats();
|
||||||
|
if (gameElements.guessInput) {
|
||||||
|
gameElements.guessInput.value = "";
|
||||||
|
}
|
||||||
|
|
||||||
|
setTimeout(() => {
|
||||||
|
if (gameState.active) {
|
||||||
|
nextWord();
|
||||||
|
}
|
||||||
|
}, 700);
|
||||||
|
}
|
||||||
|
|
||||||
|
function submitGuess() {
|
||||||
|
if (!gameState.active || gameState.loading || !gameState.currentEntry) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
const guess = normalizeGuess(gameElements.guessInput ? gameElements.guessInput.value : "");
|
||||||
|
if (!guess) {
|
||||||
|
setGameMessage("Vnesite svoj ugib.", "is-error");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
gameState.guesses += 1;
|
||||||
|
updateGameStats();
|
||||||
|
|
||||||
|
if (guess === gameState.normalizedAnswer) {
|
||||||
|
gameState.currentWordGuessed = true;
|
||||||
|
gameState.score += gameState.roundPoints;
|
||||||
|
setGameMessage(`Pravilno. Rešitev je ${gameState.currentEntry.Kljuc}.`, "is-success");
|
||||||
|
updateGameStats();
|
||||||
|
finishCurrentWord(true);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
gameState.attemptsLeft -= 1;
|
||||||
|
gameState.roundPoints = gameState.attemptsLeft === 2 ? 50 : gameState.attemptsLeft === 1 ? 25 : 0;
|
||||||
|
updateGameStats();
|
||||||
|
|
||||||
|
if (gameState.attemptsLeft > 0) {
|
||||||
|
setGameMessage(`Napačno. Preostali poskusi: ${gameState.attemptsLeft}.`, "is-error");
|
||||||
|
if (gameElements.guessInput) {
|
||||||
|
gameElements.guessInput.value = "";
|
||||||
|
gameElements.guessInput.focus();
|
||||||
|
}
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
setGameMessage(`Tudi tretji poskus ni uspel. Rešitev je ${gameState.currentEntry.Kljuc}.`, "is-error");
|
||||||
|
finishCurrentWord(false);
|
||||||
|
}
|
||||||
|
|
||||||
|
function startGame() {
|
||||||
|
gameState.active = true;
|
||||||
|
gameState.score = 0;
|
||||||
|
gameState.correct = 0;
|
||||||
|
gameState.failed = 0;
|
||||||
|
gameState.guesses = 0;
|
||||||
|
updateGameStats();
|
||||||
|
setGameScreen("play");
|
||||||
|
nextWord();
|
||||||
|
}
|
||||||
|
|
||||||
|
function bindGameElements() {
|
||||||
|
gameElements.startScreen = document.getElementById("game-start-screen");
|
||||||
|
gameElements.playScreen = document.getElementById("game-play-screen");
|
||||||
|
gameElements.statsScreen = document.getElementById("game-stats-screen");
|
||||||
|
gameElements.wordType = document.getElementById("game-word-type");
|
||||||
|
gameElements.definitions = document.getElementById("game-definitions");
|
||||||
|
gameElements.guessInput = document.getElementById("game-guess-input");
|
||||||
|
gameElements.submitGuessButton = document.getElementById("submit-guess-button");
|
||||||
|
gameElements.restartGameButton = document.getElementById("restart-game-button");
|
||||||
|
gameElements.feedback = document.getElementById("game-feedback");
|
||||||
|
gameElements.attemptsLeft = document.getElementById("game-attempts-left");
|
||||||
|
gameElements.roundPoints = document.getElementById("game-round-points");
|
||||||
|
gameElements.score = document.getElementById("game-stat-score");
|
||||||
|
gameElements.correct = document.getElementById("game-stat-correct");
|
||||||
|
gameElements.failed = document.getElementById("game-stat-failed");
|
||||||
|
gameElements.guesses = document.getElementById("game-stat-guesses");
|
||||||
|
gameElements.statScore = document.getElementById("game-stat-score");
|
||||||
|
gameElements.statCorrect = document.getElementById("game-stat-correct");
|
||||||
|
gameElements.statFailed = document.getElementById("game-stat-failed");
|
||||||
|
gameElements.statGuesses = document.getElementById("game-stat-guesses");
|
||||||
|
}
|
||||||
|
|
||||||
|
bindGameElements();
|
||||||
|
|
||||||
|
document.getElementById("start-game-button").addEventListener("click", startGame);
|
||||||
|
document.getElementById("submit-guess-button").addEventListener("click", submitGuess);
|
||||||
|
document.getElementById("restart-game-button").addEventListener("click", startGame);
|
||||||
|
document.getElementById("game-guess-input").addEventListener("keydown", function(event) {
|
||||||
|
if (event.key === "Enter") {
|
||||||
|
event.preventDefault();
|
||||||
|
submitGuess();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
// Konec igre
|
||||||
|
|
||||||
|
// Davčne stopnje in razredi za leto 2025
|
||||||
|
const taxBrackets = [
|
||||||
|
{ razred: 1, min: 0, max: 9210.26, rate: 16 },
|
||||||
|
{ razred: 2, min: 9210.26, max: 27089.00, rate: 26 },
|
||||||
|
{ razred: 3, min: 27089.00, max: 54178.00, rate: 33 },
|
||||||
|
{ razred: 4, min: 54178.00, max: 78016.32, rate: 39 },
|
||||||
|
{ razred: 5, min: 78016.32, max: Infinity, rate: 50 }
|
||||||
|
];
|
||||||
|
|
||||||
|
const STANDARD_DEDUCTION = 5551.93;
|
||||||
|
|
||||||
|
function parseEurAmount(input) {
|
||||||
|
if (!input) return null;
|
||||||
|
// Remove spaces, replace . with empty (thousands separator) and , with . (decimal)
|
||||||
|
let normalized = input.trim().replace(/\s/g, "").replace(/\./g, "").replace(",", ".");
|
||||||
|
let num = parseFloat(normalized);
|
||||||
|
return isNaN(num) ? null : num;
|
||||||
|
}
|
||||||
|
|
||||||
|
function formatEurAmount(num) {
|
||||||
|
// Format with thousands separator (.) and decimal separator (,)
|
||||||
|
return num.toFixed(2).replace(".", ",").replace(/\B(?=(\d{3})+(?!\d))/g, ".");
|
||||||
|
}
|
||||||
|
|
||||||
|
function calculateTaxBracket(amount) {
|
||||||
|
for (let bracket of taxBrackets) {
|
||||||
|
if (amount >= bracket.min && amount < bracket.max) {
|
||||||
|
return bracket;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return taxBrackets[taxBrackets.length - 1]; // Return highest bracket
|
||||||
|
}
|
||||||
|
|
||||||
|
function calculateProgressiveTax(amount) {
|
||||||
|
let totalTax = 0;
|
||||||
|
|
||||||
|
for (let bracket of taxBrackets) {
|
||||||
|
if (amount <= bracket.min) {
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
let upperLimit = Math.min(amount, bracket.max);
|
||||||
|
let taxableInBracket = upperLimit - bracket.min;
|
||||||
|
totalTax += taxableInBracket * (bracket.rate / 100);
|
||||||
|
}
|
||||||
|
|
||||||
|
return totalTax;
|
||||||
|
}
|
||||||
|
|
||||||
|
function updateCalculator() {
|
||||||
|
const amountInput = document.getElementById("amount-input").value;
|
||||||
|
const useDeduction = document.getElementById("deduction-checkbox").checked;
|
||||||
|
const resultDiv = document.getElementById("calculator-result");
|
||||||
|
|
||||||
|
let amount = parseEurAmount(amountInput);
|
||||||
|
|
||||||
|
if (amount === null || amount < 0) {
|
||||||
|
resultDiv.style.display = "none";
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
let taxBasis = amount;
|
||||||
|
if (useDeduction && amount > STANDARD_DEDUCTION) {
|
||||||
|
taxBasis = amount - STANDARD_DEDUCTION;
|
||||||
|
}
|
||||||
|
|
||||||
|
const bracket = calculateTaxBracket(taxBasis);
|
||||||
|
const taxAmount = calculateProgressiveTax(taxBasis);
|
||||||
|
|
||||||
|
document.getElementById("result-razred").textContent = bracket.razred;
|
||||||
|
document.getElementById("result-rate").textContent = bracket.rate + " %";
|
||||||
|
document.getElementById("result-basis").textContent = formatEurAmount(taxBasis) + " EUR";
|
||||||
|
document.getElementById("result-tax").textContent = formatEurAmount(taxAmount) + " EUR";
|
||||||
|
|
||||||
|
resultDiv.style.display = "block";
|
||||||
|
}
|
||||||
|
|
||||||
|
document.getElementById("amount-input").addEventListener("input", updateCalculator);
|
||||||
|
document.getElementById("deduction-checkbox").addEventListener("change", updateCalculator);
|
||||||
20
scripts/index.js
Normal file → Executable file
20
scripts/index.js
Normal file → Executable file
@@ -1,13 +1,13 @@
|
|||||||
function getSpecific(kljuc) {
|
function getSpecific(kljuc) {
|
||||||
window.location.href = `/vnos.html?kljuc=${kljuc}`;
|
window.open(new URL(`vnos.html?kljuc=${kljuc}`, window.location.href).href, "_top");
|
||||||
}
|
}
|
||||||
|
|
||||||
function getLast() {
|
function getLast() {
|
||||||
const url = `https://ssnj.dcrubro.com/api/vnosi`;
|
const url = `https://ssnj.dcrubro.com/api/vnosi`;
|
||||||
fetch(url, {
|
fetch(url, {
|
||||||
method: 'POST',
|
method: "POST",
|
||||||
headers: {
|
headers: {
|
||||||
'Content-Type': 'application/json'
|
"Content-Type": "application/json"
|
||||||
},
|
},
|
||||||
body: JSON.stringify({
|
body: JSON.stringify({
|
||||||
query: "*",
|
query: "*",
|
||||||
@@ -17,7 +17,7 @@ function getLast() {
|
|||||||
.then(response => response.json())
|
.then(response => response.json())
|
||||||
.then(data => {
|
.then(data => {
|
||||||
if (!data.success) {
|
if (!data.success) {
|
||||||
console.error('API Error:', data.message);
|
console.error("API Error:", data.message);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -35,7 +35,7 @@ function getLast() {
|
|||||||
}
|
}
|
||||||
})
|
})
|
||||||
.catch((error) => {
|
.catch((error) => {
|
||||||
console.error('Error:', error);
|
console.error("Error:", error);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -46,9 +46,9 @@ function search() {
|
|||||||
|
|
||||||
const url = `https://ssnj.dcrubro.com/api/vnosi`;
|
const url = `https://ssnj.dcrubro.com/api/vnosi`;
|
||||||
fetch(url, {
|
fetch(url, {
|
||||||
method: 'POST',
|
method: "POST",
|
||||||
headers: {
|
headers: {
|
||||||
'Content-Type': 'application/json'
|
"Content-Type": "application/json"
|
||||||
},
|
},
|
||||||
body: JSON.stringify({
|
body: JSON.stringify({
|
||||||
query: `*${val}*`, // Potencialno mora biti tukaj en "*" wildcard
|
query: `*${val}*`, // Potencialno mora biti tukaj en "*" wildcard
|
||||||
@@ -59,7 +59,7 @@ function search() {
|
|||||||
.then(response => response.json())
|
.then(response => response.json())
|
||||||
.then(data => {
|
.then(data => {
|
||||||
if (!data.success) {
|
if (!data.success) {
|
||||||
console.error('API Error:', data.message);
|
console.error("API Error:", data.message);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -89,7 +89,7 @@ function search() {
|
|||||||
}
|
}
|
||||||
})
|
})
|
||||||
.catch((error) => {
|
.catch((error) => {
|
||||||
console.error('Error:', error);
|
console.error("Error:", error);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -101,7 +101,7 @@ document.getElementById("search-input").addEventListener("keydown", (event) => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
function addEntry() {
|
function addEntry() {
|
||||||
window.location.href = "/new.html";
|
window.open(new URL("new.html", window.location.href).href, "_top");
|
||||||
}
|
}
|
||||||
|
|
||||||
// DELAJ DELAJ
|
// DELAJ DELAJ
|
||||||
|
|||||||
11
scripts/login.js
Normal file → Executable file
11
scripts/login.js
Normal file → Executable file
@@ -4,6 +4,10 @@ const errmsg = `
|
|||||||
</div>
|
</div>
|
||||||
`;
|
`;
|
||||||
|
|
||||||
|
function navigateTop(page) {
|
||||||
|
window.open(new URL(page, window.location.href).href, "_top");
|
||||||
|
}
|
||||||
|
|
||||||
document.getElementById("login-form").addEventListener("submit", async function(event) {
|
document.getElementById("login-form").addEventListener("submit", async function(event) {
|
||||||
event.preventDefault();
|
event.preventDefault();
|
||||||
|
|
||||||
@@ -14,6 +18,7 @@ document.getElementById("login-form").addEventListener("submit", async function(
|
|||||||
const username = document.getElementById("username").value;
|
const username = document.getElementById("username").value;
|
||||||
const password = document.getElementById("password").value;
|
const password = document.getElementById("password").value;
|
||||||
const form = document.getElementById("login-form");
|
const form = document.getElementById("login-form");
|
||||||
|
const cookiePath = window.location.pathname.replace(/[^/]+$/, "/");
|
||||||
|
|
||||||
try {
|
try {
|
||||||
const response = await fetch("https://ssnj.dcrubro.com/api/prijava", {
|
const response = await fetch("https://ssnj.dcrubro.com/api/prijava", {
|
||||||
@@ -28,10 +33,10 @@ document.getElementById("login-form").addEventListener("submit", async function(
|
|||||||
|
|
||||||
if (response.status === 200) {
|
if (response.status === 200) {
|
||||||
// Nastavi cookie, 3 ure veljaven
|
// Nastavi cookie, 3 ure veljaven
|
||||||
document.cookie = `token=${data.token}; max-age=${3 * 60 * 60}; path=/; secure; samesite=strict`;
|
document.cookie = `token=${data.token}; max-age=${3 * 60 * 60}; path=${cookiePath}; samesite=strict`;
|
||||||
document.cookie = `username=${username}; max-age=${3 * 60 * 60}; path=/; secure; samesite=strict`;
|
document.cookie = `username=${username}; max-age=${3 * 60 * 60}; path=${cookiePath}; samesite=strict`;
|
||||||
|
|
||||||
window.location.href = "/";
|
navigateTop("index.html");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
127
scripts/main.js
Normal file → Executable file
127
scripts/main.js
Normal file → Executable file
@@ -2,12 +2,12 @@ const headerHtml = `
|
|||||||
<header>
|
<header>
|
||||||
<nav>
|
<nav>
|
||||||
<div class="nav-left">
|
<div class="nav-left">
|
||||||
<a class="nav-title" href="/">Slovar Slovenskega Novega Jezika</a>
|
<a class="nav-title" href="index.html" target="_top">Slovar Slovenskega Novega Jezika</a>
|
||||||
</div>
|
</div>
|
||||||
<div class="nav-right" aria-label="Primary navigation">
|
<div class="nav-right" aria-label="Primary navigation">
|
||||||
<a class="nav-btn" href="/about.html">O projektu</a>
|
<a class="nav-btn" href="about.html" target="_top">O projektu</a>
|
||||||
<a class="nav-btn" href="/contact.html">Kontakt</a>
|
<a class="nav-btn" href="contact.html" target="_top">Kontakt</a>
|
||||||
<a class="nav-btn" href="/extras.html">Dodatki</a>
|
<a class="nav-btn" href="extras.html" target="_top">Dodatki</a>
|
||||||
<div id="nav-login-holder"></div>
|
<div id="nav-login-holder"></div>
|
||||||
|
|
||||||
<button id="theme-toggle" class="toggle-btn" onclick="toggleTheme()" aria-label="Toggle colour scheme" aria-pressed="false">
|
<button id="theme-toggle" class="toggle-btn" onclick="toggleTheme()" aria-label="Toggle colour scheme" aria-pressed="false">
|
||||||
@@ -25,28 +25,64 @@ const footerHtml = `
|
|||||||
</footer>
|
</footer>
|
||||||
`;
|
`;
|
||||||
|
|
||||||
|
// Scroll lock helper
|
||||||
|
(function() {
|
||||||
|
let _locked = false;
|
||||||
|
let _scrollY = 0;
|
||||||
|
|
||||||
|
function lockBodyScroll() {
|
||||||
|
if (_locked) return;
|
||||||
|
_scrollY = window.scrollY || window.pageYOffset || 0;
|
||||||
|
document.body.style.position = "fixed";
|
||||||
|
document.body.style.top = `-${_scrollY}px`;
|
||||||
|
document.body.style.left = "0";
|
||||||
|
document.body.style.right = "0";
|
||||||
|
document.body.style.width = "100%";
|
||||||
|
document.documentElement.classList.add("modal-open");
|
||||||
|
document.body.classList.add("modal-open");
|
||||||
|
_locked = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
function unlockBodyScroll() {
|
||||||
|
if (!_locked) return;
|
||||||
|
document.body.style.position = "";
|
||||||
|
document.body.style.top = "";
|
||||||
|
document.body.style.left = "";
|
||||||
|
document.body.style.right = "";
|
||||||
|
document.body.style.width = "";
|
||||||
|
document.documentElement.classList.remove("modal-open");
|
||||||
|
document.body.classList.remove("modal-open");
|
||||||
|
window.scrollTo(0, _scrollY);
|
||||||
|
_locked = false;
|
||||||
|
}
|
||||||
|
|
||||||
|
window.lockBodyScroll = lockBodyScroll;
|
||||||
|
window.unlockBodyScroll = unlockBodyScroll;
|
||||||
|
})();
|
||||||
|
|
||||||
function getCurrentTheme() {
|
function getCurrentTheme() {
|
||||||
return document.documentElement.getAttribute('data-theme') === 'dark' ? 'dark' : 'light';
|
return document.documentElement.getAttribute("data-theme") === "dark" ? "dark" : "light";
|
||||||
}
|
}
|
||||||
|
|
||||||
function updateToggleState(theme) {
|
function updateToggleState(theme) {
|
||||||
const icon = document.getElementById('toggle-icon');
|
const icon = document.getElementById("toggle-icon");
|
||||||
const toggleButton = document.getElementById('theme-toggle');
|
const toggleButton = document.getElementById("theme-toggle");
|
||||||
|
|
||||||
if (!icon || !toggleButton) {
|
if (!icon || !toggleButton) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
icon.textContent = theme === 'dark' ? '🌙' : '☀';
|
icon.textContent = theme === "dark" ? "🌙" : "☀";
|
||||||
toggleButton.setAttribute('aria-pressed', theme === 'dark' ? 'true' : 'false');
|
toggleButton.setAttribute("aria-pressed", theme === "dark" ? "true" : "false");
|
||||||
toggleButton.setAttribute('aria-label', theme === 'dark' ? 'Svetli način' : 'Temni način');
|
toggleButton.setAttribute("aria-label", theme === "dark" ? "Svetli način" : "Temni način");
|
||||||
}
|
}
|
||||||
|
|
||||||
function logout() {
|
function logout() {
|
||||||
// Odstrani cookie tako, da ga nastaviš z max-age=0
|
// Odstrani cookie tako, da ga nastaviš z max-age=0
|
||||||
document.cookie = 'token=; max-age=0; path=/; secure; samesite=strict';
|
const cookiePath = window.location.pathname.replace(/[^/]+$/, "/");
|
||||||
document.cookie = 'username=; max-age=0; path=/; secure; samesite=strict';
|
document.cookie = `token=; max-age=0; path=${cookiePath}; samesite=strict`;
|
||||||
window.location.href = "/";
|
document.cookie = `username=; max-age=0; path=${cookiePath}; samesite=strict`;
|
||||||
|
window.open(new URL("index.html", window.location.href).href, "_top");
|
||||||
}
|
}
|
||||||
|
|
||||||
document.addEventListener("DOMContentLoaded", function() {
|
document.addEventListener("DOMContentLoaded", function() {
|
||||||
@@ -59,23 +95,27 @@ document.addEventListener("DOMContentLoaded", function() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Dodaj gumb za prijavo, če uporabnik ni prijavljen
|
// Dodaj gumb za prijavo, če uporabnik ni prijavljen
|
||||||
const isLoggedIn = document.cookie.split(';').some(cookie => cookie.trim().startsWith('token='));
|
const isLoggedIn = document.cookie.split(";").some(cookie => cookie.trim().startsWith("token="));
|
||||||
if (!isLoggedIn) {
|
if (!isLoggedIn) {
|
||||||
const navRight = document.querySelector('.nav-right');
|
const navRight = document.querySelector(".nav-right");
|
||||||
if (navRight) {
|
if (navRight) {
|
||||||
const loginBtn = `<a class="nav-btn nav-btn-primary" href="/login.html">Prijava</a>`;
|
const loginBtn = `<a class="nav-btn nav-btn-primary" href="login.html" target="_top">Prijava</a>`;
|
||||||
// Najdi zadnji <a> element in dodaj gumb za njim
|
// Najdi zadnji <a> element in dodaj gumb za njim
|
||||||
const lastLink = navRight.querySelector('a:last-child');
|
const lastLink = navRight.querySelector("a:last-child");
|
||||||
document.getElementById("nav-login-holder").innerHTML = loginBtn;
|
document.getElementById("nav-login-holder").innerHTML = loginBtn;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
const navRight = document.querySelector('.nav-right');
|
const navRight = document.querySelector(".nav-right");
|
||||||
if (navRight) {
|
if (navRight) {
|
||||||
const logoutBtn = `<a class="nav-btn nav-btn-primary" href="/">Odjava</a>`;
|
const logoutBtn = `<a class="nav-btn nav-btn-primary" href="index.html" target="_top">Odjava</a>`;
|
||||||
// Najdi zadnji <a> element in dodaj gumb za njim
|
// Najdi zadnji <a> element in dodaj gumb za njim
|
||||||
const lastLink = navRight.querySelector('a:last-child');
|
const lastLink = navRight.querySelector("a:last-child");
|
||||||
document.getElementById("nav-login-holder").innerHTML = logoutBtn;
|
document.getElementById("nav-login-holder").innerHTML = logoutBtn;
|
||||||
document.querySelector('.nav-btn-primary').addEventListener('click', logout);
|
const logoutLink = document.getElementById("nav-login-holder").querySelector(".nav-btn-primary");
|
||||||
|
logoutLink?.addEventListener("click", (event) => {
|
||||||
|
event.preventDefault();
|
||||||
|
logout();
|
||||||
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -84,20 +124,49 @@ document.addEventListener("DOMContentLoaded", function() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
updateToggleState(getCurrentTheme());
|
updateToggleState(getCurrentTheme());
|
||||||
});
|
|
||||||
|
|
||||||
|
// Univerzalne funkcionalnosti, ki so potrebne na več straneh
|
||||||
|
const galleryImages = document.querySelectorAll(".page-gallery-image");
|
||||||
|
galleryImages.forEach(image => {
|
||||||
|
image.addEventListener("click", () => {
|
||||||
|
const src = image.getAttribute("src");
|
||||||
|
const alt = image.getAttribute("alt");
|
||||||
|
const modalHtml = `
|
||||||
|
<div class="modal" id="image-modal">
|
||||||
|
<div class="modal-content">
|
||||||
|
<span class="close">×</span>
|
||||||
|
<img src="${src}" alt="${alt}" class="image-modal-img">
|
||||||
|
<p>${alt}</p>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
`;
|
||||||
|
document.body.insertAdjacentHTML("beforeend", modalHtml);
|
||||||
|
const modal = document.getElementById("image-modal");
|
||||||
|
modal.style.visibility = "visible";
|
||||||
|
if (window.lockBodyScroll) window.lockBodyScroll();
|
||||||
|
|
||||||
|
const closeBtn = modal.querySelector(".close");
|
||||||
|
if (closeBtn) {
|
||||||
|
closeBtn.addEventListener("click", () => {
|
||||||
|
modal.remove();
|
||||||
|
if (window.unlockBodyScroll) window.unlockBodyScroll();
|
||||||
|
});
|
||||||
|
}
|
||||||
|
});
|
||||||
|
});
|
||||||
|
});
|
||||||
function toggleTheme() {
|
function toggleTheme() {
|
||||||
const current = getCurrentTheme();
|
const current = getCurrentTheme();
|
||||||
const next = current === 'dark' ? 'light' : 'dark';
|
const next = current === "dark" ? "light" : "dark";
|
||||||
document.documentElement.setAttribute('data-theme', next);
|
document.documentElement.setAttribute("data-theme", next);
|
||||||
localStorage.setItem('theme', next);
|
localStorage.setItem("theme", next);
|
||||||
updateToggleState(next);
|
updateToggleState(next);
|
||||||
}
|
}
|
||||||
|
|
||||||
matchMedia('(prefers-color-scheme: dark)').addEventListener('change', (e) => {
|
matchMedia("(prefers-color-scheme: dark)").addEventListener("change", (e) => {
|
||||||
if (!localStorage.getItem('theme')) {
|
if (!localStorage.getItem("theme")) {
|
||||||
const theme = e.matches ? 'dark' : 'light';
|
const theme = e.matches ? "dark" : "light";
|
||||||
document.documentElement.setAttribute('data-theme', theme);
|
document.documentElement.setAttribute("data-theme", theme);
|
||||||
updateToggleState(theme);
|
updateToggleState(theme);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
7
scripts/new.js
Normal file → Executable file
7
scripts/new.js
Normal file → Executable file
@@ -32,6 +32,10 @@ const form = `
|
|||||||
<p><em>Vaš vnos bo javno vezan na vaš račun.</em></p>
|
<p><em>Vaš vnos bo javno vezan na vaš račun.</em></p>
|
||||||
</form>`;
|
</form>`;
|
||||||
|
|
||||||
|
function navigateTop(page) {
|
||||||
|
window.open(new URL(page, window.location.href).href, "_top");
|
||||||
|
}
|
||||||
|
|
||||||
document.getElementById("confirm-add").addEventListener("click", () => {
|
document.getElementById("confirm-add").addEventListener("click", () => {
|
||||||
document.getElementById("new-entry-form-modal").style.display = "none";
|
document.getElementById("new-entry-form-modal").style.display = "none";
|
||||||
|
|
||||||
@@ -65,6 +69,9 @@ document.getElementById("confirm-add").addEventListener("click", () => {
|
|||||||
console.error("Error:", error);
|
console.error("Error:", error);
|
||||||
document.getElementById("contact-form").innerHTML = `<p class="page-paragraph-error">Prišlo je do napake pri dodajanju vnosa. Prosimo, poskusite znova pozneje.</p>`;
|
document.getElementById("contact-form").innerHTML = `<p class="page-paragraph-error">Prišlo je do napake pri dodajanju vnosa. Prosimo, poskusite znova pozneje.</p>`;
|
||||||
});
|
});
|
||||||
|
setTimeout(() => {
|
||||||
|
navigateTop("index.html");
|
||||||
|
}, 3000);
|
||||||
});
|
});
|
||||||
|
|
||||||
document.getElementById("cancel-add").addEventListener("click", () => {
|
document.getElementById("cancel-add").addEventListener("click", () => {
|
||||||
|
|||||||
8
scripts/preload.js
Normal file → Executable file
8
scripts/preload.js
Normal file → Executable file
@@ -1,9 +1,9 @@
|
|||||||
(function() {
|
(function() {
|
||||||
try {
|
try {
|
||||||
const saved = localStorage.getItem('theme');
|
const saved = localStorage.getItem("theme");
|
||||||
const osPref = matchMedia('(prefers-color-scheme: dark)').matches ? 'dark' : 'light';
|
const osPref = matchMedia("(prefers-color-scheme: dark)").matches ? "dark" : "light";
|
||||||
document.documentElement.setAttribute('data-theme', saved || osPref);
|
document.documentElement.setAttribute("data-theme", saved || osPref);
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
document.documentElement.setAttribute('data-theme', 'light');
|
document.documentElement.setAttribute("data-theme", "light");
|
||||||
}
|
}
|
||||||
})();
|
})();
|
||||||
14
scripts/register.js
Normal file → Executable file
14
scripts/register.js
Normal file → Executable file
@@ -4,6 +4,10 @@ const errmsg = `
|
|||||||
</div>
|
</div>
|
||||||
`;
|
`;
|
||||||
|
|
||||||
|
function navigateTop(page) {
|
||||||
|
window.open(new URL(page, window.location.href).href, "_top");
|
||||||
|
}
|
||||||
|
|
||||||
document.getElementById("login-form").addEventListener("submit", async function(event) {
|
document.getElementById("login-form").addEventListener("submit", async function(event) {
|
||||||
event.preventDefault();
|
event.preventDefault();
|
||||||
|
|
||||||
@@ -63,7 +67,7 @@ document.getElementById("login-form").addEventListener("submit", async function(
|
|||||||
`<div class="form-group"><p class="page-paragraph-success">Uspešna registracija! Preusmerjanje na prijavo...</p></div>`
|
`<div class="form-group"><p class="page-paragraph-success">Uspešna registracija! Preusmerjanje na prijavo...</p></div>`
|
||||||
);
|
);
|
||||||
}, 500);
|
}, 500);
|
||||||
window.location.href = "/login.html";
|
navigateTop("login.html");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -72,10 +76,10 @@ document.getElementById("login-form").addEventListener("submit", async function(
|
|||||||
const serverMsg = (data && data.message) ? String(data.message).toLowerCase() : "";
|
const serverMsg = (data && data.message) ? String(data.message).toLowerCase() : "";
|
||||||
let userMsg = "Uporabniško ime ali e-pošta je že zasedena.";
|
let userMsg = "Uporabniško ime ali e-pošta je že zasedena.";
|
||||||
|
|
||||||
if (serverMsg.includes('username') || serverMsg.includes('uporab') || serverMsg.includes('user')) {
|
if (serverMsg.includes("username") || serverMsg.includes("uporab") || serverMsg.includes("user")) {
|
||||||
userMsg = 'Uporabniško ime je že zasedeno.';
|
userMsg = "Uporabniško ime je že zasedeno.";
|
||||||
} else if (serverMsg.includes('email') || serverMsg.includes('e-pošta') || serverMsg.includes('e-naslov')) {
|
} else if (serverMsg.includes("email") || serverMsg.includes("e-pošta") || serverMsg.includes("e-naslov")) {
|
||||||
userMsg = 'E-poštni naslov je že uporabljen.';
|
userMsg = "E-poštni naslov je že uporabljen.";
|
||||||
} else if (serverMsg) {
|
} else if (serverMsg) {
|
||||||
userMsg = data.message; // show server message if it's something specific
|
userMsg = data.message; // show server message if it's something specific
|
||||||
}
|
}
|
||||||
|
|||||||
64
scripts/vnos.js
Normal file → Executable file
64
scripts/vnos.js
Normal file → Executable file
@@ -1,5 +1,9 @@
|
|||||||
const kljuc = new URLSearchParams(window.location.search).get("kljuc");
|
const kljuc = new URLSearchParams(window.location.search).get("kljuc");
|
||||||
|
|
||||||
|
function navigateTop(page) {
|
||||||
|
window.open(new URL(page, window.location.href).href, "_top");
|
||||||
|
}
|
||||||
|
|
||||||
function getCookie(name) {
|
function getCookie(name) {
|
||||||
const match = document.cookie.split(";").map(c => c.trim()).find(c => c.startsWith(name + "="));
|
const match = document.cookie.split(";").map(c => c.trim()).find(c => c.startsWith(name + "="));
|
||||||
return match ? match.split("=")[1] : null;
|
return match ? match.split("=")[1] : null;
|
||||||
@@ -8,9 +12,9 @@ function getCookie(name) {
|
|||||||
function getKey() {
|
function getKey() {
|
||||||
const url = `https://ssnj.dcrubro.com/api/vnos`;
|
const url = `https://ssnj.dcrubro.com/api/vnos`;
|
||||||
fetch(url, {
|
fetch(url, {
|
||||||
method: 'POST',
|
method: "POST",
|
||||||
headers: {
|
headers: {
|
||||||
'Content-Type': 'application/json'
|
"Content-Type": "application/json"
|
||||||
},
|
},
|
||||||
body: JSON.stringify({
|
body: JSON.stringify({
|
||||||
pk: kljuc
|
pk: kljuc
|
||||||
@@ -19,7 +23,7 @@ function getKey() {
|
|||||||
.then(response => response.json())
|
.then(response => response.json())
|
||||||
.then(data => {
|
.then(data => {
|
||||||
if (!data.success) {
|
if (!data.success) {
|
||||||
console.error('API Error:', data.message);
|
console.error("API Error:", data.message);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -81,9 +85,9 @@ function getKey() {
|
|||||||
}
|
}
|
||||||
return response.json();
|
return response.json();
|
||||||
})
|
})
|
||||||
.then(data => {
|
.then(data => {
|
||||||
console.log("Success:", data);
|
console.log("Success:", data);
|
||||||
window.location.href = "/";
|
navigateTop("index.html");
|
||||||
})
|
})
|
||||||
.catch((error) => {
|
.catch((error) => {
|
||||||
console.error("Error:", error);
|
console.error("Error:", error);
|
||||||
@@ -96,39 +100,39 @@ function getKey() {
|
|||||||
});
|
});
|
||||||
})
|
})
|
||||||
.catch((error) => {
|
.catch((error) => {
|
||||||
console.error('Error:', error);
|
console.error("Error:", error);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
getKey();
|
getKey();
|
||||||
|
|
||||||
function initVoting(entryData) {
|
function initVoting(entryData) {
|
||||||
const upBtn = document.getElementById('vote-up');
|
const upBtn = document.getElementById("vote-up");
|
||||||
const downBtn = document.getElementById('vote-down');
|
const downBtn = document.getElementById("vote-down");
|
||||||
const sumEl = document.getElementById('vote-sum');
|
const sumEl = document.getElementById("vote-sum");
|
||||||
if (!upBtn || !downBtn || !sumEl) return;
|
if (!upBtn || !downBtn || !sumEl) return;
|
||||||
|
|
||||||
const token = getCookie('token');
|
const token = getCookie("token");
|
||||||
|
|
||||||
let currentVote = 0;
|
let currentVote = 0;
|
||||||
|
|
||||||
function setActive(v) {
|
function setActive(v) {
|
||||||
upBtn.classList.toggle('nav-btn-primary', v === 1);
|
upBtn.classList.toggle("nav-btn-primary", v === 1);
|
||||||
downBtn.classList.toggle('nav-btn-primary', v === -1);
|
downBtn.classList.toggle("nav-btn-primary", v === -1);
|
||||||
currentVote = v;
|
currentVote = v;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!token) {
|
if (!token) {
|
||||||
const showLogin = () => alert('Prijavite se, da lahko glasujete.');
|
const showLogin = () => alert("Prijavite se, da lahko glasujete.");
|
||||||
upBtn.addEventListener('click', showLogin);
|
upBtn.addEventListener("click", showLogin);
|
||||||
downBtn.addEventListener('click', showLogin);
|
downBtn.addEventListener("click", showLogin);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
// fetch whether the current user has voted
|
// fetch whether the current user has voted
|
||||||
fetch('https://ssnj.dcrubro.com/api/semvolil', {
|
fetch("https://ssnj.dcrubro.com/api/semvolil", {
|
||||||
method: 'POST',
|
method: "POST",
|
||||||
headers: { 'Content-Type': 'application/json' },
|
headers: { "Content-Type": "application/json" },
|
||||||
body: JSON.stringify({ token: token, pk: kljuc })
|
body: JSON.stringify({ token: token, pk: kljuc })
|
||||||
})
|
})
|
||||||
.then(r => r.json())
|
.then(r => r.json())
|
||||||
@@ -136,29 +140,29 @@ function initVoting(entryData) {
|
|||||||
const v = obj?.vote || 0;
|
const v = obj?.vote || 0;
|
||||||
setActive(v);
|
setActive(v);
|
||||||
})
|
})
|
||||||
.catch(err => console.error('semvolil error', err));
|
.catch(err => console.error("semvolil error", err));
|
||||||
|
|
||||||
upBtn.addEventListener('click', () => submitVote(1));
|
upBtn.addEventListener("click", () => submitVote(1));
|
||||||
downBtn.addEventListener('click', () => submitVote(-1));
|
downBtn.addEventListener("click", () => submitVote(-1));
|
||||||
|
|
||||||
function submitVote(vote) {
|
function submitVote(vote) {
|
||||||
const tokenNow = getCookie('token');
|
const tokenNow = getCookie("token");
|
||||||
if (!tokenNow) { alert('Prijavite se, da lahko glasujete.'); return; }
|
if (!tokenNow) { alert("Prijavite se, da lahko glasujete."); return; }
|
||||||
|
|
||||||
// if user clicks the same vote, send 0 to remove it
|
// if user clicks the same vote, send 0 to remove it
|
||||||
const sendVote = (vote === currentVote) ? 0 : vote;
|
const sendVote = (vote === currentVote) ? 0 : vote;
|
||||||
|
|
||||||
fetch('https://ssnj.dcrubro.com/api/volI', {
|
fetch("https://ssnj.dcrubro.com/api/volI", {
|
||||||
method: 'POST',
|
method: "POST",
|
||||||
headers: { 'Content-Type': 'application/json' },
|
headers: { "Content-Type": "application/json" },
|
||||||
body: JSON.stringify({ token: tokenNow, pk: kljuc, vote: sendVote })
|
body: JSON.stringify({ token: tokenNow, pk: kljuc, vote: sendVote })
|
||||||
})
|
})
|
||||||
.then(r => r.json())
|
.then(r => r.json())
|
||||||
.then(() => {
|
.then(() => {
|
||||||
// refresh current score
|
// refresh current score
|
||||||
return fetch('https://ssnj.dcrubro.com/api/vnos', {
|
return fetch("https://ssnj.dcrubro.com/api/vnos", {
|
||||||
method: 'POST',
|
method: "POST",
|
||||||
headers: { 'Content-Type': 'application/json' },
|
headers: { "Content-Type": "application/json" },
|
||||||
body: JSON.stringify({ pk: kljuc })
|
body: JSON.stringify({ pk: kljuc })
|
||||||
});
|
});
|
||||||
})
|
})
|
||||||
@@ -170,6 +174,6 @@ function initVoting(entryData) {
|
|||||||
setActive(sendVote);
|
setActive(sendVote);
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
.catch(err => console.error('vote error', err));
|
.catch(err => console.error("vote error", err));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
225
styles/main.css
Normal file → Executable file
225
styles/main.css
Normal file → Executable file
@@ -333,6 +333,61 @@ nav {
|
|||||||
margin-right: 23px;
|
margin-right: 23px;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.fin-calculator-form {
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
gap: 15px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.fin-calculator-form .form-group {
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
gap: 6px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.fin-calculator-form label {
|
||||||
|
color: var(--text-color);
|
||||||
|
font-size: 0.92rem;
|
||||||
|
font-weight: 500;
|
||||||
|
|
||||||
|
/* Smooth Theme Transition */
|
||||||
|
transition: color 0.25s ease;
|
||||||
|
}
|
||||||
|
|
||||||
|
.fin-calculator-form .checkbox-group {
|
||||||
|
flex-direction: row;
|
||||||
|
align-items: center;
|
||||||
|
gap: 8px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.fin-calculator-form .checkbox-group input[type="checkbox"] {
|
||||||
|
cursor: pointer;
|
||||||
|
width: 18px;
|
||||||
|
height: 18px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.fin-calculator-form .checkbox-group label {
|
||||||
|
margin: 0;
|
||||||
|
cursor: pointer;
|
||||||
|
}
|
||||||
|
|
||||||
|
.calculator-result {
|
||||||
|
padding: 15px;
|
||||||
|
border: 1px solid var(--nav-btn-border);
|
||||||
|
border-radius: 4px;
|
||||||
|
background: var(--nav-btn-bg);
|
||||||
|
color: var(--text-color);
|
||||||
|
|
||||||
|
/* Smooth Theme Transition */
|
||||||
|
transition: background-color 0.25s ease, border-color 0.25s ease, color 0.25s ease;
|
||||||
|
}
|
||||||
|
|
||||||
|
.calculator-result p {
|
||||||
|
margin: 8px 0;
|
||||||
|
font-size: 0.92rem;
|
||||||
|
line-height: 1.4;
|
||||||
|
}
|
||||||
|
|
||||||
.page-unordered-list {
|
.page-unordered-list {
|
||||||
list-style-type: disc;
|
list-style-type: disc;
|
||||||
padding-left: 20px;
|
padding-left: 20px;
|
||||||
@@ -356,10 +411,18 @@ nav {
|
|||||||
visibility: hidden;
|
visibility: hidden;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* Prevent background scrolling while a modal is open */
|
||||||
|
html.modal-open,
|
||||||
|
body.modal-open {
|
||||||
|
overflow: hidden;
|
||||||
|
touch-action: none;
|
||||||
|
height: 100%;
|
||||||
|
}
|
||||||
|
|
||||||
.close {
|
.close {
|
||||||
position: absolute;
|
position: fixed;
|
||||||
top: 10px;
|
top: 12px;
|
||||||
right: 10px;
|
right: 12px;
|
||||||
font-size: 2rem;
|
font-size: 2rem;
|
||||||
background-color: var(--nav-btn-bg);
|
background-color: var(--nav-btn-bg);
|
||||||
border: 1px solid var(--nav-btn-border);
|
border: 1px solid var(--nav-btn-border);
|
||||||
@@ -382,20 +445,137 @@ nav {
|
|||||||
|
|
||||||
.modal-content {
|
.modal-content {
|
||||||
background: var(--nav-btn-bg);
|
background: var(--nav-btn-bg);
|
||||||
padding: 20px;
|
padding: 28px;
|
||||||
border-radius: 8px;
|
border-radius: 8px;
|
||||||
width: 90%;
|
width: 90%;
|
||||||
max-width: 400px;
|
max-width: 900px;
|
||||||
position: relative;
|
position: relative;
|
||||||
color: var(--text-color);
|
color: var(--text-color);
|
||||||
transition: background-color 0.25s ease, color 0.25s ease;
|
transition: background-color 0.25s ease, color 0.25s ease;
|
||||||
|
max-height: calc(100vh - 48px);
|
||||||
|
overflow: auto;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Make images inside modals larger while constraining to viewport */
|
||||||
|
.image-modal-img {
|
||||||
|
display: block;
|
||||||
|
max-width: 100%;
|
||||||
|
width: auto;
|
||||||
|
height: auto;
|
||||||
|
max-height: 80vh;
|
||||||
|
margin: 0 auto;
|
||||||
}
|
}
|
||||||
|
|
||||||
.modal-buttons {
|
.modal-buttons {
|
||||||
display: flex;
|
display: flex;
|
||||||
justify-content: flex-end;
|
justify-content: flex-end;
|
||||||
gap: 10px;
|
gap: 10px;
|
||||||
margin-top: 20px;
|
margin-top: 18px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.modal-buttons-left {
|
||||||
|
justify-content: flex-start;
|
||||||
|
}
|
||||||
|
|
||||||
|
.game-panel {
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
gap: 16px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.game-intro {
|
||||||
|
margin: 0;
|
||||||
|
line-height: 1.5;
|
||||||
|
}
|
||||||
|
|
||||||
|
.game-meta {
|
||||||
|
line-height: 1.4;
|
||||||
|
margin: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
.game-definition-box {
|
||||||
|
padding: 18px;
|
||||||
|
border: 1px solid var(--nav-btn-border);
|
||||||
|
border-radius: 8px;
|
||||||
|
background: rgba(127, 127, 127, 0.08);
|
||||||
|
}
|
||||||
|
|
||||||
|
.game-section-label {
|
||||||
|
font-size: 0.85rem;
|
||||||
|
font-weight: 700;
|
||||||
|
margin-bottom: 12px;
|
||||||
|
text-transform: uppercase;
|
||||||
|
letter-spacing: 0.04em;
|
||||||
|
opacity: 0.8;
|
||||||
|
}
|
||||||
|
|
||||||
|
.game-definitions {
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
gap: 10px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.game-definition-line {
|
||||||
|
padding-left: 16px;
|
||||||
|
border-left: 3px solid var(--nav-btn-primary-bg);
|
||||||
|
line-height: 1.5;
|
||||||
|
}
|
||||||
|
|
||||||
|
.game-input-row {
|
||||||
|
display: flex;
|
||||||
|
gap: 12px;
|
||||||
|
align-items: center;
|
||||||
|
flex-wrap: wrap;
|
||||||
|
}
|
||||||
|
|
||||||
|
.game-guess-input {
|
||||||
|
flex: 1 1 260px;
|
||||||
|
min-width: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
.game-feedback {
|
||||||
|
min-height: 1.4em;
|
||||||
|
font-weight: 600;
|
||||||
|
}
|
||||||
|
|
||||||
|
.game-feedback.is-success {
|
||||||
|
color: #27ae60;
|
||||||
|
}
|
||||||
|
|
||||||
|
.game-feedback.is-error {
|
||||||
|
color: #e74c3c;
|
||||||
|
}
|
||||||
|
|
||||||
|
.game-feedback.is-neutral {
|
||||||
|
color: var(--text-color);
|
||||||
|
}
|
||||||
|
|
||||||
|
.game-stats-grid {
|
||||||
|
display: grid;
|
||||||
|
grid-template-columns: repeat(2, minmax(0, 1fr));
|
||||||
|
gap: 14px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.game-stats-grid p {
|
||||||
|
padding: 12px 14px;
|
||||||
|
border: 1px solid var(--nav-btn-border);
|
||||||
|
border-radius: 8px;
|
||||||
|
background: rgba(127, 127, 127, 0.08);
|
||||||
|
}
|
||||||
|
|
||||||
|
.game-stats-grid strong {
|
||||||
|
display: block;
|
||||||
|
margin-bottom: 4px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.game-secret-answer {
|
||||||
|
font-size: 0.95rem;
|
||||||
|
opacity: 0.95;
|
||||||
|
}
|
||||||
|
|
||||||
|
.game-empty-state {
|
||||||
|
font-style: italic;
|
||||||
|
opacity: 0.8;
|
||||||
}
|
}
|
||||||
|
|
||||||
.modal-buttons .page-btn:hover {
|
.modal-buttons .page-btn:hover {
|
||||||
@@ -558,4 +738,37 @@ hr {
|
|||||||
margin-top: 8px;
|
margin-top: 8px;
|
||||||
font-size: 0.75rem;
|
font-size: 0.75rem;
|
||||||
font-style: italic;
|
font-style: italic;
|
||||||
|
}
|
||||||
|
|
||||||
|
.page-collapse {
|
||||||
|
border: 1px solid var(--nav-btn-border);
|
||||||
|
border-radius: 8px;
|
||||||
|
padding: 12px;
|
||||||
|
padding-top: 18px;
|
||||||
|
background: var(--nav-btn-bg);
|
||||||
|
color: var(--text-color);
|
||||||
|
transition: background-color 0.25s ease, border-color 0.25s ease, color 0.25s ease;
|
||||||
|
margin: 0 23px;
|
||||||
|
visibility: hidden;
|
||||||
|
}
|
||||||
|
|
||||||
|
.page-image-gallery {
|
||||||
|
display: flex;
|
||||||
|
gap: 10px;
|
||||||
|
margin-top: 12px;
|
||||||
|
justify-content: center;
|
||||||
|
}
|
||||||
|
|
||||||
|
.page-gallery-image {
|
||||||
|
width: 100%;
|
||||||
|
max-width: 30%;
|
||||||
|
border-radius: 4px;
|
||||||
|
border: 1px solid var(--nav-btn-border);
|
||||||
|
object-fit: cover;
|
||||||
|
transition: transform 0.25s ease, border-color 0.25s ease;
|
||||||
|
}
|
||||||
|
|
||||||
|
.page-gallery-image:hover {
|
||||||
|
transform: scale(1.05);
|
||||||
|
border-color: var(--nav-btn-hover-border);
|
||||||
}
|
}
|
||||||
5
vnos.html
Normal file → Executable file
5
vnos.html
Normal file → Executable file
@@ -3,6 +3,9 @@
|
|||||||
<head>
|
<head>
|
||||||
<meta charset="UTF-8">
|
<meta charset="UTF-8">
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||||
|
<meta name="description" content="SSNJ - Slovar Slovenskega Novega Jezika">
|
||||||
|
<meta name="robots" content="index,follow">
|
||||||
|
<meta name="author" content="Jonas Korene Novak / DcruBro">
|
||||||
<title>Glavna Stran</title>
|
<title>Glavna Stran</title>
|
||||||
<script src="./scripts/preload.js"></script>
|
<script src="./scripts/preload.js"></script>
|
||||||
<link rel="stylesheet" type="text/css" href="./styles/main.css">
|
<link rel="stylesheet" type="text/css" href="./styles/main.css">
|
||||||
@@ -17,7 +20,7 @@
|
|||||||
<div id="entry-container-single" class="entry-container-single">
|
<div id="entry-container-single" class="entry-container-single">
|
||||||
</div>
|
</div>
|
||||||
<p class="page-paragraph">
|
<p class="page-paragraph">
|
||||||
<a class="page-link" href="/">Glavna stran</a>
|
<a class="page-link" href="index.html" target="_top">Glavna stran</a>
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
<div class="modal" id="delete-entry-modal">
|
<div class="modal" id="delete-entry-modal">
|
||||||
|
|||||||
Reference in New Issue
Block a user