From d2bb3d198c2274880c047f3d14b61a41468d7d59 Mon Sep 17 00:00:00 2001 From: Veloman Yunkan Date: Sat, 21 Oct 2023 20:33:11 +0400 Subject: [PATCH 1/7] Moved font definition from template to CSS --- static/skin/index.css | 10 ++++++++++ static/templates/index.html | 11 ----------- test/library_server.cpp | 2 +- test/server.cpp | 8 ++++---- 4 files changed, 15 insertions(+), 16 deletions(-) diff --git a/static/skin/index.css b/static/skin/index.css index 407fb7746..c7dbb78c9 100644 --- a/static/skin/index.css +++ b/static/skin/index.css @@ -517,3 +517,13 @@ body { grid-template-columns: 1fr; } } + +@font-face { + font-family: "poppins"; + src: url("../skin/fonts/Poppins.ttf?KIWIXCACHEID") format("truetype"); +} + +@font-face { + font-family: "roboto"; + src: url("../skin/fonts/Roboto.ttf?KIWIXCACHEID") format("truetype"); +} diff --git a/static/templates/index.html b/static/templates/index.html index ec887ab55..570d78ac5 100644 --- a/static/templates/index.html +++ b/static/templates/index.html @@ -26,17 +26,6 @@ - diff --git a/test/library_server.cpp b/test/library_server.cpp index c9c34e367..4b0019952 100644 --- a/test/library_server.cpp +++ b/test/library_server.cpp @@ -1028,7 +1028,7 @@ TEST_F(LibraryServerTest, no_name_mapper_catalog_v2_individual_entry_access) " Welcome to Kiwix Server\n" \ " \n" \ " \n" \ diff --git a/test/server.cpp b/test/server.cpp index cc42c4ae6..44c62801e 100644 --- a/test/server.cpp +++ b/test/server.cpp @@ -61,7 +61,7 @@ const ResourceCollection resources200Compressible{ { DYNAMIC_CONTENT, "/ROOT%23%3F/skin/i18n.js" }, { STATIC_CONTENT, "/ROOT%23%3F/skin/i18n.js?cacheid=6a8c6fb2" }, { DYNAMIC_CONTENT, "/ROOT%23%3F/skin/index.css" }, - { STATIC_CONTENT, "/ROOT%23%3F/skin/index.css?cacheid=e4d76d16" }, + { STATIC_CONTENT, "/ROOT%23%3F/skin/index.css?cacheid=2446b723" }, { DYNAMIC_CONTENT, "/ROOT%23%3F/skin/index.js" }, { STATIC_CONTENT, "/ROOT%23%3F/skin/index.js?cacheid=ce19da2a" }, { DYNAMIC_CONTENT, "/ROOT%23%3F/skin/iso6391To3.js" }, @@ -274,7 +274,7 @@ TEST_F(ServerTest, CacheIdsOfStaticResources) const std::vector testData{ { /* url */ "/ROOT%23%3F/", -R"EXPECTEDRESULT( href="/ROOT%23%3F/skin/index.css?cacheid=e4d76d16" +R"EXPECTEDRESULT( href="/ROOT%23%3F/skin/index.css?cacheid=2446b723" @@ -282,8 +282,6 @@ R"EXPECTEDRESULT( href="/ROOT%23%3F/skin/index.css?cacheid=e4d76d16" - src: url("/ROOT%23%3F/skin/fonts/Poppins.ttf?cacheid=af705837") format("truetype"); - src: url("/ROOT%23%3F/skin/fonts/Roboto.ttf?cacheid=84d10248") format("truetype"); @@ -296,6 +294,8 @@ R"EXPECTEDRESULT( href="/ROOT%23%3F/skin/index.css?cacheid=e4d76d16" { /* url */ "/ROOT%23%3F/skin/index.css", R"EXPECTEDRESULT( background-image: url('../skin/search-icon.svg?cacheid=b10ae7ed'); + src: url("../skin/fonts/Poppins.ttf?cacheid=af705837") format("truetype"); + src: url("../skin/fonts/Roboto.ttf?cacheid=84d10248") format("truetype"); )EXPECTEDRESULT" }, { From af27141320ef5d2d32b06a130a44e592a2d35552 Mon Sep 17 00:00:00 2001 From: Veloman Yunkan Date: Sat, 21 Oct 2023 21:06:30 +0400 Subject: [PATCH 2/7] Enter kiwix.css The new file kiwix.css is intended to host the intersection of index.css and taskbar.css. In this commit only font definitions have been moved into it. --- static/resources_list.txt | 1 + static/skin/index.css | 10 ---------- static/skin/kiwix.css | 9 +++++++++ static/skin/taskbar.css | 10 ---------- static/templates/index.html | 5 +++++ static/templates/no_js_library_page.html | 7 ++++++- static/viewer.html | 1 + test/library_server.cpp | 9 +++++++-- test/server.cpp | 20 ++++++++++++++------ 9 files changed, 43 insertions(+), 29 deletions(-) create mode 100644 static/skin/kiwix.css diff --git a/static/resources_list.txt b/static/resources_list.txt index 71ebe6760..e339a31a4 100644 --- a/static/resources_list.txt +++ b/static/resources_list.txt @@ -10,6 +10,7 @@ skin/iso6391To3.js skin/isotope.pkgd.min.js skin/index.js skin/autoComplete.min.js +skin/kiwix.css skin/taskbar.css skin/index.css skin/fonts/Poppins.ttf diff --git a/static/skin/index.css b/static/skin/index.css index c7dbb78c9..407fb7746 100644 --- a/static/skin/index.css +++ b/static/skin/index.css @@ -517,13 +517,3 @@ body { grid-template-columns: 1fr; } } - -@font-face { - font-family: "poppins"; - src: url("../skin/fonts/Poppins.ttf?KIWIXCACHEID") format("truetype"); -} - -@font-face { - font-family: "roboto"; - src: url("../skin/fonts/Roboto.ttf?KIWIXCACHEID") format("truetype"); -} diff --git a/static/skin/kiwix.css b/static/skin/kiwix.css new file mode 100644 index 000000000..da460c076 --- /dev/null +++ b/static/skin/kiwix.css @@ -0,0 +1,9 @@ +@font-face { + font-family: "poppins"; + src: url("../skin/fonts/Poppins.ttf?KIWIXCACHEID") format("truetype"); +} + +@font-face { + font-family: "roboto"; + src: url("../skin/fonts/Roboto.ttf?KIWIXCACHEID") format("truetype"); +} diff --git a/static/skin/taskbar.css b/static/skin/taskbar.css index 865c8c6f9..022387dea 100644 --- a/static/skin/taskbar.css +++ b/static/skin/taskbar.css @@ -256,13 +256,3 @@ a.suggest, a.suggest:visited, a.suggest:hover, a.suggest:active { width: 80%; } } - -@font-face { - font-family: "poppins"; - src: url("../skin/fonts/Poppins.ttf?KIWIXCACHEID") format("truetype"); -} - -@font-face { - font-family: "roboto"; - src: url("../skin/fonts/Roboto.ttf?KIWIXCACHEID") format("truetype"); -} diff --git a/static/templates/index.html b/static/templates/index.html index 570d78ac5..46be2d7f9 100644 --- a/static/templates/index.html +++ b/static/templates/index.html @@ -5,6 +5,11 @@ Welcome to Kiwix Server + {{translations.welcome-to-kiwix-server}} + {{translations.count-of-matching-books}}
{{{translations.powered-by-kiwix-html}}}
- \ No newline at end of file + diff --git a/static/viewer.html b/static/viewer.html index 392e26243..49899723a 100644 --- a/static/viewer.html +++ b/static/viewer.html @@ -8,6 +8,7 @@ object-src 'none';"> ZIM Viewer + diff --git a/test/library_server.cpp b/test/library_server.cpp index 4b0019952..8c16fe67d 100644 --- a/test/library_server.cpp +++ b/test/library_server.cpp @@ -1028,7 +1028,12 @@ TEST_F(LibraryServerTest, no_name_mapper_catalog_v2_individual_entry_access) " Welcome to Kiwix Server\n" \ " \n" \ + " \n" \ " \n" \ @@ -1145,7 +1150,7 @@ TEST_F(LibraryServerTest, no_name_mapper_catalog_v2_individual_entry_access) " \n" \ "
Powered by Kiwix
\n" \ " \n" \ - "" + "\n" #define FILTERS_HTML(SELECTED_ENG) \ "
\n" \ diff --git a/test/server.cpp b/test/server.cpp index 44c62801e..efb6e3924 100644 --- a/test/server.cpp +++ b/test/server.cpp @@ -61,7 +61,7 @@ const ResourceCollection resources200Compressible{ { DYNAMIC_CONTENT, "/ROOT%23%3F/skin/i18n.js" }, { STATIC_CONTENT, "/ROOT%23%3F/skin/i18n.js?cacheid=6a8c6fb2" }, { DYNAMIC_CONTENT, "/ROOT%23%3F/skin/index.css" }, - { STATIC_CONTENT, "/ROOT%23%3F/skin/index.css?cacheid=2446b723" }, + { STATIC_CONTENT, "/ROOT%23%3F/skin/index.css?cacheid=e4d76d16" }, { DYNAMIC_CONTENT, "/ROOT%23%3F/skin/index.js" }, { STATIC_CONTENT, "/ROOT%23%3F/skin/index.js?cacheid=ce19da2a" }, { DYNAMIC_CONTENT, "/ROOT%23%3F/skin/iso6391To3.js" }, @@ -71,7 +71,7 @@ const ResourceCollection resources200Compressible{ { DYNAMIC_CONTENT, "/ROOT%23%3F/skin/mustache.min.js" }, { STATIC_CONTENT, "/ROOT%23%3F/skin/mustache.min.js?cacheid=bd23c4fb" }, { DYNAMIC_CONTENT, "/ROOT%23%3F/skin/taskbar.css" }, - { STATIC_CONTENT, "/ROOT%23%3F/skin/taskbar.css?cacheid=5ab04b5a" }, + { STATIC_CONTENT, "/ROOT%23%3F/skin/taskbar.css?cacheid=74156c3a" }, { DYNAMIC_CONTENT, "/ROOT%23%3F/skin/viewer.js" }, { STATIC_CONTENT, "/ROOT%23%3F/skin/viewer.js?cacheid=201653b8" }, { DYNAMIC_CONTENT, "/ROOT%23%3F/skin/fonts/Poppins.ttf" }, @@ -140,6 +140,8 @@ const ResourceCollection resources200Uncompressible{ { STATIC_CONTENT, "/ROOT%23%3F/skin/favicon/site.webmanifest?cacheid=bc396efb" }, { DYNAMIC_CONTENT, "/ROOT%23%3F/skin/hash.png" }, { STATIC_CONTENT, "/ROOT%23%3F/skin/hash.png?cacheid=f836e872" }, + { DYNAMIC_CONTENT, "/ROOT%23%3F/skin/kiwix.css" }, + { STATIC_CONTENT, "/ROOT%23%3F/skin/kiwix.css?cacheid=27f092fb" }, { DYNAMIC_CONTENT, "/ROOT%23%3F/skin/magnet.png" }, { STATIC_CONTENT, "/ROOT%23%3F/skin/magnet.png?cacheid=73b6bddf" }, { DYNAMIC_CONTENT, "/ROOT%23%3F/skin/search-icon.svg" }, @@ -274,7 +276,8 @@ TEST_F(ServerTest, CacheIdsOfStaticResources) const std::vector testData{ { /* url */ "/ROOT%23%3F/", -R"EXPECTEDRESULT( href="/ROOT%23%3F/skin/index.css?cacheid=2446b723" +R"EXPECTEDRESULT( href="/ROOT%23%3F/skin/kiwix.css?cacheid=27f092fb" + href="/ROOT%23%3F/skin/index.css?cacheid=e4d76d16" @@ -289,13 +292,17 @@ R"EXPECTEDRESULT( href="/ROOT%23%3F/skin/index.css?cacheid=2446b723" +R"EXPECTEDRESULT( + From a65681d6f426886f1f84729135864fdf61d2e054 Mon Sep 17 00:00:00 2001 From: Veloman Yunkan Date: Sat, 21 Oct 2023 21:20:57 +0400 Subject: [PATCH 3/7] Shared styling of modal dialogs goes into kiwix.css --- static/skin/index.css | 52 ----------------------------------------- static/skin/kiwix.css | 52 +++++++++++++++++++++++++++++++++++++++++ static/skin/taskbar.css | 52 ----------------------------------------- test/library_server.cpp | 4 ++-- test/server.cpp | 14 +++++------ 5 files changed, 61 insertions(+), 113 deletions(-) diff --git a/static/skin/index.css b/static/skin/index.css index 407fb7746..9978ded3e 100644 --- a/static/skin/index.css +++ b/static/skin/index.css @@ -325,58 +325,6 @@ body { -webkit-box-orient: vertical; } -.modal-wrapper { - position: fixed; - z-index: 100; - top: 0; - left: 0; - width: 100vw; - height: 100vh; - display: flex; - justify-content: center; - align-items: center; - align-content: center; - background-color: rgba(0, 0, 0, 30%); -} - -.modal { - color: #444343; - height: 280px; - width: 250px; - margin: 15px; - background-color: #f7f7f7; - border: 1px solid #ececec; - border-radius: 3px; -} - -.modal-heading { - background-color: #f0f0f0; - height: 20%; - width: 100%; - border-bottom: 1px solid #ececec; - display: grid; - grid-template-columns: 3fr 1fr; -} - -.modal-title { - display: flex; - font-size: 15px; - align-items: center; - padding-left: 20px; - font-family: poppins; -} - -.modal-close-button { - cursor: pointer; - display: flex; - justify-content: center; - align-items: center; -} - -.modal-content { - padding: 20px; -} - .modal-content div { width: 100%; height: 40px; diff --git a/static/skin/kiwix.css b/static/skin/kiwix.css index da460c076..9f5c05745 100644 --- a/static/skin/kiwix.css +++ b/static/skin/kiwix.css @@ -1,3 +1,55 @@ +.modal-wrapper { + position: fixed; + z-index: 100; + top: 0; + left: 0; + width: 100vw; + height: 100vh; + display: flex; + justify-content: center; + align-items: center; + align-content: center; + background-color: rgba(0, 0, 0, 30%); +} + +.modal { + color: #444343; + height: 280px; + width: 250px; + margin: 15px; + background-color: #f7f7f7; + border: 1px solid #ececec; + border-radius: 3px; +} + +.modal-heading { + background-color: #f0f0f0; + height: 20%; + width: 100%; + border-bottom: 1px solid #ececec; + display: grid; + grid-template-columns: 3fr 1fr; +} + +.modal-title { + display: flex; + font-size: 15px; + align-items: center; + padding-left: 20px; + font-family: poppins; +} + +.modal-close-button { + cursor: pointer; + display: flex; + justify-content: center; + align-items: center; +} + +.modal-content { + padding: 20px; +} + @font-face { font-family: "poppins"; src: url("../skin/fonts/Poppins.ttf?KIWIXCACHEID") format("truetype"); diff --git a/static/skin/taskbar.css b/static/skin/taskbar.css index 022387dea..f73b77304 100644 --- a/static/skin/taskbar.css +++ b/static/skin/taskbar.css @@ -129,58 +129,6 @@ a.suggest, a.suggest:visited, a.suggest:hover, a.suggest:active { column-count: 1 !important; } -.modal-wrapper { - position: fixed; - z-index: 100; - top: 0; - left: 0; - width: 100vw; - height: 100vh; - display: flex; - justify-content: center; - align-items: center; - align-content: center; - background-color: rgba(0, 0, 0, 30%); -} - -.modal { - color: #444343; - height: 280px; - width: 250px; - margin: 15px; - background-color: #f7f7f7; - border: 1px solid #ececec; - border-radius: 3px; -} - -.modal-heading { - background-color: #f0f0f0; - height: 20%; - width: 100%; - border-bottom: 1px solid #ececec; - display: grid; - grid-template-columns: 3fr 1fr; -} - -.modal-title { - display: flex; - font-size: 15px; - align-items: center; - padding-left: 20px; - font-family: poppins; -} - -.modal-close-button { - cursor: pointer; - display: flex; - justify-content: center; - align-items: center; -} - -.modal-content { - padding: 20px; -} - #uiLanguageSelector { display: none; } diff --git a/test/library_server.cpp b/test/library_server.cpp index 8c16fe67d..8497b4433 100644 --- a/test/library_server.cpp +++ b/test/library_server.cpp @@ -1028,12 +1028,12 @@ TEST_F(LibraryServerTest, no_name_mapper_catalog_v2_individual_entry_access) " Welcome to Kiwix Server\n" \ " \n" \ " \n" \ " \n" \ diff --git a/test/server.cpp b/test/server.cpp index efb6e3924..5bb4dee3d 100644 --- a/test/server.cpp +++ b/test/server.cpp @@ -61,7 +61,7 @@ const ResourceCollection resources200Compressible{ { DYNAMIC_CONTENT, "/ROOT%23%3F/skin/i18n.js" }, { STATIC_CONTENT, "/ROOT%23%3F/skin/i18n.js?cacheid=6a8c6fb2" }, { DYNAMIC_CONTENT, "/ROOT%23%3F/skin/index.css" }, - { STATIC_CONTENT, "/ROOT%23%3F/skin/index.css?cacheid=e4d76d16" }, + { STATIC_CONTENT, "/ROOT%23%3F/skin/index.css?cacheid=624104e6" }, { DYNAMIC_CONTENT, "/ROOT%23%3F/skin/index.js" }, { STATIC_CONTENT, "/ROOT%23%3F/skin/index.js?cacheid=ce19da2a" }, { DYNAMIC_CONTENT, "/ROOT%23%3F/skin/iso6391To3.js" }, @@ -71,7 +71,7 @@ const ResourceCollection resources200Compressible{ { DYNAMIC_CONTENT, "/ROOT%23%3F/skin/mustache.min.js" }, { STATIC_CONTENT, "/ROOT%23%3F/skin/mustache.min.js?cacheid=bd23c4fb" }, { DYNAMIC_CONTENT, "/ROOT%23%3F/skin/taskbar.css" }, - { STATIC_CONTENT, "/ROOT%23%3F/skin/taskbar.css?cacheid=74156c3a" }, + { STATIC_CONTENT, "/ROOT%23%3F/skin/taskbar.css?cacheid=786a623c" }, { DYNAMIC_CONTENT, "/ROOT%23%3F/skin/viewer.js" }, { STATIC_CONTENT, "/ROOT%23%3F/skin/viewer.js?cacheid=201653b8" }, { DYNAMIC_CONTENT, "/ROOT%23%3F/skin/fonts/Poppins.ttf" }, @@ -141,7 +141,7 @@ const ResourceCollection resources200Uncompressible{ { DYNAMIC_CONTENT, "/ROOT%23%3F/skin/hash.png" }, { STATIC_CONTENT, "/ROOT%23%3F/skin/hash.png?cacheid=f836e872" }, { DYNAMIC_CONTENT, "/ROOT%23%3F/skin/kiwix.css" }, - { STATIC_CONTENT, "/ROOT%23%3F/skin/kiwix.css?cacheid=27f092fb" }, + { STATIC_CONTENT, "/ROOT%23%3F/skin/kiwix.css?cacheid=28889647" }, { DYNAMIC_CONTENT, "/ROOT%23%3F/skin/magnet.png" }, { STATIC_CONTENT, "/ROOT%23%3F/skin/magnet.png?cacheid=73b6bddf" }, { DYNAMIC_CONTENT, "/ROOT%23%3F/skin/search-icon.svg" }, @@ -276,8 +276,8 @@ TEST_F(ServerTest, CacheIdsOfStaticResources) const std::vector testData{ { /* url */ "/ROOT%23%3F/", -R"EXPECTEDRESULT( href="/ROOT%23%3F/skin/kiwix.css?cacheid=27f092fb" - href="/ROOT%23%3F/skin/index.css?cacheid=e4d76d16" +R"EXPECTEDRESULT( href="/ROOT%23%3F/skin/kiwix.css?cacheid=28889647" + href="/ROOT%23%3F/skin/index.css?cacheid=624104e6" @@ -315,8 +315,8 @@ R"EXPECTEDRESULT( - +R"EXPECTEDRESULT( + From 0c0b1f5971426452a56a9d4b5121a7b13c5de8f1 Mon Sep 17 00:00:00 2001 From: Veloman Yunkan Date: Sat, 28 Oct 2023 19:43:22 +0400 Subject: [PATCH 4/7] Moved to kiwix.css some CSS with global effect Moved from index.css into kiwix.css some CSS with global effect thus making it apply to the viewer too. Extra font-size directives in taskbar.css are needed to undo the effect of 'font-size: 62.5%' now applied to the 'html' element type. --- static/skin/index.css | 22 ---------------------- static/skin/kiwix.css | 22 ++++++++++++++++++++++ static/skin/taskbar.css | 4 +++- test/library_server.cpp | 4 ++-- test/server.cpp | 14 +++++++------- 5 files changed, 34 insertions(+), 32 deletions(-) diff --git a/static/skin/index.css b/static/skin/index.css index 9978ded3e..0595360c4 100644 --- a/static/skin/index.css +++ b/static/skin/index.css @@ -1,25 +1,3 @@ -*, -*::after, -*::before { - margin: 0; - padding: 0; - box-sizing: inherit; -} - -html { - font-size: 62.5%; -} - -body { - position: relative; - box-sizing: border-box; -} - -::selection { - background-color: #00b4e4; - color: white; -} - .kiwixNav { background-color: #f4f6f8; width: 100%; diff --git a/static/skin/kiwix.css b/static/skin/kiwix.css index 9f5c05745..d46cff845 100644 --- a/static/skin/kiwix.css +++ b/static/skin/kiwix.css @@ -1,3 +1,25 @@ +*, +*::after, +*::before { + margin: 0; + padding: 0; + box-sizing: inherit; +} + +html { + font-size: 62.5%; +} + +body { + position: relative; + box-sizing: border-box; +} + +::selection { + background-color: #00b4e4; + color: white; +} + .modal-wrapper { position: fixed; z-index: 100; diff --git a/static/skin/taskbar.css b/static/skin/taskbar.css index f73b77304..fd4d1442d 100644 --- a/static/skin/taskbar.css +++ b/static/skin/taskbar.css @@ -21,6 +21,7 @@ } .kiwixsearch { + font-size: 1.6rem; position: relative; height: 26px; width: 100%; @@ -119,6 +120,7 @@ label[for=kiwixsearchbox] { } a.suggest, a.suggest:visited, a.suggest:hover, a.suggest:active { + font-size: 1.6rem; display: block; text-decoration: none; color: inherit; @@ -142,7 +144,7 @@ a.suggest, a.suggest:visited, a.suggest:hover, a.suggest:active { } #uiLanguageSelector .modal-content #ui_language { - font-size: 1rem; + font-size: 1.6rem; width: 100%; } diff --git a/test/library_server.cpp b/test/library_server.cpp index 8497b4433..04465684d 100644 --- a/test/library_server.cpp +++ b/test/library_server.cpp @@ -1028,12 +1028,12 @@ TEST_F(LibraryServerTest, no_name_mapper_catalog_v2_individual_entry_access) " Welcome to Kiwix Server\n" \ " \n" \ " \n" \ " \n" \ diff --git a/test/server.cpp b/test/server.cpp index 5bb4dee3d..914f60c9d 100644 --- a/test/server.cpp +++ b/test/server.cpp @@ -61,7 +61,7 @@ const ResourceCollection resources200Compressible{ { DYNAMIC_CONTENT, "/ROOT%23%3F/skin/i18n.js" }, { STATIC_CONTENT, "/ROOT%23%3F/skin/i18n.js?cacheid=6a8c6fb2" }, { DYNAMIC_CONTENT, "/ROOT%23%3F/skin/index.css" }, - { STATIC_CONTENT, "/ROOT%23%3F/skin/index.css?cacheid=624104e6" }, + { STATIC_CONTENT, "/ROOT%23%3F/skin/index.css?cacheid=081e1606" }, { DYNAMIC_CONTENT, "/ROOT%23%3F/skin/index.js" }, { STATIC_CONTENT, "/ROOT%23%3F/skin/index.js?cacheid=ce19da2a" }, { DYNAMIC_CONTENT, "/ROOT%23%3F/skin/iso6391To3.js" }, @@ -71,7 +71,7 @@ const ResourceCollection resources200Compressible{ { DYNAMIC_CONTENT, "/ROOT%23%3F/skin/mustache.min.js" }, { STATIC_CONTENT, "/ROOT%23%3F/skin/mustache.min.js?cacheid=bd23c4fb" }, { DYNAMIC_CONTENT, "/ROOT%23%3F/skin/taskbar.css" }, - { STATIC_CONTENT, "/ROOT%23%3F/skin/taskbar.css?cacheid=786a623c" }, + { STATIC_CONTENT, "/ROOT%23%3F/skin/taskbar.css?cacheid=04cb5531" }, { DYNAMIC_CONTENT, "/ROOT%23%3F/skin/viewer.js" }, { STATIC_CONTENT, "/ROOT%23%3F/skin/viewer.js?cacheid=201653b8" }, { DYNAMIC_CONTENT, "/ROOT%23%3F/skin/fonts/Poppins.ttf" }, @@ -141,7 +141,7 @@ const ResourceCollection resources200Uncompressible{ { DYNAMIC_CONTENT, "/ROOT%23%3F/skin/hash.png" }, { STATIC_CONTENT, "/ROOT%23%3F/skin/hash.png?cacheid=f836e872" }, { DYNAMIC_CONTENT, "/ROOT%23%3F/skin/kiwix.css" }, - { STATIC_CONTENT, "/ROOT%23%3F/skin/kiwix.css?cacheid=28889647" }, + { STATIC_CONTENT, "/ROOT%23%3F/skin/kiwix.css?cacheid=bdae4d22" }, { DYNAMIC_CONTENT, "/ROOT%23%3F/skin/magnet.png" }, { STATIC_CONTENT, "/ROOT%23%3F/skin/magnet.png?cacheid=73b6bddf" }, { DYNAMIC_CONTENT, "/ROOT%23%3F/skin/search-icon.svg" }, @@ -276,8 +276,8 @@ TEST_F(ServerTest, CacheIdsOfStaticResources) const std::vector testData{ { /* url */ "/ROOT%23%3F/", -R"EXPECTEDRESULT( href="/ROOT%23%3F/skin/kiwix.css?cacheid=28889647" - href="/ROOT%23%3F/skin/index.css?cacheid=624104e6" +R"EXPECTEDRESULT( href="/ROOT%23%3F/skin/kiwix.css?cacheid=bdae4d22" + href="/ROOT%23%3F/skin/index.css?cacheid=081e1606" @@ -315,8 +315,8 @@ R"EXPECTEDRESULT( - +R"EXPECTEDRESULT( + From 0c05af658d451f2032bb5452957874fcd30b4490 Mon Sep 17 00:00:00 2001 From: Veloman Yunkan Date: Sat, 28 Oct 2023 20:00:56 +0400 Subject: [PATCH 5/7] Deduplicated styling of UI language selector There was a slight difference (between index.css and taskbar.css) in the margin values of the UI language selector button, however the values taken from taskbar.css don't seem to have any visible impact on the welcome/library page (controlled by index.css). --- static/skin/index.css | 25 +------------------------ static/skin/kiwix.css | 24 ++++++++++++++++++++++++ static/skin/taskbar.css | 24 ------------------------ test/library_server.cpp | 4 ++-- test/server.cpp | 16 ++++++++-------- 5 files changed, 35 insertions(+), 58 deletions(-) diff --git a/static/skin/index.css b/static/skin/index.css index 0595360c4..6e6e973b2 100644 --- a/static/skin/index.css +++ b/static/skin/index.css @@ -140,29 +140,6 @@ font-weight: bolder; } -#uiLanguageSelector { - display: none; -} - -#uiLanguageSelector .modal { - height: 140px; -} - -#uiLanguageSelector .modal-heading { - height: 40%; -} - -#uiLanguageSelector .modal-content #ui_language { - font-size: 1.6rem; - width: 100%; -} - -#uiLanguageSelectorButton { - margin: 0 12px 0 0; - float: right; - cursor: pointer; -} - .book__list { position: relative; margin: 0 auto; @@ -395,7 +372,7 @@ width: auto; } -.feedLogo, #uiLanguageSelectorButton { +.feedLogo { height: 30px; float: right; } diff --git a/static/skin/kiwix.css b/static/skin/kiwix.css index d46cff845..32b2a8d6e 100644 --- a/static/skin/kiwix.css +++ b/static/skin/kiwix.css @@ -72,6 +72,30 @@ body { padding: 20px; } +#uiLanguageSelector { + display: none; +} + +#uiLanguageSelector .modal { + height: 140px; +} + +#uiLanguageSelector .modal-heading { + height: 40%; +} + +#uiLanguageSelector .modal-content #ui_language { + font-size: 1.6rem; + width: 100%; +} + +#uiLanguageSelectorButton { + margin: 0px 12px 6px 12px; + float: right; + cursor: pointer; + height: 30px; +} + @font-face { font-family: "poppins"; src: url("../skin/fonts/Poppins.ttf?KIWIXCACHEID") format("truetype"); diff --git a/static/skin/taskbar.css b/static/skin/taskbar.css index fd4d1442d..8159ea9f1 100644 --- a/static/skin/taskbar.css +++ b/static/skin/taskbar.css @@ -131,30 +131,6 @@ a.suggest, a.suggest:visited, a.suggest:hover, a.suggest:active { column-count: 1 !important; } -#uiLanguageSelector { - display: none; -} - -#uiLanguageSelector .modal { - height: 140px; -} - -#uiLanguageSelector .modal-heading { - height: 40%; -} - -#uiLanguageSelector .modal-content #ui_language { - font-size: 1.6rem; - width: 100%; -} - -#uiLanguageSelectorButton { - margin: 0px 12px 6px 12px; - float: right; - cursor: pointer; - height: 30px; -} - @media(min-width:420px) { .kiwix_button_cont { display: inline-block !important; diff --git a/test/library_server.cpp b/test/library_server.cpp index 04465684d..057e2590c 100644 --- a/test/library_server.cpp +++ b/test/library_server.cpp @@ -1028,12 +1028,12 @@ TEST_F(LibraryServerTest, no_name_mapper_catalog_v2_individual_entry_access) " Welcome to Kiwix Server\n" \ " \n" \ " \n" \ " \n" \ diff --git a/test/server.cpp b/test/server.cpp index 914f60c9d..38bdc48af 100644 --- a/test/server.cpp +++ b/test/server.cpp @@ -61,17 +61,19 @@ const ResourceCollection resources200Compressible{ { DYNAMIC_CONTENT, "/ROOT%23%3F/skin/i18n.js" }, { STATIC_CONTENT, "/ROOT%23%3F/skin/i18n.js?cacheid=6a8c6fb2" }, { DYNAMIC_CONTENT, "/ROOT%23%3F/skin/index.css" }, - { STATIC_CONTENT, "/ROOT%23%3F/skin/index.css?cacheid=081e1606" }, + { STATIC_CONTENT, "/ROOT%23%3F/skin/index.css?cacheid=4196ad7d" }, { DYNAMIC_CONTENT, "/ROOT%23%3F/skin/index.js" }, { STATIC_CONTENT, "/ROOT%23%3F/skin/index.js?cacheid=ce19da2a" }, { DYNAMIC_CONTENT, "/ROOT%23%3F/skin/iso6391To3.js" }, { STATIC_CONTENT, "/ROOT%23%3F/skin/iso6391To3.js?cacheid=ecde2bb3" }, { DYNAMIC_CONTENT, "/ROOT%23%3F/skin/isotope.pkgd.min.js" }, { STATIC_CONTENT, "/ROOT%23%3F/skin/isotope.pkgd.min.js?cacheid=2e48d392" }, + { DYNAMIC_CONTENT, "/ROOT%23%3F/skin/kiwix.css" }, + { STATIC_CONTENT, "/ROOT%23%3F/skin/kiwix.css?cacheid=9b1b089f" }, { DYNAMIC_CONTENT, "/ROOT%23%3F/skin/mustache.min.js" }, { STATIC_CONTENT, "/ROOT%23%3F/skin/mustache.min.js?cacheid=bd23c4fb" }, { DYNAMIC_CONTENT, "/ROOT%23%3F/skin/taskbar.css" }, - { STATIC_CONTENT, "/ROOT%23%3F/skin/taskbar.css?cacheid=04cb5531" }, + { STATIC_CONTENT, "/ROOT%23%3F/skin/taskbar.css?cacheid=8c05f7fc" }, { DYNAMIC_CONTENT, "/ROOT%23%3F/skin/viewer.js" }, { STATIC_CONTENT, "/ROOT%23%3F/skin/viewer.js?cacheid=201653b8" }, { DYNAMIC_CONTENT, "/ROOT%23%3F/skin/fonts/Poppins.ttf" }, @@ -140,8 +142,6 @@ const ResourceCollection resources200Uncompressible{ { STATIC_CONTENT, "/ROOT%23%3F/skin/favicon/site.webmanifest?cacheid=bc396efb" }, { DYNAMIC_CONTENT, "/ROOT%23%3F/skin/hash.png" }, { STATIC_CONTENT, "/ROOT%23%3F/skin/hash.png?cacheid=f836e872" }, - { DYNAMIC_CONTENT, "/ROOT%23%3F/skin/kiwix.css" }, - { STATIC_CONTENT, "/ROOT%23%3F/skin/kiwix.css?cacheid=bdae4d22" }, { DYNAMIC_CONTENT, "/ROOT%23%3F/skin/magnet.png" }, { STATIC_CONTENT, "/ROOT%23%3F/skin/magnet.png?cacheid=73b6bddf" }, { DYNAMIC_CONTENT, "/ROOT%23%3F/skin/search-icon.svg" }, @@ -276,8 +276,8 @@ TEST_F(ServerTest, CacheIdsOfStaticResources) const std::vector testData{ { /* url */ "/ROOT%23%3F/", -R"EXPECTEDRESULT( href="/ROOT%23%3F/skin/kiwix.css?cacheid=bdae4d22" - href="/ROOT%23%3F/skin/index.css?cacheid=081e1606" +R"EXPECTEDRESULT( href="/ROOT%23%3F/skin/kiwix.css?cacheid=9b1b089f" + href="/ROOT%23%3F/skin/index.css?cacheid=4196ad7d" @@ -315,8 +315,8 @@ R"EXPECTEDRESULT( - +R"EXPECTEDRESULT( + From fd504c1166e476095864c3fdc2ff28e84a6565d2 Mon Sep 17 00:00:00 2001 From: Veloman Yunkan Date: Sat, 28 Oct 2023 21:03:36 +0400 Subject: [PATCH 6/7] Matched viewer toolbar color to that of the library page Attempts to use the same color for buttons yielded poor results: viewer toolbar buttons don't look nice on the dark background used for the filter controls on the library page, whereas the light background of the viewer toolbar buttons doesn't play well with the filters on the library page which seem to be designed around the contrast effect. --- static/skin/taskbar.css | 6 +++--- test/server.cpp | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/static/skin/taskbar.css b/static/skin/taskbar.css index 8159ea9f1..81e8f6160 100644 --- a/static/skin/taskbar.css +++ b/static/skin/taskbar.css @@ -3,7 +3,7 @@ transition: 0.3s; width: 100%; box-sizing: border-box; - background: #e3e3e3; + background: #f4f6f8; border-bottom: 1px solid #aaa; } @@ -88,7 +88,7 @@ label[for="kiwix_button_show_toggle"], line-height: 20px !important; margin-right: 5px !important; padding: 2px 6px !important; - border: 1px solid #999 !important; + border: 1px solid #b5b2b2 !important; border-radius: 3px !important; background-color: #ededed !important; font-weight: normal !important; @@ -102,7 +102,7 @@ label[for="kiwix_button_show_toggle"], width: 100%; height: 26px !important; line-height: 20px !important; - border: 1px solid #999 !important; + border: 1px solid #b5b2b2 !important; border-radius: 3px !important; background-color: #fff !important; padding: 2px 2px 2px 27px !important; diff --git a/test/server.cpp b/test/server.cpp index 38bdc48af..703f1d5d0 100644 --- a/test/server.cpp +++ b/test/server.cpp @@ -73,7 +73,7 @@ const ResourceCollection resources200Compressible{ { DYNAMIC_CONTENT, "/ROOT%23%3F/skin/mustache.min.js" }, { STATIC_CONTENT, "/ROOT%23%3F/skin/mustache.min.js?cacheid=bd23c4fb" }, { DYNAMIC_CONTENT, "/ROOT%23%3F/skin/taskbar.css" }, - { STATIC_CONTENT, "/ROOT%23%3F/skin/taskbar.css?cacheid=8c05f7fc" }, + { STATIC_CONTENT, "/ROOT%23%3F/skin/taskbar.css?cacheid=a1200d6b" }, { DYNAMIC_CONTENT, "/ROOT%23%3F/skin/viewer.js" }, { STATIC_CONTENT, "/ROOT%23%3F/skin/viewer.js?cacheid=201653b8" }, { DYNAMIC_CONTENT, "/ROOT%23%3F/skin/fonts/Poppins.ttf" }, @@ -316,7 +316,7 @@ R"EXPECTEDRESULT( - + From 29c33a7ad62b25cc9bc07849bbe3abfd97c72d5a Mon Sep 17 00:00:00 2001 From: Veloman Yunkan Date: Sat, 28 Oct 2023 21:17:08 +0400 Subject: [PATCH 7/7] More economic use of vertical space on the library page --- static/skin/index.css | 12 ++++++------ test/library_server.cpp | 2 +- test/server.cpp | 4 ++-- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/static/skin/index.css b/static/skin/index.css index 6e6e973b2..bfe6dc1f3 100644 --- a/static/skin/index.css +++ b/static/skin/index.css @@ -1,7 +1,7 @@ .kiwixNav { background-color: #f4f6f8; width: 100%; - padding: 20px; + padding: 10px 20px; position: sticky; top: 0; z-index: 3; @@ -37,10 +37,10 @@ background-image: none; border-radius: 1px; width: 195px; - height: 35px; + height: 30px; flex: 1; color: black; - padding: 7px 10px 10px; + padding: 0px 10px 0px 10px; cursor: pointer; } @@ -52,7 +52,7 @@ position: relative; display: flex; width: 231px; - height: 35px; + height: 30px; line-height: 3; background: #909090; overflow: hidden; @@ -82,7 +82,7 @@ } .kiwixSearch { - height: 35px; + height: 30px; width: 231px; border-radius: 10px; border: solid 1px #b5b2b2; @@ -96,7 +96,7 @@ .kiwixButton { margin: 0 17px; - height: 35px; + height: 30px; width: 100px; border-radius: 10px; color: white; diff --git a/test/library_server.cpp b/test/library_server.cpp index 057e2590c..0a52ef0b1 100644 --- a/test/library_server.cpp +++ b/test/library_server.cpp @@ -1033,7 +1033,7 @@ TEST_F(LibraryServerTest, no_name_mapper_catalog_v2_individual_entry_access) " />\n" \ " \n" \ " \n" \ diff --git a/test/server.cpp b/test/server.cpp index 703f1d5d0..93d6bf71e 100644 --- a/test/server.cpp +++ b/test/server.cpp @@ -61,7 +61,7 @@ const ResourceCollection resources200Compressible{ { DYNAMIC_CONTENT, "/ROOT%23%3F/skin/i18n.js" }, { STATIC_CONTENT, "/ROOT%23%3F/skin/i18n.js?cacheid=6a8c6fb2" }, { DYNAMIC_CONTENT, "/ROOT%23%3F/skin/index.css" }, - { STATIC_CONTENT, "/ROOT%23%3F/skin/index.css?cacheid=4196ad7d" }, + { STATIC_CONTENT, "/ROOT%23%3F/skin/index.css?cacheid=1e78e7cf" }, { DYNAMIC_CONTENT, "/ROOT%23%3F/skin/index.js" }, { STATIC_CONTENT, "/ROOT%23%3F/skin/index.js?cacheid=ce19da2a" }, { DYNAMIC_CONTENT, "/ROOT%23%3F/skin/iso6391To3.js" }, @@ -277,7 +277,7 @@ TEST_F(ServerTest, CacheIdsOfStaticResources) { /* url */ "/ROOT%23%3F/", R"EXPECTEDRESULT( href="/ROOT%23%3F/skin/kiwix.css?cacheid=9b1b089f" - href="/ROOT%23%3F/skin/index.css?cacheid=4196ad7d" + href="/ROOT%23%3F/skin/index.css?cacheid=1e78e7cf"