aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorzlg <zlg@zlg.space>2024-09-25 14:46:27 -0700
committerzlg <zlg@zlg.space>2024-09-25 14:46:27 -0700
commitdc7eb8faaddedd2c90684404c90f622d3260d5f5 (patch)
treea96f1937f6394e8ce7081905b46d5ec452a48def
parenttimer.css: Remove some styling to make CSS easier (diff)
downloadzsst-dc7eb8faaddedd2c90684404c90f622d3260d5f5.tar.gz
zsst-dc7eb8faaddedd2c90684404c90f622d3260d5f5.tar.bz2
zsst-dc7eb8faaddedd2c90684404c90f622d3260d5f5.tar.xz
zsst-dc7eb8faaddedd2c90684404c90f622d3260d5f5.zip
Add Persona 5 Phansite-like countdown styleHEADmaster
This *requires* custom CSS for best effect.
-rw-r--r--make_timer.html1
-rw-r--r--timer.js20
2 files changed, 17 insertions, 4 deletions
diff --git a/make_timer.html b/make_timer.html
index 3a6e178..1a2704c 100644
--- a/make_timer.html
+++ b/make_timer.html
@@ -21,6 +21,7 @@
<label for="cdstyle">Countdown Style</label>
<input type="radio" id="cdstyle" name="cdstyle" value="standard">Standard Countdown</input>
<input type="radio" id="cdstyle" name="cdstyle" value="bar">Progress Bar</input>
+ <input type="radio" id="cdstyle" name="cdstyle" value="p5">Persona 5</input>
</section>
<section>
<label for="duration">Countdown Duration, in seconds</label>
diff --git a/timer.js b/timer.js
index f625094..c947036 100644
--- a/timer.js
+++ b/timer.js
@@ -23,7 +23,18 @@ function setupCountdown() {
break;
case "bar":
page.innerHTML = `
- <div id="bar"><div id="progress"></div>
+ <div id="bar"><div id="progress"></div></div>
+ <div id="countdown">
+ <div id="minutes">00</div>
+ <div id="separator">:</div>
+ <div id="seconds">00</div>
+ </div>
+ `;
+ break;
+ case "p5":
+ page.innerHTML = `
+ <div id="prompt">Are you ready to <span>Enter Game Z</span>?</div>
+ <div id="bar"><div id="progress"></div></div>
<div id="countdown">
<div id="minutes">00</div>
<div id="separator">:</div>
@@ -39,7 +50,7 @@ function setupCountdown() {
cd.style.fontFamily = params.get("f_family");
}
cd.style.color = params.get("f_color");
- if (params.get("cdstyle") == "bar") {
+ if (params.get("cdstyle") == "bar" || params.get("cdstyle") == "p5") {
document.getElementById("progress").style.backgroundColor = params.get("b_color");
}
@@ -53,6 +64,7 @@ function tick() {
cd.removeChild(cd.firstChild);
}
let end_msg = document.createElement("div");
+ end_msg.id = "endmsg";
end_msg.textContent = params.get("end_text");
cd.appendChild(end_msg);
window.clearInterval(timer_id);
@@ -60,7 +72,7 @@ function tick() {
}
cur_seconds--;
draw();
- if (params.get("cdstyle") == "bar") {
+ if (params.get("cdstyle") == "bar" || params.get("cdstyle") == "p5") {
draw_bar();
}
}
@@ -71,7 +83,7 @@ function draw() {
}
function draw_bar() {
- document.getElementById("progress").style.width = (((params.get("duration") - cur_seconds) / params.get("duration")) * 100) + "vw";
+ document.getElementById("progress").style.width = (((params.get("duration") - cur_seconds) / params.get("duration")) * 100) + "%";
}
function zero_pad(num) {
/td> Also add the "--width" option to specify the maximum width of the table. 2018-09-08setup.py: Bump to alpha4 for PyPIzlg1-1/+1 2018-09-08cli: add '--raw' option to list commandzlg2-9/+45 Add '--raw' option to the list command, in addition to proper note expansion. Newline characters in notes are escaped to be friendly to scripting. This option may be shortened to '-r' at the user's convenience. In raw output mode, the information is formatted in plain pipe-delimited strings, one line per row: title|system|ownership|progress|notes ownership and progress are printed in their numeric form, consistent with the OWNERSHIP and PROGRESS dictionaries in the vgstash package. An empty notes field will result in a line ending with a pipe and no whitespace following it. 2018-09-08Add remaining filters to vgstash packagezlg1-2/+11 2018-09-04Update LICENSE to match setup.pyzlg1-80/+67 Whoops. 2018-09-03Branch off from master with pytest, tox, clickzlg16-778/+779 This commit is huge, but contains everything needed for a "proper" build system built on pytest + tox and a CLI built with click. For now, this branch will contain all new vgstash development activity until it reaches feature parity with master. The CLI is installed to pip's PATH. Only the 'init', 'add', and 'list' commands work, with only two filters. This is pre-alpha software, and is therefore not stable yet. 2018-03-18Flesh out filter types and ownership statuszlg3-82/+144 It's time for a refactor to a module; the functionality and interface are clashing. 2018-03-18README.mdown: break line correctlyzlg1-1/+1 2018-03-18add 'playlog' list filterzlg2-2/+9 This filter is used to get an idea of which games you're currently playing through, so you can prioritize games to play when you're bored and detect it when you've beaten a game but haven't marked it as such. 2018-03-13Update helpers a bitzlg1-2/+9 At present, user modification is needed to make these seamless. vgup() may need to be axed in favor of telling the user to make an alias. 2018-03-13Make VGSTASH_DB_LOCATION point to a filezlg2-21/+20 It used to point to a directory, which would then look for .vgstash.db. This behavior was kind of backwards and I don't remember why I did it that way. This change gives users more control over where they put their DB. Be sure to update your environment variable if you have it set! 2016-11-18Remove settings from helpers.shZe Libertine Gamer1-5/+0 Sourcing them in .bash_profile screws up login if they're set. 2016-11-15Correct phrasing in README.Ze Libertine Gamer1-4/+4 2016-11-13DerpZe Libertine Gamer1-0/+1 2016-11-03Improve error handling in shell scriptsZe Libertine Gamer4-3/+23 2016-10-24Correct run_again, add recursionZe Libertine Gamer1-0/+4 Loops and functions -- oh my, what a useful combination. :) 2016-10-21Add quotes to correct behavior for arglistZe Libertine Gamer1-1/+1 2016-10-14updater.sh: add recursion, error handlingZe Libertine Gamer1-43/+101 2016-10-14Correct pipe-handling behaviorZe Libertine Gamer1-1/+9 2016-10-12Clarify a method to move between platformsZe Libertine Gamer1-2/+5 Also correct a typo.