From ea07f925a315cd4603cac9e2045929bd837d3aad Mon Sep 17 00:00:00 2001 From: VnPower Date: Mon, 16 Oct 2023 17:31:40 +0700 Subject: [PATCH] More things --- handler/template.go | 8 ++ template/assets/calendar.png | Bin 0 -> 303 bytes template/css/style.css | 24 ++++-- template/css/style.scss | 27 ++++-- template/layout.jet.html | 13 ++- template/pages/artwork.jet.html | 13 ++- template/pages/tag.jet.html | 142 ++++++++++++++++---------------- 7 files changed, 133 insertions(+), 94 deletions(-) create mode 100644 template/assets/calendar.png diff --git a/handler/template.go b/handler/template.go index ffd0503..9a620cf 100644 --- a/handler/template.go +++ b/handler/template.go @@ -7,6 +7,7 @@ import ( "net/url" "regexp" "strconv" + "time" ) func GetRandomColor() string { @@ -105,6 +106,10 @@ func ParsePixivRedirect(s string) template.HTML { return template.HTML(escaped) } +func ParseTime(date time.Time) string { + return date.Format("2006-01-02 15:04") +} + func GetTemplateFunctions() template.FuncMap { return template.FuncMap{ "toInt": func(s string) int { @@ -143,5 +148,8 @@ func GetTemplateFunctions() template.FuncMap { } return fmt.Sprintf("%s-%s-%s", s[4:], s[2:4], s[:2]) }, + "parseTime": func(date time.Time) string { + return ParseTime(date) + }, } } diff --git a/template/assets/calendar.png b/template/assets/calendar.png new file mode 100644 index 0000000000000000000000000000000000000000..0c8bc73f3e1bc84b488f5dfbce01d452c5846ed6 GIT binary patch literal 303 zcmeAS@N?(olHy`uVBq!ia0vp^1|ZDA1|-9oezpTC&H|6fVg?3oVGw3ym^DWNDEQFR z#WAE}&fA-gd`$)-Ef352OP1d|S`p-Y<5lgIr7EXb>zt3Y`cApv6kW29d5YijjhSat z(i&t77|$Ir+y1qxRKCjc>9#n1nVoCDM>96C1~Bn{G<9HI<7^f`IgVGvj`7yy^GENg zJ9KUQ`Q(|fg7z|o&Y4mkXa4PD?C#kpJtJj$yaq#-0?#jYnMU?iY&ySqRyCGq9WZe^ zyg;xhBBiA+o{?!Go6JJ>Rcubu8T!?_LJ5|x4bD9RHs a { + display: inline-flex; + align-items: center; + text-decoration: none; + color: #fff; +} +.illust .illust-other-works > a > img { aspect-ratio: 1/1; width: 50px; height: 50px; border-radius: 50%; margin-right: 5px; } -.illust .illust-other-works a { - display: inline-flex; - align-items: center; - text-decoration: none; - color: #fff; -} .background-cover { background: repeating-linear-gradient(52.5deg, rgba(32, 32, 32, 0.8), rgba(32, 32, 32, 0.8) 14px, rgba(240, 248, 255, 0) 14px, rgba(240, 248, 255, 0) 28px); diff --git a/template/css/style.scss b/template/css/style.scss index 5ba1ca5..5ebfdd4 100644 --- a/template/css/style.scss +++ b/template/css/style.scss @@ -302,6 +302,8 @@ nav { max-width: 1200px; margin-left: auto; margin-right: auto; + padding-left: 10px; + padding-right: 10px; } .artwork-container { @@ -515,13 +517,17 @@ line-height: 10px; } } + .illust-description { + font-size: 0.9em; + } + .illust-tags { font-size: 0.9em; .illust-tag-attr { display: inline-flex; align-items: center; - margin-right: 10px; + margin-right: 15px; img { aspect-ratio: 1/1; @@ -532,7 +538,7 @@ line-height: 10px; } .illust-tag { - margin-right: 5px; + margin-right: 10px; #highlight { color: $highlight; @@ -541,25 +547,28 @@ line-height: 10px; .illust-tag-name { color: $link; font-weight: bold; + margin-right: 5px; } } } .illust-other-works { - img { + & > a { + display: inline-flex; + align-items: center; + text-decoration: none; + color: $fg; + + & > img { aspect-ratio: 1/1; width: 50px; height: 50px; border-radius: 50%; margin-right: 5px; } - - a { - display: inline-flex; - align-items: center; - text-decoration: none; - color: $fg; } + + } } diff --git a/template/layout.jet.html b/template/layout.jet.html index f9aeccc..ef1d0da 100644 --- a/template/layout.jet.html +++ b/template/layout.jet.html @@ -98,8 +98,11 @@ - Icon - PixivFE + + + Icon + PixivFE + @@ -121,10 +124,12 @@ - Search + Search - Settings + + Settings + diff --git a/template/pages/artwork.jet.html b/template/pages/artwork.jet.html index fc98d0c..87efdcf 100644 --- a/template/pages/artwork.jet.html +++ b/template/pages/artwork.jet.html @@ -54,7 +54,10 @@ Likes {{ Illust.Likes }} - {{ Illust.Date }} + + Date + {{ parseTime: Illust.Date }} +
@@ -67,18 +70,22 @@ {{ .Name }} {{ else }} - + #{{ .Name }}{{ .TranslatedName }} {{ end }} {{ end }}
-
{{ raw: parsePixivRedirect(Illust.Description) }}
+
+
+ {{ raw: parsePixivRedirect(Illust.Description) }} +

{{ Illust.User.Name }} + Other works by {{ Illust.User.Name }}
{{ range Illust.RecentWorks }} diff --git a/template/pages/tag.jet.html b/template/pages/tag.jet.html index 05c98e5..cab01cb 100644 --- a/template/pages/tag.jet.html +++ b/template/pages/tag.jet.html @@ -1,75 +1,79 @@
-
- {{ if Tag.Metadata.ID }} - - {{ Tag.Name }} - - {{ end }} - -
- #{{ Tag.Name }} - {{ Tag.Metadata.Name }} -
-
- {{ Data.Artworks.Total }} works - -

{{ Tag.Metadata.Detail }}

-
-
- -
- {{ range Data.RelatedTags }} - #{{ . }} - {{ end }} -
- -
- {{ url := "/tags/" + Tag.Name + "?order=" + Queries.Order + "&mode=" + - Queries.Mode + "&page=1" + "&category=" }} - Type - All - Illustrations - Manga -
-
- {{ url := "/tags/" + Tag.Name + "?category=" + Queries.Category + "&mode=" + - Queries.Mode + "&page=1" + "&order=" }} - Order - Newest - Oldest -
-
- Filter - {{ url := "/tags/" + Tag.Name + "?category=" + Queries.Category + "&order=" - + Queries.Order + "&page=1" + "&mode=" }} - All - Safe - R-18 -
- {{ if Data.Popular.Recent }} -

Popular artworks

-
- {{ include "components/small-tn-normal" Data.Popular.Recent }} {{ include - "components/small-tn-normal" Data.Popular.Permanent }} -
+
+ {{ if Tag.Metadata.ID }} + + {{ Tag.Name }} + {{ end }} - -
-

Works

-
{{ include "components/small-tn" Data.Artworks.Artworks }}
- + +
+ {{ range Data.RelatedTags }} + #{{ . }} + {{ end }} +
+ +
+ {{ url := "/tags/" + Tag.Name + "?order=" + Queries.Order + "&mode=" + + Queries.Mode + "&page=1" + "&category=" }} +
Type
+ All + Illustrations + Manga +
+
+ {{ url := "/tags/" + Tag.Name + "?category=" + Queries.Category + "&mode=" + + Queries.Mode + "&page=1" + "&order=" }} +
Order
+ Newest + Oldest +
+
+
Filter
+ {{ url := "/tags/" + Tag.Name + "?category=" + Queries.Category + "&order=" + + Queries.Order + "&page=1" + "&mode=" }} + All + Safe + R-18 +
+ {{ if Data.Popular.Recent }} +

Popular artworks

+
+ {{ include "components/small-tn" Data.Popular.Recent }} {{ include + "components/small-tn" Data.Popular.Permanent }} +
+ {{ end }} + +
+

Works

+
{{ include "components/small-tn" Data.Artworks.Artworks }}
+ +