Skip to content

Commit a644f59

Browse files
committed
Mobile language flags, menu styles & JS tweaks
Hide the desktop .language-flags on small screens and add a .language-flags-mobile block inside the menu with adjusted spacing and font sizes. Comment out the menu max-height to allow the menu to expand/scroll naturally. Rebuild/minified CSS (luxuryCar.css + map) updated and small supporting changes made in header.js and productPage.js to align behavior with the new mobile menu/language handling.
1 parent e557024 commit a644f59

File tree

6 files changed

+52
-20
lines changed

6 files changed

+52
-20
lines changed

assets/css/_header.scss

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -787,14 +787,7 @@ a.contact-link {
787787
}
788788
@media (max-width: 768px) {
789789
.language-flags {
790-
right: unset;
791-
left: 70px;
792-
top: -40px;
793-
width: 70px;
794-
font-size: 24px;
795-
a {
796-
margin-right: 8px;
797-
}
790+
display: none;
798791
}
799792
}
800793
@media (max-width: 468px) {

assets/css/_menu.scss

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,11 +60,21 @@ div#menu-widget {
6060
div#menu-widget {
6161
overflow: scroll;
6262

63-
max-height: 600px;
63+
// max-height: 600px;
6464
}
6565
div#menu-widget .menu {
6666
margin-right: 0px;
6767
text-align: left;
6868
width: 50%;
6969
}
70+
.language-flags-mobile {
71+
padding: 15px 30px;
72+
border-top: 1px solid #ddd;
73+
font-size: 28px;
74+
margin-top: 20px;
75+
a {
76+
margin-right: 12px;
77+
font-size: 30px;
78+
}
79+
}
7080
}

assets/css/luxuryCar.css

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

assets/css/luxuryCar.css.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

assets/js/components/header.js

Lines changed: 18 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -23,12 +23,24 @@ export function initHeader() {
2323
}
2424
});
2525
$('<a class="contact-link" href="/kontakty/">Kontakt</a>').prependTo(".navigation-buttons");
26-
$("<div>", { class: "language-flags" })
27-
.html(
28-
'<a href="https://www.luxurycardesign.sk/" class="flag-link" data-lang="sk" aria-label="Slovenská verzia">🇸🇰</a>' +
29-
'<a href="https://www.luxurycardesign.cz/" class="flag-link" data-lang="cs" aria-label="Česká verze">🇨🇿</a>',
30-
)
31-
.prependTo(".navigation-buttons");
26+
27+
// Language flags - add to desktop navigation, mobile menu will have them via CSS
28+
if (window.innerWidth > 768) {
29+
$("<div>", { class: "language-flags" })
30+
.html(
31+
'<a href="https://www.luxurycardesign.sk/" class="flag-link" data-lang="sk" aria-label="Slovenská verzia">🇸🇰</a>' +
32+
'<a href="https://www.luxurycardesign.cz/" class="flag-link" data-lang="cs" aria-label="Česká verze">🇨🇿</a>',
33+
)
34+
.prependTo(".navigation-buttons");
35+
} else {
36+
// Mobile: add flags to end of menu
37+
$("<div>", { class: "language-flags-mobile" })
38+
.html(
39+
'<a href="https://www.luxurycardesign.sk/" class="flag-link" data-lang="sk" aria-label="Slovenská verzia">🇸🇰</a>' +
40+
'<a href="https://www.luxurycardesign.cz/" class="flag-link" data-lang="cs" aria-label="Česká verze">🇨🇿</a>',
41+
)
42+
.appendTo("#menu-widget");
43+
}
3244
headerFixProdukt();
3345
}
3446

assets/js/components/productPage.js

Lines changed: 20 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -667,7 +667,7 @@ $(document).on("click", ".upsale-button", function (e) {
667667

668668
function resetBoxConfigDefaults() {
669669
// reset amount buttons to default (2 ks)
670-
const $amountButtons = $(".amount-button");
670+
const $amountButtons = $(".box-config .amount-button");
671671
if ($amountButtons.length) {
672672
$amountButtons.removeClass("active");
673673
$amountButtons
@@ -678,7 +678,7 @@ function resetBoxConfigDefaults() {
678678
}
679679

680680
// reset size selections and visibility (default: 2 sizes visible)
681-
$(".parameter-wrap.parameter-sizes").each(function (index) {
681+
$(".box-config .parameter-wrap.parameter-sizes").each(function (index) {
682682
const $wrap = $(this);
683683
const shouldShow = index < 2;
684684
if (shouldShow) {
@@ -692,7 +692,24 @@ function resetBoxConfigDefaults() {
692692

693693
const paramId = $wrap.attr("data-parameterId");
694694
if (paramId) {
695-
$("select.parameter-id-" + paramId + ".surcharge-parameter").val(0);
695+
$("select.parameter-id-" + paramId + ".surcharge-parameter").val("");
696+
}
697+
});
698+
699+
// reset all box-config parameters to default (empty value)
700+
$(".box-config .parameter-wrap").each(function () {
701+
const $wrap = $(this);
702+
703+
// reset all option buttons to inactive
704+
$wrap.find(".button.option-button").removeClass("active");
705+
706+
// reset all inputs
707+
$wrap.find("input[type='radio'], input[type='checkbox']").prop("checked", false);
708+
709+
// reset select to default empty value
710+
const paramId = $wrap.attr("data-parameterId");
711+
if (paramId) {
712+
$("select.parameter-id-" + paramId + ".surcharge-parameter").val("");
696713
}
697714
});
698715
}

0 commit comments

Comments
 (0)