diff --git a/src/app.css b/src/app.css index cc1cf494..18652d86 100644 --- a/src/app.css +++ b/src/app.css @@ -78,9 +78,20 @@ @apply text-gray-500 dark:text-gray-300; } - .filter-component { @apply grow; } - .filter-component label, .filter-component input { @apply block; } - .filter-component label { @apply uppercase text-black/60; } - .filter-component input { @apply border py-1 px-2 border-black/40 rounded bg-black/5; } - .filter { @apply mt-4 mb-2 text-lg flex; } + .filter-component { + @apply grow; + } + .filter-component label, + .filter-component input { + @apply block; + } + .filter-component label { + @apply uppercase text-black/60; + } + .filter-component input { + @apply border py-1 px-2 border-black/40 rounded bg-black/5; + } + .filter { + @apply mt-4 mb-2 text-lg flex; + } } diff --git a/src/lib/components/CalendarList.svelte b/src/lib/components/CalendarList.svelte index 3a488cd3..7207ad6e 100644 --- a/src/lib/components/CalendarList.svelte +++ b/src/lib/components/CalendarList.svelte @@ -31,7 +31,7 @@
- {#each segments.filter(s => !s.hidden) as segment} + {#each segments.filter((s) => !s.hidden) as segment}
diff --git a/src/lib/components/CollectionList.svelte b/src/lib/components/CollectionList.svelte index 4ad216b9..7aca8742 100644 --- a/src/lib/components/CollectionList.svelte +++ b/src/lib/components/CollectionList.svelte @@ -36,7 +36,6 @@ const _url = (col, item) => (item.hidden ? '' : `/${entry}/${col}/${item.id}`); - {#each arr.map((k) => findObject(k)) as item}
June 2-11, 2023
+
+
+
+

+ A decentralized gathering for cryptocurrency enthusiasts and related topics. It includes + events like conferences, hackathons, workshops, meetups, and parties from Jun 2 - 11. + Topics covered range from hard money to NFTs, DeFi to mining. The initiative is chain + agnostic and aims to foster discussion among different blockchain proponents. Financial + freedom, decentralization, and privacy are the common themes. More information and FAQs + can be found in our documentation. +

+

+ 🐦 Follow us on Twitter +    📖 + Read our #PBW23 Guide +    💬 + Join our Telegram group +

+ + +
+ +
+
{/if} diff --git a/src/routes/[entry]/+page.svelte b/src/routes/[entry]/+page.svelte index 9c731364..1f5ffd4b 100644 --- a/src/routes/[entry]/+page.svelte +++ b/src/routes/[entry]/+page.svelte @@ -109,13 +109,7 @@
- +
{#if data.bundle.benefits}

diff --git a/src/routes/[entry]/[type]/+page.svelte b/src/routes/[entry]/[type]/+page.svelte index 97cf3856..4d103665 100644 --- a/src/routes/[entry]/[type]/+page.svelte +++ b/src/routes/[entry]/[type]/+page.svelte @@ -23,14 +23,13 @@ let entry = $page.params.entry; let q = ''; - let total = 0 - let scores = {} + let total = 0; + let scores = {}; $: type = $page.params.type; $: tc = config.collections[type]; $: items = type === 'speakers' ? processItemsList(data.bundle[type]) : data.bundle[type]; - function processItems(_items, query = {}, q = '') { if (!_items) return []; _items = [..._items]; @@ -56,37 +55,54 @@ _items = _items.sort((x, y) => (x.capacity > y.capacity ? -1 : 1)); } - const normalize = str => { - if (typeof str.replace !== "function") { - return str + const normalize = (str) => { + if (typeof str.replace !== 'function') { + return str; } - return str.normalize("NFD").toLowerCase().replace(/[\u0300-\u036F]/g, "") - } - + return str + .normalize('NFD') + .toLowerCase() + .replace(/[\u0300-\u036F]/g, ''); + }; + // filters - console.log('@@@@', q) + console.log('@@@@', q); if (q) { - scores = {} - _items = _items.map(i => { - const cols = [["name", 50], ["tags", 30], ["caption", 20], ["venueName"], ["venueAddress"], ["org"], ["chains"], ["description"], ["twitter"], ["country"]] - scores[i.id] = 0 - for (const [ c, cs = 20 ] of cols) { - let ctag = typeof i[c] === "array" ? i[c].join(", ") : i[c] - if (typeof ctag === "string" && normalize(ctag).match(new RegExp(normalize(q), "si"))) { - scores[i.id] += cs + scores = {}; + _items = _items + .map((i) => { + const cols = [ + ['name', 50], + ['tags', 30], + ['caption', 20], + ['venueName'], + ['venueAddress'], + ['org'], + ['chains'], + ['description'], + ['twitter'], + ['country'] + ]; + scores[i.id] = 0; + for (const [c, cs = 20] of cols) { + let ctag = typeof i[c] === 'array' ? i[c].join(', ') : i[c]; + if (typeof ctag === 'string' && normalize(ctag).match(new RegExp(normalize(q), 'si'))) { + scores[i.id] += cs; + } } - } - return i - }).filter(i => scores[i.id] > 0).sort((x, y) => scores[x.id] > scores[y.id] ? -1 : 1) + return i; + }) + .filter((i) => scores[i.id] > 0) + .sort((x, y) => (scores[x.id] > scores[y.id] ? -1 : 1)); } else { - total = _items.filter((e) => !e.hidden).length + total = _items.filter((e) => !e.hidden).length; } - + return _items; } $: processedItems = processItems(items, {}, q); //, Object.fromEntries($page.url.searchParams)) - $: currentTotal = processedItems.filter((e) => !e.hidden).length + $: currentTotal = processedItems.filter((e) => !e.hidden).length; onMount(async () => { if (!config.collections[$page.params.type]) { @@ -115,7 +131,9 @@

- +
@@ -241,7 +259,9 @@ > {/if} - + {/if} {#if type === 'media-partners'}