Skip to content

Commit

Permalink
bugfix: mobile tabs for demo page horizontally scroll now
Browse files Browse the repository at this point in the history
  • Loading branch information
skeptrunedev authored and cdxker committed Dec 16, 2024
1 parent 6d662fe commit 19f4e8e
Show file tree
Hide file tree
Showing 4 changed files with 27 additions and 5 deletions.
2 changes: 1 addition & 1 deletion server/src/public/navbar.html
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
<div class="flex-1"></div>
<div
id="nav-links"
class="flex flex-wrap items-center gap-4 justify-center sm:justify-right"
class="flex flex-wrap items-center gap-4 justify-center sm:justify-right -mt-2 sm:mt-0"
>
<a
class="flex items-center gap-1 text-black"
Expand Down
17 changes: 13 additions & 4 deletions server/src/public/page.html
Original file line number Diff line number Diff line change
Expand Up @@ -209,6 +209,13 @@
padding: 0rem;
}

#tab-buttons {
display: flex;
flex-wrap: nowrap;
overflow-x: auto;
gap: 0.25rem;
}

.tab-button {
background-color: #ffffff;
border-radius: 0.25rem 0.25rem 0rem 0rem;
Expand Down Expand Up @@ -280,10 +287,12 @@
<main>
<div class="basic">
<div id="root" class="min-h-[36px]"></div>
{% if params.singleProductOptions and params.singleProductOptions.productName %} {% include
"product.html" %} {% endif %} {% if tabs|length > 0 %} {% include
"tabs.html" %} {% else %} {% include "search-component-code.html" %} {%
endif %}
{% if params.singleProductOptions and
params.singleProductOptions.productName %} {% include "product.html" %}
{% else %}
<div class="mt-24 sm:mt-6"></div>
{% endif %} {% if tabs|length > 0 %} {% include "tabs.html" %} {% else
%} {% include "search-component-code.html" %} {% endif %}
</div>
</main>
{% if logged_in %}
Expand Down
1 change: 1 addition & 0 deletions server/src/public/tabs.html
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
tabButtons.forEach((tabButton, index) => {
if (index === tabIndex) {
tabButton.classList.add('active');
tabButton.scrollIntoView({ behavior: 'smooth', block: 'nearest' });
} else {
tabButton.classList.remove('active');
}
Expand Down
12 changes: 12 additions & 0 deletions server/static/output.css
Original file line number Diff line number Diff line change
Expand Up @@ -581,6 +581,10 @@ video {
margin-right: auto;
}

.-mt-2 {
margin-top: -0.5rem;
}

.mt-0\.5 {
margin-top: 0.125rem;
}
Expand Down Expand Up @@ -616,6 +620,10 @@ video {
-webkit-line-clamp: 1;
}

.block {
display: block;
}

.flex {
display: flex;
}
Expand Down Expand Up @@ -931,6 +939,10 @@ video {
margin-right: 1.5rem;
}

.sm\:mt-0 {
margin-top: 0px;
}

.sm\:mt-6 {
margin-top: 1.5rem;
}
Expand Down

0 comments on commit 19f4e8e

Please sign in to comment.