From 7d38dfa673cd2983367e350c2fd94e2033120294 Mon Sep 17 00:00:00 2001 From: Danny van Kooten Date: Mon, 18 Nov 2024 15:16:42 +0100 Subject: [PATCH] replace column header for visitors and pageviews column with small icon on small screens. closes #270 --- assets/src/css/dashboard.css | 26 ++++++++++++++++++++++++++ src/views/dashboard-page.php | 8 ++++---- 2 files changed, 30 insertions(+), 4 deletions(-) diff --git a/assets/src/css/dashboard.css b/assets/src/css/dashboard.css index 9d0d95c..c233e26 100644 --- a/assets/src/css/dashboard.css +++ b/assets/src/css/dashboard.css @@ -274,6 +274,32 @@ h1.ka-logo, white-space: nowrap; } +/* on small screens, replace pageview & visitor column headers with an icon */ +@media (max-width: 820px) { + .ka-table th.ka-th-visitors, + .ka-table th.ka-th-pageviews { + font-size: 0; + width: 45px; + } + + .ka-th-visitors:before, + .ka-th-pageviews:before{ + content: ""; + display: inline-block; + width: 18px; + height: 16px; + vertical-align: middle; + background-size: contain; + background-repeat: no-repeat; + } + .ka-th-visitors:before { + background-image: url('data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCA0NDggNTEyIj48IS0tIUZvbnQgQXdlc29tZSBGcmVlIDYuNi4wIGJ5IEBmb250YXdlc29tZSAtIGh0dHBzOi8vZm9udGF3ZXNvbWUuY29tIExpY2Vuc2UgLSBodHRwczovL2ZvbnRhd2Vzb21lLmNvbS9saWNlbnNlL2ZyZWUgQ29weXJpZ2h0IDIwMjQgRm9udGljb25zLCBJbmMuLS0+PHBhdGggZmlsbD0iI2ZmZmZmZiIgZD0iTTIyNCAyNTZBMTI4IDEyOCAwIDEgMCAyMjQgMGExMjggMTI4IDAgMSAwIDAgMjU2em0tNDUuNyA0OEM3OS44IDMwNCAwIDM4My44IDAgNDgyLjNDMCA0OTguNyAxMy4zIDUxMiAyOS43IDUxMmwzODguNiAwYzE2LjQgMCAyOS43LTEzLjMgMjkuNy0yOS43QzQ0OCA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Yy0xMS4xLTQxLjUtNDcuOC02OS40LTg4LjYtNzEuMWMtNS44LS4yLTkuMiA2LjEtNy40IDExLjdjMi4xIDYuNCAzLjMgMTMuMiAzLjMgMjAuM3oiLz48L3N2Zz4='); + } +} + /* Pagination component */ .ka-pagination { display: flex; diff --git a/src/views/dashboard-page.php b/src/views/dashboard-page.php index 7425c54..2520cd8 100644 --- a/src/views/dashboard-page.php +++ b/src/views/dashboard-page.php @@ -172,8 +172,8 @@ # - - + + @@ -214,8 +214,8 @@ # - - + +