diff --git a/handler/pixiv.go b/handler/pixiv.go index 4e810c4..a25319d 100644 --- a/handler/pixiv.go +++ b/handler/pixiv.go @@ -27,6 +27,8 @@ const ( ArtworkRelatedURL = "https://www.pixiv.net/ajax/illust/%s/recommend/init?limit=%d" ArtworkNewestURL = "https://www.pixiv.net/ajax/illust/new?limit=200&type=%s&r18=%s&lastId=%s" ArtworkRankingURL = "https://www.pixiv.net/ranking.php?format=json&mode=%s&content=%s&p=%s" + SearchMetadataURL = "https://www.pixiv.net/ajax/search/tags/%s" + SearchContentURL = "https://www.pixiv.net/ajax/search/artworks/%s?order=%s&mode=%s&p=%s&type=%s" UserInformationURL = "https://www.pixiv.net/ajax/user/%s?full=1" UserArtworksURL = "https://www.pixiv.net/ajax/user/%s/profile/all" UserArtworksFullURL = "https://www.pixiv.net/ajax/user/%s/profile/illusts?work_category=illustManga&is_first_page=0&lang=en%s" diff --git a/template/css/style.css b/template/css/style.css index bab58ad..77a4d20 100644 --- a/template/css/style.css +++ b/template/css/style.css @@ -292,6 +292,21 @@ body { border-radius: 50%; } +.tag-header { + display: flex; +} +.tag-header .tag-thumbnail { + width: 120px; + height: 120px; + border-radius: 5px; + margin-right: 20px; + object-fit: cover; + object-position: center center; +} +.tag-header .tag-details .main-tag { + font-size: 1.2rem; +} + .switcher { border-radius: 10px; } diff --git a/template/css/style.scss b/template/css/style.scss index a422ea8..7f854ef 100644 --- a/template/css/style.scss +++ b/template/css/style.scss @@ -342,6 +342,26 @@ body { } } +.tag-header { + display: flex; + + .tag-thumbnail { + width: 120px; + height: 120px; + border-radius: 5px; + margin-right: 20px; + + object-fit: cover; + object-position: center center; + } + + .tag-details { + .main-tag { + font-size: 1.2rem; + } + } +} + .switcher { border-radius: 10px; diff --git a/template/tag.html b/template/tag.html new file mode 100644 index 0000000..2e4ba5f --- /dev/null +++ b/template/tag.html @@ -0,0 +1,23 @@ +{{ template "header.html" }} + +
+
+ No image + +
+ #something + Translated +
+
+ 69420 works + +

something is an English word for something

+
+
+ +
+{{ template "footer.html" }} diff --git a/views/routes.go b/views/routes.go index 785e4be..69d7aca 100644 --- a/views/routes.go +++ b/views/routes.go @@ -109,6 +109,12 @@ func newestArtworksPage(c *gin.Context) { c.HTML(http.StatusOK, "list.html", gin.H{"Title": "Newest works from all users", "Items": works}) } +func tag_page(c *gin.Context) { + _ = c.Param("name") + + c.HTML(http.StatusOK, "tag.html", gin.H{}) +} + func NewPixivClient(timeout int) *models.PixivClient { transport := &http.Transport{Proxy: http.ProxyFromEnvironment} client := &http.Client{ @@ -135,4 +141,5 @@ func SetupRoutes(r *gin.Engine) { r.GET("users/:id", user_page) r.GET("newest", newestArtworksPage) r.GET("ranking", ranking_page) + r.GET("tags/:name", tag_page) }