From a47f89cd0b8a509e2aca50d6e00a3f6a3dfa1051 Mon Sep 17 00:00:00 2001 From: kilo Date: Sat, 24 Jun 2017 01:05:21 +0200 Subject: [PATCH] Make flags overlap category icon (#1059) * Prettier flag position * flag overlap category icon * HTML changes * fix css that didn't apply properly & colspan not always being there * Update main.css * Update home.html * Update home.html * Update main.css * Update main.css --- public/css/flags/flags.css | 3 ++ public/css/main.css | 106 ++++++++++++++++++++++++++++++++++++- templates/home.html | 50 ++++++++--------- 3 files changed, 130 insertions(+), 29 deletions(-) diff --git a/public/css/flags/flags.css b/public/css/flags/flags.css index f7490cda..f902ffa0 100644 --- a/public/css/flags/flags.css +++ b/public/css/flags/flags.css @@ -7,6 +7,9 @@ width: 16px; height: 11px; background: url('flags.png') no-repeat; + position: relative; + left: -22px; + bottom: -22px; } diff --git a/public/css/main.css b/public/css/main.css index b2811bff..b261dcb4 100644 --- a/public/css/main.css +++ b/public/css/main.css @@ -260,8 +260,24 @@ th, .home-td { text-overflow: ellipsis; } -.tr-cat a { display: block; } -.tr-cat img { margin-top: 2px; } +.tr-cat div.nyaa-cat { + position: relative; + text-align: left; +} +.tr-cat a { + width: 100%; + height: 100%; + display: block; +} +.tr-cat img { + margin-top: 2px; +} +.tr-cat .nyaa-cat img { + position: absolute; + bottom: -2px; + display: block; + left: 11px; +} th { border-bottom-width: 2px; } @@ -538,6 +554,7 @@ input#show-filelist:checked ~ #filelist { .table-filelist { width: 100%; } +tr.torrentinfo { height: 38px; } .tr-filelist { --nest-level: 0; } @@ -911,3 +928,88 @@ details[open] summary:after { content: "-"; margin: -4px 5px 0 0; } + +.nyaa-cat { + background-repeat: no-repeat; + background-position: center center; + width:80px; + height: 28px; + display: block; +} + +.nyaa-cat-1 { + background: url("/img/torrents/1.png") +} +.nyaa-cat-2 { + background: url("/img/torrents/2.png") +} +.nyaa-cat-3 { + background: url("/img/torrents/3.png") +} +.nyaa-cat-4 { + background: url("/img/torrents/4.png") +} +.nyaa-cat-5 { + background: url("/img/torrents/5.png") +} +.nyaa-cat-6 { + background: url("/img/torrents/6.png") +} +.nyaa-cat-7 { + background: url("/img/torrents/7.png") +} +.nyaa-cat-8 { + background: url("/img/torrents/8.png") +} +.nyaa-cat-9 { + background: url("/img/torrents/9.png") +} +.nyaa-cat-10 { + background: url("/img/torrents/10.png") +} +.nyaa-cat-11 { + background: url("/img/torrents/11.png") +} +.nyaa-cat-12 { + background: url("/img/torrents/12.png") +} +.nyaa-cat-13 { + background: url("/img/torrents/13.png") +} +.nyaa-cat-14 { + background: url("/img/torrents/14.png") +} +.nyaa-cat-15 { + background: url("/img/torrents/15.png") +} +.nyaa-cat-16 { + background: url("/img/torrents/16.png") +} +.nyaa-cat-17 { + background: url("/img/torrents/17.png") +} +.nyaa-cat-18 { + background: url("/img/torrents/18.png") +} + +.sukebei-cat-11 { + background: url("/img/torrents/sukebei/11.png") +} +.sukebei-cat-12 { + background: url("/img/torrents/sukebei/12.png") +} +.sukebei-cat-13 { + background: url("/img/torrents/sukebei/13.png") +} +.sukebei-cat-14 { + background: url("/img/torrents/sukebei/14.png") +} +.sukebei-cat-15 { + background: url("/img/torrents/sukebei/15.png") +} +.sukebei-cat-21 { + background: url("/img/torrents/sukebei/21.png") +} +.sukebei-cat-22 { + background: url("/img/torrents/sukebei/22.png") +} diff --git a/templates/home.html b/templates/home.html index 85fe952b..044d5b1f 100644 --- a/templates/home.html +++ b/templates/home.html @@ -17,7 +17,6 @@ {{end}} {{call $.T "category"}} - {{call $.T "name"}}{{ genSortArrows .URL "1" }} @@ -38,7 +37,7 @@ {{call $.T "date"}}{{ genSortArrows .URL "2" }} - + {{ range .Models}} {{ end }} - - - {{ if Sukebei }} - {{ call $.T (CategoryName .Category .SubCategory) }} - {{ else }} - {{ call $.T (CategoryName .Category .SubCategory) }} - {{ end}} - - + + {{ if Sukebei }} +
+ {{ else}} + + {{.Name}} @@ -236,26 +234,24 @@ ""+ ""+ {{ end }} - ""+ - ""+ - {{ if Sukebei }} - ""+ - {{ else }} - ""+ - {{ end }} + ""+ + {{ if Sukebei }} + "
"+ + {{else}} + "
"+ + {{end}} + ""+ + ((torrent.language != "") ? "" : "") + ""+ - ""+ - (torrent.language != "" ? "" + - ""+ - "" : "")+ + "
"+ ""+Templates.EncodeEntities(torrent.name) +""+ ""+ ((torrent.comments.length > 0) ? "" + torrent.comments.length + "" : "")+ ""+ ""+ ""+ - "
"+ - "
"+(torrent.torrent != "" ? "
" : "") + + "
"+ + ""+(torrent.torrent != "" ? "
" : "") + ""+ ""+humanFileSize(torrent.filesize)+""+ ""+torrent.seeders+""+ @@ -267,4 +263,4 @@ Torrents.LastID = {{ lastID .URL .Models }}; if (Torrents.LastID > 0) Torrents.CanRefresh = true; -{{end}} \ No newline at end of file +{{end}}