mirror of
https://codeberg.org/VnPower/PixivFE
synced 2024-12-06 19:16:23 +01:00
More things
This commit is contained in:
@@ -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)
|
||||
},
|
||||
}
|
||||
}
|
||||
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 303 B |
+15
-9
@@ -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);
|
||||
|
||||
+18
-9
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -98,8 +98,11 @@
|
||||
</ul>
|
||||
</div>
|
||||
<span class="navbar-brand">
|
||||
<img src="https://pixivfe.exozy.me/favicon.ico" alt="Icon" />
|
||||
<span>PixivFE</span>
|
||||
<a href="/">
|
||||
|
||||
<img src="https://pixivfe.exozy.me/favicon.ico" alt="Icon" />
|
||||
<span>PixivFE</span>
|
||||
</a>
|
||||
</span>
|
||||
</span>
|
||||
|
||||
@@ -121,10 +124,12 @@
|
||||
</span>
|
||||
<span>
|
||||
<span class="navbar-entry" id="search-page-entry">
|
||||
<img src="assets/search.svg" alt="Search" />
|
||||
<img src="/assets/search.svg" alt="Search" />
|
||||
</span>
|
||||
<span class="navbar-entry">
|
||||
<img src="assets/cog.svg" alt="Settings" />
|
||||
<a href="/settings">
|
||||
<img src="/assets/cog.svg" alt="Settings" />
|
||||
</a>
|
||||
</span>
|
||||
</span>
|
||||
</div>
|
||||
|
||||
@@ -54,7 +54,10 @@
|
||||
<img src="/assets/like.png" alt="Likes" />
|
||||
{{ Illust.Likes }}
|
||||
</span>
|
||||
<small>{{ Illust.Date }}</small>
|
||||
<span class="illust-tag-attr">
|
||||
<img src="/assets/calendar.png" alt="Date" />
|
||||
{{ parseTime: Illust.Date }}
|
||||
</span>
|
||||
</div>
|
||||
|
||||
<div class="illust-tags">
|
||||
@@ -67,18 +70,22 @@
|
||||
<span class="illust-tag-name" id="highlight">{{ .Name }}</span>
|
||||
</span>
|
||||
{{ else }}
|
||||
<span class="illust-tags">
|
||||
<span class="illust-tag">
|
||||
<span class="illust-tag-name"
|
||||
><a href="/tags/{{ .Name }}">#{{ .Name }}</a></span
|
||||
><span class="illust-tag-translation">{{ .TranslatedName }}</span>
|
||||
</span>
|
||||
{{ end }} {{ end }}
|
||||
</div>
|
||||
<div>{{ raw: parsePixivRedirect(Illust.Description) }}</div>
|
||||
<br />
|
||||
<div class="illust-description">
|
||||
{{ raw: parsePixivRedirect(Illust.Description) }}
|
||||
</div>
|
||||
<br />
|
||||
<div class="illust-other-works">
|
||||
<a href="/users/{{ Illust.User.ID }}"
|
||||
><img src="{{ Illust.User.Avatar }}" alt="{{ Illust.User.Name }}" />
|
||||
Other works by {{ Illust.User.Name }}
|
||||
</a>
|
||||
<div class="artwork-container-scroll">
|
||||
{{ range Illust.RecentWorks }}
|
||||
|
||||
+73
-69
@@ -1,75 +1,79 @@
|
||||
<div class="container">
|
||||
<div class="tag-header">
|
||||
{{ if Tag.Metadata.ID }}
|
||||
<a href="/artworks/{{ Tag.Metadata.ID }}">
|
||||
<img class="tag-thumbnail" src="{{ Tag.Metadata.Image }}" alt="{{ Tag.Name }}" />
|
||||
</a>
|
||||
{{ end }}
|
||||
|
||||
<div class="tag-details">
|
||||
<b class="main-tag">#{{ Tag.Name }}</b>
|
||||
<span class="translated-tag">{{ Tag.Metadata.Name }}</span>
|
||||
<br />
|
||||
<br />
|
||||
<span><b>{{ Data.Artworks.Total }}</b> works</span>
|
||||
|
||||
<p class="tag-description">{{ Tag.Metadata.Detail }}</p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="thumbnail-container">
|
||||
{{ range Data.RelatedTags }}
|
||||
<a class="tag-container" href="/tags/{{ . }}">#{{ . }}</a>
|
||||
{{ end }}
|
||||
</div>
|
||||
|
||||
<div class="switcher">
|
||||
{{ url := "/tags/" + Tag.Name + "?order=" + Queries.Order + "&mode=" +
|
||||
Queries.Mode + "&page=1" + "&category=" }}
|
||||
<span class="switch-title">Type</span>
|
||||
<a href="{{url }}artworks" class="switch-button">All</a>
|
||||
<a href="{{url }}illustrations" class="switch-button">Illustrations</a>
|
||||
<a href="{{url }}manga" class="switch-button">Manga</a>
|
||||
</div>
|
||||
<div class="switcher">
|
||||
{{ url := "/tags/" + Tag.Name + "?category=" + Queries.Category + "&mode=" +
|
||||
Queries.Mode + "&page=1" + "&order=" }}
|
||||
<span class="switch-title">Order</span>
|
||||
<a href="{{url }}date_d" class="switch-button">Newest</a>
|
||||
<a href="{{url }}date" class="switch-button">Oldest</a>
|
||||
</div>
|
||||
<div class="switcher">
|
||||
<span class="switch-title">Filter</span>
|
||||
{{ url := "/tags/" + Tag.Name + "?category=" + Queries.Category + "&order="
|
||||
+ Queries.Order + "&page=1" + "&mode=" }}
|
||||
<a href="{{url }}all" class="switch-button">All</a>
|
||||
<a href="{{url }}safe" class="switch-button">Safe</a>
|
||||
<a href="{{url }}r18" class="switch-button">R-18</a>
|
||||
</div>
|
||||
{{ if Data.Popular.Recent }}
|
||||
<h2>Popular artworks</h2>
|
||||
<div class="thumbnail-container">
|
||||
{{ include "components/small-tn-normal" Data.Popular.Recent }} {{ include
|
||||
"components/small-tn-normal" Data.Popular.Permanent }}
|
||||
</div>
|
||||
<div class="tag-header">
|
||||
{{ if Tag.Metadata.ID }}
|
||||
<a href="/artworks/{{ Tag.Metadata.ID }}">
|
||||
<img
|
||||
class="tag-thumbnail"
|
||||
src="{{ Tag.Metadata.Image }}"
|
||||
alt="{{ Tag.Name }}"
|
||||
/>
|
||||
</a>
|
||||
{{ end }}
|
||||
<!-- Switchers here -->
|
||||
<br />
|
||||
<h2>Works</h2>
|
||||
<div>{{ include "components/small-tn" Data.Artworks.Artworks }}</div>
|
||||
|
||||
<div class="pagination">
|
||||
{{ url := "/tags/" + Tag.Name + "?category=" + Queries.Category + "&order="
|
||||
+ Queries.Order + "&mode=" + Queries.Mode + "&page=" }} {{ if Page == 1 }}
|
||||
<a href="#" class="pagination-button disabled">First</a>
|
||||
<a href="#" class="pagination-button disabled">Previous</a>
|
||||
{{ else }}
|
||||
<a href="{{url}}1" class="pagination-button">First</a>
|
||||
<a href="{{url}}{{ Page - 1 }}" class="pagination-button">Previous</a>
|
||||
{{ end }}
|
||||
<div class="tag-details">
|
||||
<b class="main-tag">#{{ Tag.Name }}</b>
|
||||
<span class="translated-tag">{{ Tag.Metadata.Name }}</span>
|
||||
<br />
|
||||
<br />
|
||||
<span><b>{{ Data.Artworks.Total }}</b> works</span>
|
||||
|
||||
<a href="#" class="pagination-button disabled">{{ Page }}</a>
|
||||
|
||||
<a href="{{url}}{{ Page + 1 }}" class="pagination-button">Next</a>
|
||||
<p class="tag-description">{{ Tag.Metadata.Detail }}</p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="artwork-container">
|
||||
{{ range Data.RelatedTags }}
|
||||
<a class="tag-container" href="/tags/{{ . }}">#{{ . }}</a>
|
||||
{{ end }}
|
||||
</div>
|
||||
|
||||
<div class="switcher">
|
||||
{{ url := "/tags/" + Tag.Name + "?order=" + Queries.Order + "&mode=" +
|
||||
Queries.Mode + "&page=1" + "&category=" }}
|
||||
<div class="switch-title">Type</div>
|
||||
<a href="{{url }}artworks" class="switch-button">All</a>
|
||||
<a href="{{url }}illustrations" class="switch-button">Illustrations</a>
|
||||
<a href="{{url }}manga" class="switch-button">Manga</a>
|
||||
</div>
|
||||
<div class="switcher">
|
||||
{{ url := "/tags/" + Tag.Name + "?category=" + Queries.Category + "&mode=" +
|
||||
Queries.Mode + "&page=1" + "&order=" }}
|
||||
<div class="switch-title">Order</div>
|
||||
<a href="{{url }}date_d" class="switch-button">Newest</a>
|
||||
<a href="{{url }}date" class="switch-button">Oldest</a>
|
||||
</div>
|
||||
<div class="switcher">
|
||||
<div class="switch-title">Filter</div>
|
||||
{{ url := "/tags/" + Tag.Name + "?category=" + Queries.Category + "&order="
|
||||
+ Queries.Order + "&page=1" + "&mode=" }}
|
||||
<a href="{{url }}all" class="switch-button">All</a>
|
||||
<a href="{{url }}safe" class="switch-button">Safe</a>
|
||||
<a href="{{url }}r18" class="switch-button">R-18</a>
|
||||
</div>
|
||||
{{ if Data.Popular.Recent }}
|
||||
<h2>Popular artworks</h2>
|
||||
<div class="artwork-container">
|
||||
{{ include "components/small-tn" Data.Popular.Recent }} {{ include
|
||||
"components/small-tn" Data.Popular.Permanent }}
|
||||
</div>
|
||||
{{ end }}
|
||||
<!-- Switchers here -->
|
||||
<br />
|
||||
<h2>Works</h2>
|
||||
<div>{{ include "components/small-tn" Data.Artworks.Artworks }}</div>
|
||||
|
||||
<div class="pagination">
|
||||
{{ url := "/tags/" + Tag.Name + "?category=" + Queries.Category + "&order="
|
||||
+ Queries.Order + "&mode=" + Queries.Mode + "&page=" }} {{ if Page == 1 }}
|
||||
<a href="#" class="pagination-button disabled">First</a>
|
||||
<a href="#" class="pagination-button disabled">Previous</a>
|
||||
{{ else }}
|
||||
<a href="{{url}}1" class="pagination-button">First</a>
|
||||
<a href="{{url}}{{ Page - 1 }}" class="pagination-button">Previous</a>
|
||||
{{ end }}
|
||||
|
||||
<a href="#" class="pagination-button disabled">{{ Page }}</a>
|
||||
|
||||
<a href="{{url}}{{ Page + 1 }}" class="pagination-button">Next</a>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user