This commit is contained in:
tree 2023-05-19 18:33:11 +02:00
parent e6b134bcf5
commit 66faac0994
6 changed files with 105 additions and 40 deletions

View File

@ -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;
}
}

View File

@ -31,7 +31,7 @@
</script>
<div class="text-2xl">
{#each segments.filter(s => !s.hidden) as segment}
{#each segments.filter((s) => !s.hidden) as segment}
<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"
>

View File

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

View File

@ -54,6 +54,47 @@
<div class="text-4xl text-pbw-yellow">June 2-11, 2023</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}
</div>

View File

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

View File

@ -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 @@
</h2>
<div class="filter">
<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} />
</div>
</div>
@ -241,7 +259,9 @@
>
{/if}
</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 type === 'media-partners'}
<td class="w-20">