From 3b3fece21f8ab0e934f198f1f57a06a21600338c Mon Sep 17 00:00:00 2001 From: Tor Andersson Date: Sat, 2 Dec 2023 16:03:32 +0100 Subject: Dice images. --- images/d4.1x.png | Bin 0 -> 937 bytes images/d4.2x.png | Bin 0 -> 1771 bytes images/d6.1x.png | Bin 0 -> 1167 bytes images/d6.2x.png | Bin 0 -> 2207 bytes images/d8.1x.png | Bin 0 -> 742 bytes images/d8.2x.png | Bin 0 -> 1603 bytes play.html | 40 +++++++++++++++++++++++++++------------- play.js | 36 ++++++++++++++++++------------------ tools/d4.svg | 16 ++++++++++++++++ tools/d6.svg | 19 +++++++++++++++++++ tools/d8.svg | 23 +++++++++++++++++++++++ tools/renderdice.sh | 9 +++++++++ 12 files changed, 112 insertions(+), 31 deletions(-) create mode 100644 images/d4.1x.png create mode 100644 images/d4.2x.png create mode 100644 images/d6.1x.png create mode 100644 images/d6.2x.png create mode 100644 images/d8.1x.png create mode 100644 images/d8.2x.png create mode 100644 tools/d4.svg create mode 100644 tools/d6.svg create mode 100644 tools/d8.svg create mode 100644 tools/renderdice.sh diff --git a/images/d4.1x.png b/images/d4.1x.png new file mode 100644 index 0000000..f3c6b2d Binary files /dev/null and b/images/d4.1x.png differ diff --git a/images/d4.2x.png b/images/d4.2x.png new file mode 100644 index 0000000..2eada93 Binary files /dev/null and b/images/d4.2x.png differ diff --git a/images/d6.1x.png b/images/d6.1x.png new file mode 100644 index 0000000..572d2d6 Binary files /dev/null and b/images/d6.1x.png differ diff --git a/images/d6.2x.png b/images/d6.2x.png new file mode 100644 index 0000000..7dd00fd Binary files /dev/null and b/images/d6.2x.png differ diff --git a/images/d8.1x.png b/images/d8.1x.png new file mode 100644 index 0000000..ce8ff5b Binary files /dev/null and b/images/d8.1x.png differ diff --git a/images/d8.2x.png b/images/d8.2x.png new file mode 100644 index 0000000..4099f5d Binary files /dev/null and b/images/d8.2x.png differ diff --git a/play.html b/play.html index 47de302..e210d36 100644 --- a/play.html +++ b/play.html @@ -38,8 +38,8 @@ main { background-color: slategray; } -#role_Suffragist .role_name { background-color: var(--suf-85); } -#role_Opposition .role_name { background-color: var(--opp-85); } +#role_Suffragist { background-color: var(--suf-85); } +#role_Opposition { background-color: var(--opp-85); } .role.active .role_name span { text-decoration: underline; } .role_vp { float: right; height: 24px; color: #000c; } @@ -75,22 +75,36 @@ body.Opposition header.your_turn { background-color: var(--opp-75); } border-radius: 0px; box-shadow: none; border: none; - background-size: 100% 100%; + background-size: contain; + background-position: center; background-repeat: no-repeat; } -#log .die_d4 { - color: #4397D4; - font-weight: bold; -} - -#log .die_d6 { - color: #DE5646; - font-weight: bold; +#log .die_d4, #log .die_d6, #log .die_d8 { + display: inline-block; + vertical-align: -3px; + width: 15px; + height: 15px; + background-size: auto 15px; } -#log .die_d8 { - font-weight: bold; +#log .d1 { background-position: -0px 0px; } +#log .d2 { background-position: -15px 0px; } +#log .d3 { background-position: -30px 0px; } +#log .d4 { background-position: -45px 0px; } +#log .d5 { background-position: -60px 0px; } +#log .d6 { background-position: -75px 0px; } +#log .d7 { background-position: -90px 0px; } +#log .d8 { background-position: -105px 0px; } + +#log .die_d4 { background-image: url(images/d4.1x.png); } +#log .die_d6 { background-image: url(images/d6.1x.png); } +#log .die_d8 { background-image: url(images/d8.1x.png); } + +@media (min-resolution: 97dpi) { +#log .die_d4 { background-image: url(images/d4.2x.png); } +#log .die_d6 { background-image: url(images/d6.2x.png); } +#log .die_d8 { background-image: url(images/d8.2x.png); } } #log .purple_campaigner { diff --git a/play.js b/play.js index fa44fae..f31cf6d 100644 --- a/play.js +++ b/play.js @@ -499,24 +499,24 @@ function sub_us_state_name(_match, p1, _offset, _string) { } const ICONS = { - B1: '', - B2: '', - B3: '', - B4: '', - D1: '', - D2: '', - D3: '', - D4: '', - D5: '', - D6: '', - W1: '', - W2: '', - W3: '', - W4: '', - W5: '', - W6: '', - W7: '', - W8: '', + B1: '', + B2: '', + B3: '', + B4: '', + D1: '', + D2: '', + D3: '', + D4: '', + D5: '', + D6: '', + W1: '', + W2: '', + W3: '', + W4: '', + W5: '', + W6: '', + W7: '', + W8: '', PR: '', YR: '', RR: '', diff --git a/tools/d4.svg b/tools/d4.svg new file mode 100644 index 0000000..c54970d --- /dev/null +++ b/tools/d4.svg @@ -0,0 +1,16 @@ + + + + + + + + + + +1 +2 +3 +4 + + diff --git a/tools/d6.svg b/tools/d6.svg new file mode 100644 index 0000000..cc1dc9b --- /dev/null +++ b/tools/d6.svg @@ -0,0 +1,19 @@ + + + + + + + + + + + +1 +2 +3 +4 +5 +6 + + diff --git a/tools/d8.svg b/tools/d8.svg new file mode 100644 index 0000000..2ced828 --- /dev/null +++ b/tools/d8.svg @@ -0,0 +1,23 @@ + + + + + + + + + + + + + +1 +2 +3 +4 +5 +6 +7 +8 + + diff --git a/tools/renderdice.sh b/tools/renderdice.sh new file mode 100644 index 0000000..d2f91c4 --- /dev/null +++ b/tools/renderdice.sh @@ -0,0 +1,9 @@ +inkscape --export-dpi=1920 -o d4.png tools/d4.svg +inkscape --export-dpi=1920 -o d6.png tools/d6.svg +inkscape --export-dpi=1920 -o d8.png tools/d8.svg +for F in d?.png +do + convert -colorspace RGB -resize 6.25% -colorspace sRGB $F images/${F/.png/.1x.png} + convert -colorspace RGB -resize 12.5% -colorspace sRGB $F images/${F/.png/.2x.png} +done +rm d4.png d6.png d8.png -- cgit v1.2.3