Prechádzať zdrojové kódy

feat(ui): add "back to top" link

Steven vanZyl 6 mesiacov pred
rodič
commit
4eff9129ab

+ 1 - 0
internal/locale/translations/de_DE.json

@@ -474,6 +474,7 @@
     "page.feeds.next_check": "Nächste Aktualisierung:",
     "page.feeds.read_counter": "Anzahl der gelesenen Artikel",
     "page.feeds.title": "Abonnements",
+    "page.footer.elevator": "Back to top",
     "page.history.title": "Verlauf",
     "page.import.title": "Importieren",
     "page.integration.bookmarklet": "Bookmarklet",

+ 1 - 0
internal/locale/translations/el_EL.json

@@ -474,6 +474,7 @@
     "page.feeds.next_check": "Επόμενος έλεγχος:",
     "page.feeds.read_counter": "Αριθμός αναγνωσμένων καταχωρήσεων",
     "page.feeds.title": "Ροές",
+    "page.footer.elevator": "Back to top",
     "page.history.title": "Ιστορικό",
     "page.import.title": "Εισαγωγή",
     "page.integration.bookmarklet": "Bookmarklet",

+ 1 - 0
internal/locale/translations/en_US.json

@@ -474,6 +474,7 @@
     "page.feeds.next_check": "Next check:",
     "page.feeds.read_counter": "Number of read entries",
     "page.feeds.title": "Feeds",
+    "page.footer.elevator": "Back to top",
     "page.history.title": "History",
     "page.import.title": "Import",
     "page.integration.bookmarklet": "Bookmarklet",

+ 1 - 0
internal/locale/translations/es_ES.json

@@ -474,6 +474,7 @@
     "page.feeds.next_check": "Próxima verificación:",
     "page.feeds.read_counter": "Número de artículos leídos",
     "page.feeds.title": "Fuentes",
+    "page.footer.elevator": "Back to top",
     "page.history.title": "Historial",
     "page.import.title": "Importar",
     "page.integration.bookmarklet": "Marcapáginas",

+ 1 - 0
internal/locale/translations/fi_FI.json

@@ -474,6 +474,7 @@
     "page.feeds.next_check": "Next check:",
     "page.feeds.read_counter": "Luettujen artikkeleiden määrä",
     "page.feeds.title": "Syötteet",
+    "page.footer.elevator": "Back to top",
     "page.history.title": "Historia",
     "page.import.title": "Tuo",
     "page.integration.bookmarklet": "Sovelluskirjanmerkki",

+ 1 - 0
internal/locale/translations/fr_FR.json

@@ -474,6 +474,7 @@
     "page.feeds.next_check": "Prochaine vérification :",
     "page.feeds.read_counter": "Nombre d'entrées lues",
     "page.feeds.title": "Abonnements",
+    "page.footer.elevator": "Back to top",
     "page.history.title": "Historique",
     "page.import.title": "Importation",
     "page.integration.bookmarklet": "Bookmarklet",

+ 1 - 0
internal/locale/translations/hi_IN.json

@@ -474,6 +474,7 @@
     "page.feeds.next_check": "Next check:",
     "page.feeds.read_counter": "पड़े हुए विषयवस्तुया",
     "page.feeds.title": "फ़ीड",
+    "page.footer.elevator": "Back to top",
     "page.history.title": "इतिहास",
     "page.import.title": "आयात",
     "page.integration.bookmarklet": "बुकमार्कलेट",

+ 1 - 0
internal/locale/translations/id_ID.json

@@ -468,6 +468,7 @@
     "page.feeds.next_check": "Akan diperiksa kembali:",
     "page.feeds.read_counter": "Jumlah entri yang telah dibaca",
     "page.feeds.title": "Umpan",
+    "page.footer.elevator": "Back to top",
     "page.history.title": "Riwayat",
     "page.import.title": "Impor",
     "page.integration.bookmarklet": "Bookmarklet",

+ 1 - 0
internal/locale/translations/it_IT.json

@@ -474,6 +474,7 @@
     "page.feeds.next_check": "Next check:",
     "page.feeds.read_counter": "Numero di voci lette",
     "page.feeds.title": "Feed",
+    "page.footer.elevator": "Back to top",
     "page.history.title": "Cronologia",
     "page.import.title": "Importa",
     "page.integration.bookmarklet": "Segnalibro",

+ 1 - 0
internal/locale/translations/ja_JP.json

@@ -468,6 +468,7 @@
     "page.feeds.next_check": "Next check:",
     "page.feeds.read_counter": "既読記事の数",
     "page.feeds.title": "フィード一覧",
+    "page.footer.elevator": "Back to top",
     "page.history.title": "履歴",
     "page.import.title": "インポート",
     "page.integration.bookmarklet": "ブックマークレット",

+ 1 - 0
internal/locale/translations/nan_Latn_pehoeji.json

@@ -468,6 +468,7 @@
     "page.feeds.next_check": "Āu-pái kiám-cha sî-kan:",
     "page.feeds.read_counter": "Tha̍k kè--ê siau-sit sò͘",
     "page.feeds.title": "Siau-sit lâi-goân",
+    "page.footer.elevator": "Back to top",
     "page.history.title": "Kì-lo̍k",
     "page.import.title": "Hōe-li̍p",
     "page.integration.bookmarklet": "Chheh-chhiam ke-si",

+ 1 - 0
internal/locale/translations/nl_NL.json

@@ -474,6 +474,7 @@
     "page.feeds.next_check": "Volgende controle:",
     "page.feeds.read_counter": "Aantal gelezen artikelen",
     "page.feeds.title": "Feeds",
+    "page.footer.elevator": "Back to top",
     "page.history.title": "Geschiedenis",
     "page.import.title": "Importeren",
     "page.integration.bookmarklet": "Bookmarklet",

+ 1 - 0
internal/locale/translations/pl_PL.json

@@ -480,6 +480,7 @@
     "page.feeds.next_check": "Następna aktualizacja:",
     "page.feeds.read_counter": "Liczba przeczytanych wpisów",
     "page.feeds.title": "Kanały",
+    "page.footer.elevator": "Back to top",
     "page.history.title": "Historia",
     "page.import.title": "Importuj",
     "page.integration.bookmarklet": "Skryptozakładka",

+ 1 - 0
internal/locale/translations/pt_BR.json

@@ -474,6 +474,7 @@
     "page.feeds.next_check": "Próxima verificação:",
     "page.feeds.read_counter": "Número de itens lidos",
     "page.feeds.title": "Fontes",
+    "page.footer.elevator": "Back to top",
     "page.history.title": "Histórico",
     "page.import.title": "Importar",
     "page.integration.bookmarklet": "Bookmarklet",

+ 1 - 0
internal/locale/translations/ro_RO.json

@@ -480,6 +480,7 @@
     "page.feeds.next_check": "Următoarea verificare:",
     "page.feeds.read_counter": "Numărul de intrări citite",
     "page.feeds.title": "Fluxuri",
+    "page.footer.elevator": "Back to top",
     "page.history.title": "Istoric",
     "page.import.title": "Import",
     "page.integration.bookmarklet": "Marcaje",

+ 1 - 0
internal/locale/translations/ru_RU.json

@@ -480,6 +480,7 @@
     "page.feeds.next_check": "Следующее обновление:",
     "page.feeds.read_counter": "Количество прочитанных статей",
     "page.feeds.title": "Подписки",
+    "page.footer.elevator": "Back to top",
     "page.history.title": "История",
     "page.import.title": "Импорт",
     "page.integration.bookmarklet": "Букмарклет",

+ 1 - 0
internal/locale/translations/tr_TR.json

@@ -474,6 +474,7 @@
     "page.feeds.next_check": "Sonraki kontrol:",
     "page.feeds.read_counter": "Okunmuş makalelerin sayısı",
     "page.feeds.title": "Beslemeler",
+    "page.footer.elevator": "Back to top",
     "page.history.title": "Geçmiş",
     "page.import.title": "İçeri Aktar",
     "page.integration.bookmarklet": "Bookmarklet",

+ 1 - 0
internal/locale/translations/uk_UA.json

@@ -480,6 +480,7 @@
     "page.feeds.next_check": "Наступна перевірка:",
     "page.feeds.read_counter": "Кількість прочитаних записів",
     "page.feeds.title": "Стрічки",
+    "page.footer.elevator": "Back to top",
     "page.history.title": "Історія",
     "page.import.title": "Імпорт",
     "page.integration.bookmarklet": "Букмарклет",

+ 1 - 0
internal/locale/translations/zh_CN.json

@@ -468,6 +468,7 @@
     "page.feeds.next_check": "下次检查:",
     "page.feeds.read_counter": "已读条目数",
     "page.feeds.title": "订阅源",
+    "page.footer.elevator": "Back to top",
     "page.history.title": "历史记录",
     "page.import.title": "导入",
     "page.integration.bookmarklet": "书签小应用",

+ 1 - 0
internal/locale/translations/zh_TW.json

@@ -468,6 +468,7 @@
     "page.feeds.next_check": "下次檢查時間:",
     "page.feeds.read_counter": "已讀文章數",
     "page.feeds.title": "Feeds",
+    "page.footer.elevator": "Back to top",
     "page.history.title": "歷史",
     "page.import.title": "匯入",
     "page.integration.bookmarklet": "書籤小工具",

+ 2 - 0
internal/template/templates/common/pagination.html

@@ -18,6 +18,8 @@
         </div>
     </div>
 
+    <a href="#" class="elevator">{{ icon "up" }}{{ t "page.footer.elevator" }}</a>
+
     <div class="pagination-forward">
         <div class="pagination-next {{ if not .ShowNext }}disabled{{end}}">
             {{ if .ShowNext }}

+ 4 - 0
internal/template/templates/views/categories.html

@@ -82,6 +82,10 @@
         </article>
         {{ end }}
     </div>
+
+    <footer>
+        <a href="#" class="elevator">{{ icon "up" }}{{ t "page.footer.elevator" }}</a>
+    </footer>
 {{ end }}
 
 {{ end }}

+ 2 - 0
internal/template/templates/views/entry.html

@@ -10,6 +10,8 @@
         {{ end }}
     </div>
 
+    <a href="#" class="elevator">{{ icon "up" }}{{ t "page.footer.elevator" }}</a>
+
     <div class="pagination-next {{ if not .nextEntry }}disabled{{end}}">
         {{ if .nextEntry }}
             <a href="{{ .nextEntryRoute }}{{ if .searchQuery }}?q={{ .searchQuery }}{{ end }}" title="{{ .nextEntry.Title }}" data-page="next" rel="next">{{ t "pagination.next" }}</a>

+ 5 - 0
internal/ui/static/bin/sprite.svg

@@ -197,4 +197,9 @@ Source: https://github.com/tabler/tabler-icons
         <path d="M10 10m-7 0a7 7 0 1 0 14 0a7 7 0 1 0 -14 0" />
         <path d="M21 21l-6 -6" />
     </symbol>
+    <symbol id="icon-up" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
+        <line x1="12" y1="4" x2="12" y2="20"/>
+        <line x1="12" y1="4" x2="20" y2="12"/>
+        <line x1="12" y1="4" x2="4" y2="12"/>
+    </symbol>
 </svg>

+ 15 - 0
internal/ui/static/css/common.css

@@ -1327,3 +1327,18 @@ audio, video {
 .hidden {
     display: none;
 }
+
+footer {
+    margin: 1em auto;
+}
+
+footer .elevator {
+    display: block;
+    width: fit-content;
+    margin: 0 auto;
+}
+
+.pagination-top .elevator,
+.pagination-entry-top .elevator {
+    display: none;
+}