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 0000000..0c8bc73 Binary files /dev/null and b/template/assets/calendar.png differ diff --git a/template/css/style.css b/template/css/style.css index 1f91e74..e2a79f4 100644 --- a/template/css/style.css +++ b/template/css/style.css @@ -245,6 +245,8 @@ nav .navigation-wrapper .sidebar .sidebar-list .sidebar-item img { max-width: 1200px; margin-left: auto; margin-right: auto; + padding-left: 10px; + padding-right: 10px; } .artwork-container { @@ -445,13 +447,16 @@ nav .navigation-wrapper .sidebar .sidebar-list .sidebar-item img { font-size: 0.8em; color: #aaa; } +.illust .illust-description { + font-size: 0.9em; +} .illust .illust-tags { font-size: 0.9em; } .illust .illust-tags .illust-tag-attr { display: inline-flex; align-items: center; - margin-right: 10px; + margin-right: 15px; } .illust .illust-tags .illust-tag-attr img { aspect-ratio: 1/1; @@ -460,7 +465,7 @@ nav .navigation-wrapper .sidebar .sidebar-list .sidebar-item img { margin-right: 5px; } .illust .illust-tags .illust-tag { - margin-right: 5px; + margin-right: 10px; } .illust .illust-tags .illust-tag #highlight { color: #fc365b; @@ -468,20 +473,21 @@ nav .navigation-wrapper .sidebar .sidebar-list .sidebar-item img { .illust .illust-tags .illust-tag .illust-tag-name { color: #118bee; font-weight: bold; + margin-right: 5px; } -.illust .illust-other-works img { +.illust .illust-other-works > 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 }}
+ +