From ecbad7ce6ca757f9d1f7750c2295fe4af0b6a5ed Mon Sep 17 00:00:00 2001 From: Carlos Medina Date: Wed, 8 May 2024 16:51:04 -0600 Subject: [PATCH 01/47] Add mobile web app support --- internal/assets/static/app-icon.png | Bin 0 -> 7946 bytes internal/assets/static/main.css | 8 ++++++++ internal/assets/static/manifest.json | 13 +++++++++++++ internal/assets/templates/document.html | 8 ++++++++ 4 files changed, 29 insertions(+) create mode 100644 internal/assets/static/app-icon.png create mode 100644 internal/assets/static/manifest.json diff --git a/internal/assets/static/app-icon.png b/internal/assets/static/app-icon.png new file mode 100644 index 0000000000000000000000000000000000000000..54fc4131137d09784f3057b58cc18afdaab13ba4 GIT binary patch literal 7946 zcmeHMc{r5o-+z#tRz;<3BSMxql6@H^Nff7&M59BJER!wE45Q_gB}+ua7=mVJsO8Va8Y*gPD2n$M5{E_n+VU?|Z%1^`3v`d9LTV=YGET_x>)Q&*zS`IcL6O ztN2z3f_7M(K6xI3_`xkd^xI}|Sqkc21s6WQ^X4a@LbBvE1WDIfoIHLpD1B}S_p~Pf zzryU>o>jYjc6;XbgeS7iN`I|CNs+?MTee?O78?{1`{T{oz_(wJMHTo`?ZFQo=$U0U3^@$uc#U(Z}E6!LyR&O#z_h(+#OB|1jp6-+U z{hG=4{l8x$aPe;)${H#HX1G%`e~F=jEDa#{9$>{w1C~hbjKO4zi*skTg~p$sAL!CQ zQpetX+1Wzslo)vLe!+0zt6UM5y>PksdSoL1)Qe5f((fNWe9-Wwd`vm!e%>m>Q14W% zWGW`7%(E@Ss3>Il=j952ch##E$1<=BO%xSA;x4FN;MlQabq}_PIxmbj!5_JK>sB+V z^Eh*<%bF2$R|tXqy`rMRm$<231d8u~*K>iedNCcxWp|XJM<_FgKDac-u8;$(MRi87 zex8G+M_Bqcl6+8PPj`1+U8JbXui1W|h68TnD8))KC#=T4BUkn;(%RydXZmO;p{Rq9 z%#$$AYP~sfwd3PbrzLeND~?P$7uPj3B-QdvJx*}jzPjcl6+fatk|H!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LwR#~I$rb57J=sX!L2E3uL>-vDOjbn%K^FF73S`k zU$Y+<$p)}AnP9H^-FgH>!qA^;MIdDB#+wqUcZH;3`S1!|5E44=<>loFdY(ogodOG0 zq;v9K!&Q2)%*Ut+7pUC=Ny?~`md>j>e*7Ku7eus}IuMj|`~w2&b*h;$`;lQ)ia1>p z0AG$D^%<*Mq2ahRT>xu*iJkeN?;@jBh*d{>iB1H}-n>10kkB8Yp`k$ZRWx3HZ4Knw zJ~j~FM0u-3o;X|@fXP5>mbnWUTD_Ur)jhDX00L|hm1~Zf|0G0xmF68a(eiBVCPMNg zKO_PJ7CpJQyhx$fV8I z!9gMy2ol3xce7&km04%d18|}NMFbZ18pi6QT^1+5mD};7%penW4Ip}K98v&v5C&!p z4y~b~!P8)_zeG{no3bA$3*Cs&0Du4MgWFcRz;T5yET;kLO^>+;ACdfh?&7oZ;}L^J z905|5!JXL%DT6z3@#KzL40D7tSt5{)4`^5&-Q9Zt5&)O?ERXN+{@hJ;yusojn_yKg zj8!=@7y23P;n6}ez8(J?IQ_FpMHp`m|NPJS-#_Pn|Ka@ae>fZFAm7tmR(-x + + + + + + + + From 461c984317c86d6e32cd289853a892f634a7d978 Mon Sep 17 00:00:00 2001 From: Svilen Markov <7613769+svilenmarkov@users.noreply.github.com> Date: Thu, 9 May 2024 04:05:25 +0100 Subject: [PATCH 02/47] Check if background color is nil before setting --- internal/assets/templates/document.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/internal/assets/templates/document.html b/internal/assets/templates/document.html index 8929579..dbc19e3 100644 --- a/internal/assets/templates/document.html +++ b/internal/assets/templates/document.html @@ -10,7 +10,7 @@ - + From 91c75518dadcca02a1490d9df60b216f6b76c48c Mon Sep 17 00:00:00 2001 From: Carlos Medina Date: Fri, 10 May 2024 19:54:43 -0600 Subject: [PATCH 03/47] Change mobile nav styles --- internal/assets/static/main.css | 71 +++++++++++++++++++------ internal/assets/templates/document.html | 2 +- 2 files changed, 55 insertions(+), 18 deletions(-) diff --git a/internal/assets/static/main.css b/internal/assets/static/main.css index 36700b9..49b0d67 100644 --- a/internal/assets/static/main.css +++ b/internal/assets/static/main.css @@ -909,15 +909,11 @@ body { .mobile-navigation { display: block; position: fixed; + height: var(--mobile-navigation-height); bottom: 0; - transform: translateY(calc(100% - var(--mobile-navigation-height))); left: var(--content-bounds-padding); right: var(--content-bounds-padding); z-index: 10; - background-color: var(--color-widget-background); - border: 1px solid var(--color-widget-content-border); - border-bottom: 0; - border-radius: var(--border-radius) var(--border-radius) 0 0; transition: transform .3s; } @@ -927,23 +923,50 @@ body { height: 2px; } - .mobile-navigation:has(.mobile-navigation-page-links-input:checked) { - transform: translateY(0); - } - .mobile-navigation-page-links { - border-top: 1px solid var(--color-widget-content-border); - padding: 15px var(--content-bounds-padding); display: flex; align-items: center; + position: relative; + height: 100%; + background-color: var(--color-widget-background); + border: 1px solid transparent; + border-top: 0; + border-bottom: 0; + padding: 0 var(--content-bounds-padding); overflow-x: scroll; gap: 2.5rem; + transition: border-color 0s .2s, transform .3s; + z-index: 1; + } + + .mobile-navigation:has(.mobile-navigation-page-links-input:checked) .mobile-navigation-page-links { + border-color: var(--color-widget-content-border); + transition: transform .3s; + } + + .mobile-navigation-page-links .nav-item { + line-height: var(--mobile-navigation-height); } .mobile-navigation-icons { display: flex; justify-content: space-around; align-items: center; + position: absolute; + width: 100%; + height: 100%; + background-color: var(--color-widget-background); + border: 1px solid var(--color-widget-content-border); + border-bottom-color: transparent; + border-radius: var(--border-radius) var(--border-radius) 0 0; + transition: border .3s, border-radius .3s, transform .3s; + z-index: 2; + } + + .mobile-navigation:has(.mobile-navigation-page-links-input:checked) .mobile-navigation-icons { + border-bottom-color: var(--color-widget-content-border); + border-radius: var(--border-radius) var(--border-radius) 0 0; + transform: translateY(-100%); } body:has(.mobile-navigation-input[value="0"]:checked) .page-columns > :nth-child(1), @@ -955,13 +978,12 @@ body { .mobile-navigation-label { display: flex; flex: 1; + align-self: stretch; max-width: 50px; - height: var(--mobile-navigation-height); justify-content: center; align-items: center; cursor: pointer; font-size: 15px; - line-height: var(--mobile-navigation-height); } .mobile-navigation-pill { @@ -1023,11 +1045,26 @@ body { } @media (display-mode: standalone) { - @supports (-webkit-touch-callout: none) { - .mobile-navigation { - bottom: 15px; + body { + padding-top: env(safe-area-inset-top, 0); + } + + .mobile-navigation { + bottom: env(safe-area-inset-bottom, 0); + } + + .mobile-navigation::after { + content: ''; + position: absolute; + background: var(--color-widget-background); + height: calc(var(--mobile-navigation-height) + env(safe-area-inset-bottom, 0)); + top: 0; + left: 0; + right: 0; + border: 1px solid var(--color-widget-content-border); + border-bottom: 0; + border-radius: var(--border-radius) var(--border-radius) 0 0; } - } } .size-h1 { font-size: var(--font-size-h1); } diff --git a/internal/assets/templates/document.html b/internal/assets/templates/document.html index dbc19e3..aa3aac2 100644 --- a/internal/assets/templates/document.html +++ b/internal/assets/templates/document.html @@ -5,7 +5,7 @@ {{ block "document-title" . }}{{ end }} - + From bc06578e53a0c54f71d63d9868d0ca7ceaf0765d Mon Sep 17 00:00:00 2001 From: Svilen Markov <7613769+svilenmarkov@users.noreply.github.com> Date: Sun, 12 May 2024 14:20:10 +0100 Subject: [PATCH 04/47] Change implementation for the safe area --- internal/assets/static/main.css | 97 +++++++++++++-------------------- 1 file changed, 39 insertions(+), 58 deletions(-) diff --git a/internal/assets/static/main.css b/internal/assets/static/main.css index 49b0d67..4348d57 100644 --- a/internal/assets/static/main.css +++ b/internal/assets/static/main.css @@ -909,11 +909,15 @@ body { .mobile-navigation { display: block; position: fixed; - height: var(--mobile-navigation-height); bottom: 0; + transform: translateY(calc(100% - var(--mobile-navigation-height))); left: var(--content-bounds-padding); right: var(--content-bounds-padding); z-index: 10; + background-color: var(--color-widget-background); + border: 1px solid var(--color-widget-content-border); + border-bottom: 0; + border-radius: var(--border-radius) var(--border-radius) 0 0; transition: transform .3s; } @@ -923,50 +927,23 @@ body { height: 2px; } + .mobile-navigation:has(.mobile-navigation-page-links-input:checked) { + transform: translateY(0); + } + .mobile-navigation-page-links { + border-top: 1px solid var(--color-widget-content-border); + padding: 15px var(--content-bounds-padding); display: flex; align-items: center; - position: relative; - height: 100%; - background-color: var(--color-widget-background); - border: 1px solid transparent; - border-top: 0; - border-bottom: 0; - padding: 0 var(--content-bounds-padding); overflow-x: scroll; gap: 2.5rem; - transition: border-color 0s .2s, transform .3s; - z-index: 1; - } - - .mobile-navigation:has(.mobile-navigation-page-links-input:checked) .mobile-navigation-page-links { - border-color: var(--color-widget-content-border); - transition: transform .3s; - } - - .mobile-navigation-page-links .nav-item { - line-height: var(--mobile-navigation-height); } .mobile-navigation-icons { display: flex; justify-content: space-around; align-items: center; - position: absolute; - width: 100%; - height: 100%; - background-color: var(--color-widget-background); - border: 1px solid var(--color-widget-content-border); - border-bottom-color: transparent; - border-radius: var(--border-radius) var(--border-radius) 0 0; - transition: border .3s, border-radius .3s, transform .3s; - z-index: 2; - } - - .mobile-navigation:has(.mobile-navigation-page-links-input:checked) .mobile-navigation-icons { - border-bottom-color: var(--color-widget-content-border); - border-radius: var(--border-radius) var(--border-radius) 0 0; - transform: translateY(-100%); } body:has(.mobile-navigation-input[value="0"]:checked) .page-columns > :nth-child(1), @@ -978,12 +955,13 @@ body { .mobile-navigation-label { display: flex; flex: 1; - align-self: stretch; max-width: 50px; + height: var(--mobile-navigation-height); justify-content: center; align-items: center; cursor: pointer; font-size: 15px; + line-height: var(--mobile-navigation-height); } .mobile-navigation-pill { @@ -1026,6 +1004,32 @@ body { } } +@media (max-width: 1190px) and (display-mode: standalone) { + :root { + --safe-area-inset-bottom: env(safe-area-inset-bottom, 0); + } + + .mobile-navigation { + transform: translateY(calc(100% - var(--mobile-navigation-height) - var(--safe-area-inset-bottom))); + padding-bottom: var(--safe-area-inset-bottom); + } + + .mobile-navigation-icons { + padding-bottom: var(--safe-area-inset-bottom); + transition: padding-bottom .3s; + } + + .mobile-navigation-icons:has(.mobile-navigation-page-links-input:checked) { + padding-bottom: 0; + } +} + +@media (display-mode: standalone) { + body { + padding-top: env(safe-area-inset-top, 0); + } +} + @media (max-width: 550px) { :root { font-size: 9px; @@ -1044,29 +1048,6 @@ body { } } -@media (display-mode: standalone) { - body { - padding-top: env(safe-area-inset-top, 0); - } - - .mobile-navigation { - bottom: env(safe-area-inset-bottom, 0); - } - - .mobile-navigation::after { - content: ''; - position: absolute; - background: var(--color-widget-background); - height: calc(var(--mobile-navigation-height) + env(safe-area-inset-bottom, 0)); - top: 0; - left: 0; - right: 0; - border: 1px solid var(--color-widget-content-border); - border-bottom: 0; - border-radius: var(--border-radius) var(--border-radius) 0 0; - } -} - .size-h1 { font-size: var(--font-size-h1); } .size-h2 { font-size: var(--font-size-h2); } .size-h3 { font-size: var(--font-size-h3); } From 09b7d7110385fa6bf2ff2e5f51942cef7e08d507 Mon Sep 17 00:00:00 2001 From: Svilen Markov <7613769+svilenmarkov@users.noreply.github.com> Date: Sun, 12 May 2024 14:27:25 +0100 Subject: [PATCH 05/47] Revert to using the small icon for the favicon Bit too much whitespace in the app icon to be able to use it as a favicon, makes the G look quite small --- internal/assets/templates/document.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/internal/assets/templates/document.html b/internal/assets/templates/document.html index aa3aac2..d126d8b 100644 --- a/internal/assets/templates/document.html +++ b/internal/assets/templates/document.html @@ -12,7 +12,7 @@ - + From f9ca93e0b072293d719e847cb6a2b2529a82a162 Mon Sep 17 00:00:00 2001 From: Svilen Markov <7613769+svilenmarkov@users.noreply.github.com> Date: Sun, 12 May 2024 14:45:13 +0100 Subject: [PATCH 06/47] Account for safe area in label offset --- internal/assets/static/main.css | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/internal/assets/static/main.css b/internal/assets/static/main.css index 4348d57..44df545 100644 --- a/internal/assets/static/main.css +++ b/internal/assets/static/main.css @@ -1009,6 +1009,10 @@ body { --safe-area-inset-bottom: env(safe-area-inset-bottom, 0); } + .list-collapsible-label:has(.list-collapsible-input:checked) { + bottom: calc(var(--mobile-navigation-height) + var(--safe-area-inset-bottom)); + } + .mobile-navigation { transform: translateY(calc(100% - var(--mobile-navigation-height) - var(--safe-area-inset-bottom))); padding-bottom: var(--safe-area-inset-bottom); From 6a7b50b35fefe10e3731c2b3afacb9cb60c920e9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tar=C4=B1k=20Co=C5=9Fkun?= Date: Mon, 13 May 2024 15:08:58 +0300 Subject: [PATCH 07/47] Add 24-hour time format support for weather --- docs/configuration.md | 7 ++++++- internal/widget/weather.go | 13 +++++++++++-- 2 files changed, 17 insertions(+), 3 deletions(-) diff --git a/docs/configuration.md b/docs/configuration.md index e698fdd..e54ebb0 100644 --- a/docs/configuration.md +++ b/docs/configuration.md @@ -647,6 +647,7 @@ Example: ```yaml - type: weather units: metric + hour-format: 12h location: London, United Kingdom ``` @@ -671,6 +672,7 @@ Each bar represents a 2 hour interval. The yellow background represents sunrise | ---- | ---- | -------- | ------- | | location | string | yes | | | units | string | no | metric | +| hour-format | string | no | 12h | | hide-location | boolean | no | false | | show-area-name | boolean | no | false | @@ -680,6 +682,9 @@ The name of the city and country to fetch weather information for. Attempting to ##### `units` Whether to show the temperature in celsius or fahrenheit, possible values are `metric` or `imperial`. +#### `hour-format` +Whether to show the hours of the day in 12-hour format or 24-hour format + ##### `hide-location` Optionally don't display the location name on the widget. @@ -1131,4 +1136,4 @@ Example: The source of the iframe. ##### `height` -The height of the iframe. The minimum allowed height is 50. +The height of the iframe. The minimum allowed height is 50. \ No newline at end of file diff --git a/internal/widget/weather.go b/internal/widget/weather.go index 9d90e03..723d1db 100644 --- a/internal/widget/weather.go +++ b/internal/widget/weather.go @@ -14,17 +14,26 @@ type Weather struct { Location string `yaml:"location"` ShowAreaName bool `yaml:"show-area-name"` HideLocation bool `yaml:"hide-location"` + HourFormat string `yaml:"hour-format"` Units string `yaml:"units"` Place *feed.PlaceJson `yaml:"-"` Weather *feed.Weather `yaml:"-"` TimeLabels [12]string `yaml:"-"` } -var timeLabels = [12]string{"2am", "4am", "6am", "8am", "10am", "12pm", "2pm", "4pm", "6pm", "8pm", "10pm", "12am"} +var timeLabels12h = [12]string{"2am", "4am", "6am", "8am", "10am", "12pm", "2pm", "4pm", "6pm", "8pm", "10pm", "12am"} +var timeLabels24h = [12]string{"02:00", "04:00", "06:00", "08:00", "10:00", "12:00", "14:00", "16:00", "18:00", "20:00", "22:00", "24:00"} func (widget *Weather) Initialize() error { widget.withTitle("Weather").withCacheOnTheHour() - widget.TimeLabels = timeLabels + + if widget.HourFormat == "" || widget.HourFormat == "12h" { + widget.TimeLabels = timeLabels12h + } else if widget.HourFormat == "24h" { + widget.TimeLabels = timeLabels24h + } else if widget.Units != "12h" && widget.Units != "24h" { + return fmt.Errorf("invalid hour format '%s' for weather, must be either 12h or 24h", widget.HourFormat) + } if widget.Units == "" { widget.Units = "metric" From 48d4d4e9669ef1bd6752cd6d11bd7ed137d3f2c4 Mon Sep 17 00:00:00 2001 From: Svilen Markov <7613769+svilenmarkov@users.noreply.github.com> Date: Tue, 14 May 2024 06:28:42 +0100 Subject: [PATCH 08/47] Revert back to vh dvh causes micro jumps when scrolling near the top of the page which looks glitchy --- internal/assets/static/main.css | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/internal/assets/static/main.css b/internal/assets/static/main.css index 1e64def..48e6eb7 100644 --- a/internal/assets/static/main.css +++ b/internal/assets/static/main.css @@ -1134,7 +1134,7 @@ body { .mobile-reachability-header { display: block; font-size: 3rem; - padding: 10dvh 1rem; + padding: 10vh 1rem; text-align: center; color: var(--color-text-highlight); animation: pageColumnsEntrance .3s cubic-bezier(0.25, 1, 0.5, 1) backwards; From 7e05f8a5ebc78fe1b6e6a64977cee8f6bca05582 Mon Sep 17 00:00:00 2001 From: Svilen Markov <7613769+svilenmarkov@users.noreply.github.com> Date: Tue, 14 May 2024 14:32:51 +0100 Subject: [PATCH 09/47] Add carousel right cutoff by default Prevents it from fading in when the page loads --- internal/assets/static/main.js | 1 + 1 file changed, 1 insertion(+) diff --git a/internal/assets/static/main.js b/internal/assets/static/main.js index 05dbc45..d0df1d8 100644 --- a/internal/assets/static/main.js +++ b/internal/assets/static/main.js @@ -35,6 +35,7 @@ function setupCarousels() { for (let i = 0; i < carouselElements.length; i++) { const carousel = carouselElements[i]; + carousel.classList.add("show-right-cutoff"); const itemsContainer = carousel.getElementsByClassName("carousel-items-container")[0]; const determineSideCutoffs = () => { From 514d5f92d18bfe8b53fdb942692ed5c1895bcdd0 Mon Sep 17 00:00:00 2001 From: Svilen Markov <7613769+svilenmarkov@users.noreply.github.com> Date: Tue, 14 May 2024 14:33:24 +0100 Subject: [PATCH 10/47] Add link to release notes --- internal/assets/templates/page.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/internal/assets/templates/page.html b/internal/assets/templates/page.html index 61fad9e..ee1eea8 100644 --- a/internal/assets/templates/page.html +++ b/internal/assets/templates/page.html @@ -59,7 +59,7 @@