From 78f3e96aa6552dcc15f0283d7908c8a245835993 Mon Sep 17 00:00:00 2001 From: danoloan10 Date: Sun, 23 Jul 2023 00:08:09 +0200 Subject: [PATCH] =?UTF-8?q?Aumentar=20fuente=20de=20=C3=ADndice?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- storage/jstime.go | 17 ++++++++++------- templates/index.html | 6 +++--- 2 files changed, 13 insertions(+), 10 deletions(-) diff --git a/storage/jstime.go b/storage/jstime.go index 8d1f0ff..52527be 100644 --- a/storage/jstime.go +++ b/storage/jstime.go @@ -1,9 +1,9 @@ package storage import ( + "encoding/json" "fmt" "strconv" - "strings" "time" ) @@ -16,15 +16,18 @@ const ( jsTimeLayout = "2006-01-02 15:04:05" ) -func (ct JSTime) UnmarshalJSON(b []byte) (err error) { - return ct.UnmarshalParam(string(b)) +func (ct *JSTime) UnmarshalJSON(blob []byte) (err error) { + var jsonString string + if err = json.Unmarshal(blob, &jsonString); err == nil { + err = ct.UnmarshalParam(jsonString) + } + return } -func (ct JSTime) UnmarshalParam(param string) (err error) { - s := strings.Trim(param, `"`) +func (ct *JSTime) UnmarshalParam(param string) (err error) { loc, _ := time.LoadLocation("Europe/Madrid") - nt, err := time.ParseInLocation(jsTimeLite, s, loc) - ct = JSTime(nt) + nt, err := time.ParseInLocation(jsTimeLite, param, loc) + *ct = JSTime(nt) return } diff --git a/templates/index.html b/templates/index.html index 568b4a4..421fa75 100644 --- a/templates/index.html +++ b/templates/index.html @@ -23,7 +23,7 @@ body { transition: transform .1s; box-sizing: border-box; word-break: break-word; - font-size: calc(0.5em + 1vw); + font-size: large; } .elem:hover { @@ -89,14 +89,14 @@ nav > a:hover { } @media screen and (max-width: 700px) { .elem { - width: calc((100% - (5px * 6)) / 2); + width: calc((100% - (5px * 4)) / 2); + font-size: medium; } } @media screen and (max-width: 320px) { .elem { width: 100%; display: block; - font-size: calc(0.65em + 1vw); } }