Skip to content

Commit

Permalink
replace column header for visitors and pageviews column with small ic…
Browse files Browse the repository at this point in the history
…on on small screens. closes #270
  • Loading branch information
dannyvankooten committed Nov 18, 2024
1 parent 0c488eb commit 7d38dfa
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 4 deletions.
26 changes: 26 additions & 0 deletions assets/src/css/dashboard.css
Original file line number Diff line number Diff line change
Expand Up @@ -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+PHBhdGggZmlsbD0iI2ZmZmZmZiIgZD0iTTIyNCAyNTZBMTI4IDEyOCAwIDEgMCAyMjQgMGExMjggMTI4IDAgMSAwIDAgMjU2em0tNDUuNyA0OEM3OS44IDMwNCAwIDM4My44IDAgNDgyLjNDMCA0OTguNyAxMy4zIDUxMiAyOS43IDUxMmwzODguNiAwYzE2LjQgMCAyOS43LTEzLjMgMjkuNy0yOS43QzQ0OCAzODMuOCAzNjguMiAzMDQgMjY5LjcgMzA0bC05MS40IDB6Ii8+PC9zdmc+');
}
.ka-th-pageviews:before {
background-image: url('data:image/svg+xml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MTMuMiAzLjMgMjAuM3oiLz48L3N2Zz4=');
}
}

/* Pagination component */
.ka-pagination {
display: flex;
Expand Down
8 changes: 4 additions & 4 deletions src/views/dashboard-page.php
Original file line number Diff line number Diff line change
Expand Up @@ -172,8 +172,8 @@
<tr>
<th>#</th>
<th><?php esc_html_e('Pages', 'koko-analytics'); ?></th>
<th title="<?php echo esc_attr__('A visitor represents the number of sessions during which a page was viewed one or more times.', 'koko-analytics'); ?>"><?php esc_html_e('Visitors', 'koko-analytics'); ?></th>
<th title="<?php echo esc_attr__('A pageview is defined as a view of a page on your site. If a user clicks reload after reaching the page, this is counted as an additional pageview. If a visitor navigates to a different page and then returns to the original page, a second pageview is recorded as well.', 'koko-analytics'); ?>"><?php esc_html_e('Pageviews', 'koko-analytics'); ?></th>
<th title="<?php echo esc_attr__('A visitor represents the number of sessions during which a page was viewed one or more times.', 'koko-analytics'); ?>" class="ka-th-visitors"><?php esc_html_e('Visitors', 'koko-analytics'); ?></th>
<th title="<?php echo esc_attr__('A pageview is defined as a view of a page on your site. If a user clicks reload after reaching the page, this is counted as an additional pageview. If a visitor navigates to a different page and then returns to the original page, a second pageview is recorded as well.', 'koko-analytics'); ?>" class="ka-th-pageviews"><?php esc_html_e('Pageviews', 'koko-analytics'); ?></th>
</tr>
</thead>
<tbody>
Expand Down Expand Up @@ -214,8 +214,8 @@
<tr>
<th>#</th>
<th><?php esc_html_e('Referrers', 'koko-analytics'); ?></th>
<th title="<?php echo esc_attr__('A visitor represents the number of sessions during which a page was viewed one or more times.', 'koko-analytics'); ?>"><?php esc_html_e('Visitors', 'koko-analytics'); ?></th>
<th title="<?php echo esc_attr__('A pageview is defined as a view of a page on your site. If a user clicks reload after reaching the page, this is counted as an additional pageview. If a visitor navigates to a different page and then returns to the original page, a second pageview is recorded as well.', 'koko-analytics'); ?>"><?php esc_html_e('Pageviews', 'koko-analytics'); ?></th>
<th title="<?php echo esc_attr__('A visitor represents the number of sessions during which a page was viewed one or more times.', 'koko-analytics'); ?>" class="ka-th-visitors"><?php esc_html_e('Visitors', 'koko-analytics'); ?></th>
<th title="<?php echo esc_attr__('A pageview is defined as a view of a page on your site. If a user clicks reload after reaching the page, this is counted as an additional pageview. If a visitor navigates to a different page and then returns to the original page, a second pageview is recorded as well.', 'koko-analytics'); ?>" class="ka-th-pageviews"><?php esc_html_e('Pageviews', 'koko-analytics'); ?></th>
</tr>
</thead>
<tbody>
Expand Down

0 comments on commit 7d38dfa

Please sign in to comment.