Skip to content

Commit 7e9a3e3

Browse files
Updated margin for flex and added proper click for dropdown
1 parent 3736ea0 commit 7e9a3e3

16 files changed

+547
-553
lines changed

src/components/LangSelect.svelte

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,8 @@
2424
function toggle(e) {
2525
e.stopPropagation();
2626
let menu = this.nextSibling;
27+
// let menu = document.getElementById('langMenu')
28+
document.getElementById('shopMenu').style.display = "none";
2729
2830
while (menu && menu.nodeType != 1) {
2931
menu = menu.nextSibling;
@@ -79,7 +81,7 @@
7981
<polyline points="6 9 12 15 18 9" />
8082
</svg>
8183
</button>
82-
<ul class="menuItems p-0">
84+
<ul id="langMenu" class="menuItems p-0">
8385
{#each languageList as lang}
8486
<li>
8587
<a class="px-4 py-3 {lang.name === languageName ? 'selectedLang' : ''}" href={lang.link}>{lang.name}</a>

src/components/Nav.svelte

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
let visible = true;
1414
let bellCount = "0";
1515
16-
let starsCount = 219;
16+
let starsCount = 222;
1717
1818
// const dispatch = createEventDispatcher();
1919

src/components/ShopSelect.svelte

Lines changed: 12 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,22 @@
11
<script>
2-
import { langStore } from "../routes/stores.js";
32
import lang from "../routes/_lang.js";
43
let strings = lang.strings;
54
let toClose = false;
65
7-
let language = $langStore || "en";
8-
let languageList = [
9-
{ id: "en", name: "Accessories", link: "pattern-accessories" },
10-
{ id: "de", name: "Home & Living", link: "pattern-home-living" },
11-
{ id: "fr", name: "Phone Cases", link: "pattern-phone-cases" },
12-
{ id: "it", name: "Stationery & Office", link: "pattern-stationery-office" },
13-
{ id: "es", name: "Stickers & Skins", link: "pattern-stickers-skins" },
14-
{ id: "pl", name: "Wall Art", link: "pattern-wall-art" },
6+
let shopList = [
7+
{ name: "Accessories", link: "pattern-accessories" },
8+
{ name: "Home & Living", link: "pattern-home-living" },
9+
{ name: "Phone Cases", link: "pattern-phone-cases" },
10+
{ name: "Stationery & Office", link: "pattern-stationery-office" },
11+
{ name: "Stickers & Skins", link: "pattern-stickers-skins" },
12+
{ name: "Wall Art", link: "pattern-wall-art" },
1513
];
1614
17-
const languageName = languageList.find(({ id }) => id === language).name;
18-
1915
function toggle(e) {
2016
e.stopPropagation();
2117
let menu = this.nextSibling;
18+
// let menu = document.getElementById('shopMenu')
19+
document.getElementById('langMenu').style.display = "none";
2220
2321
while (menu && menu.nodeType != 1) {
2422
menu = menu.nextSibling;
@@ -77,12 +75,9 @@
7775
<polyline points="6 9 12 15 18 9" />
7876
</svg>
7977
</button>
80-
<ul class="menuItems p-0">
81-
{#each languageList as lang}
82-
<li>
83-
<!-- <a class="px-4 py-3 {lang.name === languageName ? 'selectedLang' : ''}" href={lang.link}>{lang.name}</a> -->
84-
<a class="px-4 py-3" href={lang.link}>{lang.name}</a>
85-
</li>
78+
<ul id="shopMenu" class="menuItems p-0">
79+
{#each shopList as shop}
80+
<li><a class="px-4 py-3" href={shop.link}>{shop.name}</a></li>
8681
{/each}
8782
</ul>
8883
</div>
@@ -130,14 +125,9 @@
130125
background-clip: padding-box;
131126
border-radius: var(--border-radius);
132127
box-shadow: 0 10px 15px -3px rgb(0 0 0 / 10%), 0 4px 6px -2px rgb(0 0 0 / 5%);
133-
/* --tw-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
134-
--tw-ring-offset-shadow: 0 0 #0000;
135-
box-shadow: var(--tw-ring-offset-shadow, 0 0 #0000), var(--tw-ring-shadow, 0 0 #0000), var(--tw-shadow); */
136-
/* padding: 0; */
137128
}
138129
.menuItems a {
139130
text-decoration: none;
140-
/* padding: 0; */
141131
}
142132
.menuItems li a {
143133
color: var(--gray-300);

src/css/global.css

Lines changed: 14 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -392,6 +392,9 @@ button:active {
392392
.gap-2 {
393393
gap: 0.5rem;
394394
}
395+
.gap-4 {
396+
gap: 1rem;
397+
}
395398
.gap-6 {
396399
gap: 1.5rem;
397400
}
@@ -416,7 +419,7 @@ button:active {
416419
.uppercase {
417420
text-transform: uppercase;
418421
}
419-
.tracking-wider{
422+
.tracking-wider {
420423
letter-spacing: 0.05em;
421424
}
422425
.container {
@@ -884,9 +887,9 @@ button.bellIcon:active {
884887
}
885888

886889
.alert {
887-
background: var(--shop-gradient);
888-
background-size: 400% 400%;
889-
animation: gradient 15s ease infinite;
890+
background: var(--shop-gradient);
891+
background-size: 400% 400%;
892+
animation: gradient 15s ease infinite;
890893
margin: 0 auto;
891894
place-content: center;
892895
display: flex;
@@ -911,6 +914,7 @@ button.bellIcon:active {
911914
border: 0.125em solid var(--gray-text);
912915
color: var(--gray-text);
913916
padding: 0.375rem 0.75rem;
917+
margin: 0.3em;
914918
}
915919
.shop-button:hover {
916920
border: 0.125em solid var(--secondary-text-color);
@@ -923,11 +927,15 @@ button.bellIcon:active {
923927
background-color: var(--pattern-bg);
924928
border-radius: var(--border-radius);
925929
}
930+
931+
.innerShop span {
932+
color: var(--accent-text);
933+
}
926934
.shop-buttons {
927935
display: flex;
928936
flex-wrap: wrap;
929-
gap: 0.6em;
930-
margin-top: 16px;
937+
margin: -0.3em;
938+
padding: 0.6em 0 0.3em;
931939
}
932940

933941
/* Scrollbar */

src/routes/index.svelte

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -373,7 +373,7 @@
373373
<div class="container flex mx-auto pb-20 pt-2">
374374
<div class="alert">
375375
<div class="innerShop">
376-
<span class="text-sm uppercase font-semibold tracking-wider">Shop Product Range</span>
376+
<span class="text-sm uppercase font-semibold tracking-wider">Shop Product Range</span>
377377
<div class="shop-buttons">
378378
<a class="shop-button" href="pattern-accessories">{strings["accessories"]}</a>
379379
<a class="shop-button" href="pattern-home-living">{strings["home-living"]}</a>
@@ -382,7 +382,7 @@
382382
<a class="shop-button" href="pattern-stickers-skins">{strings["stickers-skins"]}</a>
383383
<a class="shop-button" href="pattern-wall-art">{strings["wall-art"]}</a>
384384
</div></div></div></div>
385-
385+
386386
<h1>{@html strings.heading}</h1>
387387
<div class="stats">
388388
{#each stats as stat}

src/routes/pattern-accessories.svelte

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,6 @@
2828
2929
let { title, url, keywords, desc, image, versions } = Constants.pageDetails(page);
3030
data.sort((a, b) => strings[a.item_id].localeCompare(strings[b.item_id]));
31-
// data.sort((a, b) => a.creation_date.localeCompare(b.creation_date));
3231
3332
let selection = data[0].category_id;
3433
@@ -43,8 +42,7 @@
4342
};
4443
});
4544
const uniqCategories = [...new Map(categories.map((item) => [item["category_id"], item])).values()];
46-
// uniqCategories.sort((a, b) => strings[a.item_id].localeCompare(strings[b.item_id]));
47-
45+
4846
$: selectedUnique = uniqCategories.filter((category) => category.category_id === selection);
4947
</script>
5048

@@ -143,12 +141,12 @@
143141
.radio-toolbar {
144142
box-sizing: border-box;
145143
width: 100%;
146-
/* max-width: 1536px; */
144+
margin: -0.5rem;
147145
margin-left: auto;
148146
margin-right: auto;
149147
display: grid;
150148
grid-template-columns: repeat(2, minmax(0px, 1fr));
151-
gap: 1rem;
149+
/* gap: 1rem; */
152150
padding: 1rem;
153151
}
154152
img,
@@ -222,6 +220,7 @@
222220
gap: 0.25em;
223221
grid-auto-flow: column;
224222
padding: 0.35rem 0.6rem;
223+
margin: 0.5rem;
225224
place-items: center;
226225
font-size: 1rem;
227226
background-color: var(--gray-bg);

src/routes/pattern-home-living.svelte

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,6 @@
2828
2929
let { title, url, keywords, desc, image, versions } = Constants.pageDetails(page);
3030
data.sort((a, b) => strings[a.item_id].localeCompare(strings[b.item_id]));
31-
// data.sort((a, b) => a.creation_date.localeCompare(b.creation_date));
3231
3332
let selection = data[0].category_id;
3433
@@ -43,7 +42,6 @@
4342
};
4443
});
4544
const uniqCategories = [...new Map(categories.map((item) => [item["category_id"], item])).values()];
46-
// uniqCategories.sort((a, b) => strings[a.item_id].localeCompare(strings[b.item_id]));
4745
4846
$: selectedUnique = uniqCategories.filter((category) => category.category_id === selection);
4947
</script>
@@ -143,12 +141,12 @@
143141
.radio-toolbar {
144142
box-sizing: border-box;
145143
width: 100%;
146-
/* max-width: 1536px; */
144+
margin: -0.5rem;
147145
margin-left: auto;
148146
margin-right: auto;
149147
display: grid;
150148
grid-template-columns: repeat(2, minmax(0px, 1fr));
151-
gap: 1rem;
149+
/* gap: 1rem; */
152150
padding: 1rem;
153151
}
154152
img,
@@ -222,6 +220,7 @@
222220
gap: 0.25em;
223221
grid-auto-flow: column;
224222
padding: 0.35rem 0.6rem;
223+
margin: 0.5rem;
225224
place-items: center;
226225
font-size: 1rem;
227226
background-color: var(--gray-bg);

src/routes/pattern-phone-cases.svelte

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,6 @@
2828
2929
let { title, url, keywords, desc, image, versions } = Constants.pageDetails(page);
3030
data.sort((a, b) => strings[a.item_id].localeCompare(strings[b.item_id]));
31-
// data.sort((a, b) => a.creation_date.localeCompare(b.creation_date));
3231
3332
let selection = data[0].category_id;
3433
@@ -43,7 +42,6 @@
4342
};
4443
});
4544
const uniqCategories = [...new Map(categories.map((item) => [item["category_id"], item])).values()];
46-
// uniqCategories.sort((a, b) => strings[a.item_id].localeCompare(strings[b.item_id]));
4745
4846
$: selectedUnique = uniqCategories.filter((category) => category.category_id === selection);
4947
</script>
@@ -143,12 +141,12 @@
143141
.radio-toolbar {
144142
box-sizing: border-box;
145143
width: 100%;
146-
/* max-width: 1536px; */
144+
margin: -0.5rem;
147145
margin-left: auto;
148146
margin-right: auto;
149147
display: grid;
150148
grid-template-columns: repeat(2, minmax(0px, 1fr));
151-
gap: 1rem;
149+
/* gap: 1rem; */
152150
padding: 1rem;
153151
}
154152
img,
@@ -222,6 +220,7 @@
222220
gap: 0.25em;
223221
grid-auto-flow: column;
224222
padding: 0.35rem 0.6rem;
223+
margin: 0.5rem;
225224
place-items: center;
226225
font-size: 1rem;
227226
background-color: var(--gray-bg);

src/routes/pattern-stationery-office.svelte

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,6 @@
2828
2929
let { title, url, keywords, desc, image, versions } = Constants.pageDetails(page);
3030
data.sort((a, b) => strings[a.item_id].localeCompare(strings[b.item_id]));
31-
// data.sort((a, b) => a.creation_date.localeCompare(b.creation_date));
3231
3332
let selection = data[0].category_id;
3433
@@ -43,7 +42,6 @@
4342
};
4443
});
4544
const uniqCategories = [...new Map(categories.map((item) => [item["category_id"], item])).values()];
46-
// uniqCategories.sort((a, b) => strings[a.item_id].localeCompare(strings[b.item_id]));
4745
4846
$: selectedUnique = uniqCategories.filter((category) => category.category_id === selection);
4947
</script>
@@ -143,12 +141,12 @@
143141
.radio-toolbar {
144142
box-sizing: border-box;
145143
width: 100%;
146-
/* max-width: 1536px; */
144+
margin: -0.5rem;
147145
margin-left: auto;
148146
margin-right: auto;
149147
display: grid;
150148
grid-template-columns: repeat(2, minmax(0px, 1fr));
151-
gap: 1rem;
149+
/* gap: 1rem; */
152150
padding: 1rem;
153151
}
154152
img,
@@ -222,6 +220,7 @@
222220
gap: 0.25em;
223221
grid-auto-flow: column;
224222
padding: 0.35rem 0.6rem;
223+
margin: 0.5rem;
225224
place-items: center;
226225
font-size: 1rem;
227226
background-color: var(--gray-bg);

src/routes/pattern-stickers-skins.svelte

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,6 @@
2828
2929
let { title, url, keywords, desc, image, versions } = Constants.pageDetails(page);
3030
data.sort((a, b) => strings[a.item_id].localeCompare(strings[b.item_id]));
31-
// data.sort((a, b) => a.creation_date.localeCompare(b.creation_date));
3231
3332
let selection = data[0].category_id;
3433
@@ -43,7 +42,6 @@
4342
};
4443
});
4544
const uniqCategories = [...new Map(categories.map((item) => [item["category_id"], item])).values()];
46-
// uniqCategories.sort((a, b) => strings[a.item_id].localeCompare(strings[b.item_id]));
4745
4846
$: selectedUnique = uniqCategories.filter((category) => category.category_id === selection);
4947
</script>
@@ -143,12 +141,12 @@
143141
.radio-toolbar {
144142
box-sizing: border-box;
145143
width: 100%;
146-
/* max-width: 1536px; */
144+
margin: -0.5rem;
147145
margin-left: auto;
148146
margin-right: auto;
149147
display: grid;
150148
grid-template-columns: repeat(2, minmax(0px, 1fr));
151-
gap: 1rem;
149+
/* gap: 1rem; */
152150
padding: 1rem;
153151
}
154152
img,
@@ -222,6 +220,7 @@
222220
gap: 0.25em;
223221
grid-auto-flow: column;
224222
padding: 0.35rem 0.6rem;
223+
margin: 0.5rem;
225224
place-items: center;
226225
font-size: 1rem;
227226
background-color: var(--gray-bg);

0 commit comments

Comments
 (0)