This commit is contained in:
tree 2023-05-19 18:33:11 +02:00
rodič e6b134bcf5
revize 66faac0994
6 změnil soubory, kde provedl 105 přidání a 40 odebrání

Zobrazit soubor

@ -78,9 +78,20 @@
@apply text-gray-500 dark:text-gray-300; @apply text-gray-500 dark:text-gray-300;
} }
.filter-component { @apply grow; } .filter-component {
.filter-component label, .filter-component input { @apply block; } @apply grow;
.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-component label,
.filter { @apply mt-4 mb-2 text-lg flex; } .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;
}
} }

Zobrazit soubor

@ -31,7 +31,7 @@
</script> </script>
<div class="text-2xl"> <div class="text-2xl">
{#each segments.filter(s => !s.hidden) as segment} {#each segments.filter((s) => !s.hidden) as segment}
<div <div
class="md:flex flex-wrap mb-2 gap-3 items-center text-gray-800 border dark:text-gray-200 border-gray-300 rounded-lg md:border-none px-3 py-2 md:px-0 md:py-0" class="md:flex flex-wrap mb-2 gap-3 items-center text-gray-800 border dark:text-gray-200 border-gray-300 rounded-lg md:border-none px-3 py-2 md:px-0 md:py-0"
> >

Zobrazit soubor

@ -36,7 +36,6 @@
const _url = (col, item) => (item.hidden ? '' : `/${entry}/${col}/${item.id}`); const _url = (col, item) => (item.hidden ? '' : `/${entry}/${col}/${item.id}`);
</script> </script>
{#each arr.map((k) => findObject(k)) as item} {#each arr.map((k) => findObject(k)) as item}
<div <div
class="{size === 'small' ? 'p-0.5 lg:p-1' : 'p-1 lg:p-1.5'} {!item.hidden class="{size === 'small' ? 'p-0.5 lg:p-1' : 'p-1 lg:p-1.5'} {!item.hidden

Zobrazit soubor

@ -54,6 +54,47 @@
<div class="text-4xl text-pbw-yellow">June 2-11, 2023</div> <div class="text-4xl text-pbw-yellow">June 2-11, 2023</div>
</div> </div>
</div> </div>
<div class="bg-white dark:bg-pbw-dark px-6 xl:px-0 pt-6 pb-4">
<div class="max-w-7xl mx-auto bg-pbw-red/10 text-pbw-red dark:text-gray-300 rounded-lg">
<div class="p-5 text-xl">
<p>
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 <a
href="https://guide.prgblockweek.com/"
class="underline hover:no-underline">documentation</a
>.
</p>
<p class="pt-4 text-2xl">
🐦 <a
href="https://twitter.com/PrgBlockWeek"
class="underline hover:no-underline"
target="_blank">Follow us on Twitter</a
>
&nbsp;&nbsp; 📖
<a
href="https://guide.prgblockweek.com/"
class="underline hover:no-underline"
target="_blank">Read our #PBW23 Guide</a
>
&nbsp;&nbsp; 💬
<a href="https://t.me/PrgBlockWeek" class="underline hover:no-underline" target="_blank"
>Join our Telegram group</a
>
</p>
<!--p class="mt-5 opacity-50">⚠️ This is just a temporary site that will soon be replaced by a full-fledged website and information center for <a href="https://twitter.com/search?q=%23PBW23" target="_blank">#PBW23</a>. In the meantime, you can read the <a href="https://guide.prgblockweek.com/faq">FAQ</a> and learn more about our concept.</p-->
<!--p class="mt-5 text-3xl text-center text-pbw-yellow">💛 #PBW23</p-->
</div>
<!--div class="flex flex-wrap gap-10 items-center text-center text-xl md:text-2xl uppercase mt-2 md:mt-7 pb-16 md:pb-24 text-pbw-yellow p-7">
<div class="flex-grow"><a href="https://explore.prgblockweek.com" class="button">Explore #PBW23</a></div>
<div class="flex-grow"><a href="https://twitter.com/PrgBlockWeek" target="_blank" class="button">Follow us on Twitter</a></div>
<div class="flex-grow"><a href="https://t.me/PrgBlockWeek" target="_blank" class="button">Join Telegram group</a></div>
</div-->
</div>
</div>
{/if} {/if}
</div> </div>

Zobrazit soubor

@ -109,13 +109,7 @@
<div <div
class="grid grid-cols-2 sm:grid-cols-3 md:grid-cols-4 xl:grid-cols-6 my-6 text-center text-2xl" class="grid grid-cols-2 sm:grid-cols-3 md:grid-cols-4 xl:grid-cols-6 my-6 text-center text-2xl"
> >
<CollectionList <CollectionList arr={data.bundle.places} col="place" img="photo" {entry} offer={true} />
arr={data.bundle.places}
col="place"
img="photo"
{entry}
offer={true}
/>
</div> </div>
{#if data.bundle.benefits} {#if data.bundle.benefits}
<h2 class="text-2xl uppercase font-bold pbw-text-color-secondary"> <h2 class="text-2xl uppercase font-bold pbw-text-color-secondary">

Zobrazit soubor

@ -23,14 +23,13 @@
let entry = $page.params.entry; let entry = $page.params.entry;
let q = ''; let q = '';
let total = 0 let total = 0;
let scores = {} let scores = {};
$: type = $page.params.type; $: type = $page.params.type;
$: tc = config.collections[type]; $: tc = config.collections[type];
$: items = type === 'speakers' ? processItemsList(data.bundle[type]) : data.bundle[type]; $: items = type === 'speakers' ? processItemsList(data.bundle[type]) : data.bundle[type];
function processItems(_items, query = {}, q = '') { function processItems(_items, query = {}, q = '') {
if (!_items) return []; if (!_items) return [];
_items = [..._items]; _items = [..._items];
@ -56,37 +55,54 @@
_items = _items.sort((x, y) => (x.capacity > y.capacity ? -1 : 1)); _items = _items.sort((x, y) => (x.capacity > y.capacity ? -1 : 1));
} }
const normalize = str => { const normalize = (str) => {
if (typeof str.replace !== "function") { if (typeof str.replace !== 'function') {
return str return str;
} }
return str.normalize("NFD").toLowerCase().replace(/[\u0300-\u036F]/g, "") return str
} .normalize('NFD')
.toLowerCase()
.replace(/[\u0300-\u036F]/g, '');
};
// filters // filters
console.log('@@@@', q) console.log('@@@@', q);
if (q) { if (q) {
scores = {} scores = {};
_items = _items.map(i => { _items = _items
const cols = [["name", 50], ["tags", 30], ["caption", 20], ["venueName"], ["venueAddress"], ["org"], ["chains"], ["description"], ["twitter"], ["country"]] .map((i) => {
scores[i.id] = 0 const cols = [
for (const [ c, cs = 20 ] of cols) { ['name', 50],
let ctag = typeof i[c] === "array" ? i[c].join(", ") : i[c] ['tags', 30],
if (typeof ctag === "string" && normalize(ctag).match(new RegExp(normalize(q), "si"))) { ['caption', 20],
scores[i.id] += cs ['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;
return i })
}).filter(i => scores[i.id] > 0).sort((x, y) => scores[x.id] > scores[y.id] ? -1 : 1) .filter((i) => scores[i.id] > 0)
.sort((x, y) => (scores[x.id] > scores[y.id] ? -1 : 1));
} else { } else {
total = _items.filter((e) => !e.hidden).length total = _items.filter((e) => !e.hidden).length;
} }
return _items; return _items;
} }
$: processedItems = processItems(items, {}, q); //, Object.fromEntries($page.url.searchParams)) $: 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 () => { onMount(async () => {
if (!config.collections[$page.params.type]) { if (!config.collections[$page.params.type]) {
@ -115,7 +131,9 @@
</h2> </h2>
<div class="filter"> <div class="filter">
<div class="filter-component"> <div class="filter-component">
<label for="q">Search{#if q}: "{q}"{/if}</label> <label for="q"
>Search{#if q}: "{q}"{/if}</label
>
<input type="text" id="q" class="w-full" bind:value={q} /> <input type="text" id="q" class="w-full" bind:value={q} />
</div> </div>
</div> </div>
@ -241,7 +259,9 @@
> >
{/if} {/if}
</td> </td>
<td class="hidden md:table-cell"><SvelteMarkdown source={item.caption || ''} /></td> <td class="hidden md:table-cell"
><SvelteMarkdown source={item.caption || ''} /></td
>
{/if} {/if}
{#if type === 'media-partners'} {#if type === 'media-partners'}
<td class="w-20"> <td class="w-20">