Warn with timer colors near timeout

This commit is contained in:
Wojtek
2026-10-15 19:50:39 +02:00
parent 83e70dd02f
commit 6ff2f72015
4 changed files with 5 additions and 2 deletions
+1 -1
View File
@@ -27,6 +27,6 @@ Szkielet komponentu Joomla 6 do gromadzenia pytań testowych.
## Instalacja ## Instalacja
W Joomla wybierz **System → Install → Install from Folder** i wskaż ten katalog. Manifestem instalacyjnym jest `com_testquestions.xml` (wersja 1.16.2). W Joomla wybierz **System → Install → Install from Folder** i wskaż ten katalog. Manifestem instalacyjnym jest `com_testquestions.xml` (wersja 1.16.3).
Po instalacji komponent jest dostępny w panelu administratora jako **Pytania testowe**. Po instalacji komponent jest dostępny w panelu administratora jako **Pytania testowe**.
@@ -0,0 +1 @@
-- No database changes required for version 1.16.3.
+1 -1
View File
@@ -4,7 +4,7 @@
<creationDate>2026-10-14</creationDate> <creationDate>2026-10-14</creationDate>
<author>Komponent</author> <author>Komponent</author>
<license>GNU General Public License version 2 or later</license> <license>GNU General Public License version 2 or later</license>
<version>1.16.2</version> <version>1.16.3</version>
<description>COM_TESTQUESTIONS_DESCRIPTION</description> <description>COM_TESTQUESTIONS_DESCRIPTION</description>
<element>com_testquestions</element> <element>com_testquestions</element>
<namespace path="src">Komponent\Component\Testquestions</namespace> <namespace path="src">Komponent\Component\Testquestions</namespace>
@@ -127,8 +127,10 @@ document.addEventListener('DOMContentLoaded', function () {
const update = function () { const update = function () {
const minutes = Math.floor(remaining / 60); const minutes = Math.floor(remaining / 60);
const seconds = remaining % 60; const seconds = remaining % 60;
const ratio = remaining / total;
text.textContent = String(minutes).padStart(2, '0') + ':' + String(seconds).padStart(2, '0'); text.textContent = String(minutes).padStart(2, '0') + ':' + String(seconds).padStart(2, '0');
ring.style.strokeDashoffset = circumference * (1 - remaining / total); ring.style.strokeDashoffset = circumference * (1 - remaining / total);
ring.style.stroke = ratio <= 0.1 ? '#dc3545' : (ratio <= 0.2 ? '#fd7e14' : '#4a86cf');
if (remaining <= 0 && !submitted) { if (remaining <= 0 && !submitted) {
submitted = true; submitted = true;