general cleanup
Some checks failed
Build and publish the docker image / build (push) Failing after 1m16s
Some checks failed
Build and publish the docker image / build (push) Failing after 1m16s
Signed-off-by: ngn <ngn@ngn.tf>
This commit is contained in:
@ -21,40 +21,11 @@ export default {
|
||||
return {
|
||||
data,
|
||||
status,
|
||||
filterTags: '',
|
||||
following,
|
||||
followingStreaming
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
filterSearches(toFilter: string) {
|
||||
const categories = this.$refs.categoryItem
|
||||
const wantedTags: string[] = toFilter
|
||||
.toLowerCase()
|
||||
.split(',')
|
||||
.filter((v) => v.toLowerCase())
|
||||
|
||||
for (let category of categories as any) {
|
||||
let tagElements = category.getElementsByTagName('span')
|
||||
let tags = []
|
||||
|
||||
for (let tag of tagElements) {
|
||||
tags.push(tag.innerText.toLowerCase())
|
||||
}
|
||||
|
||||
// Create sets from the arrays
|
||||
const [set1, set2] = [new Set(wantedTags), new Set(tags)]
|
||||
const common = [...set1].filter((x) => set2.has(x))
|
||||
|
||||
if (common.length === wantedTags.length) {
|
||||
category.style.display = ''
|
||||
} else if (wantedTags[0] === '') {
|
||||
category.style.display = ''
|
||||
} else {
|
||||
category.style.display = 'none'
|
||||
}
|
||||
}
|
||||
},
|
||||
async getNextCategory() {
|
||||
let bottomOfWindow =
|
||||
document.documentElement.scrollTop + window.innerHeight ===
|
||||
@ -130,27 +101,9 @@ export default {
|
||||
<div class="p-2 text-contrast">
|
||||
<h1 class="font-bold text-5xl">{{ $t('home.discover') }}</h1>
|
||||
<p class="text-xl">{{ $t('home.discoverDescription') }}</p>
|
||||
|
||||
<div class="pt-5 inline-flex">
|
||||
<p class="mr-2 font-bold">{{ $t('home.tagDescription') }}</p>
|
||||
<div class="relative">
|
||||
<label for="searchBar" class="hidden">{{ $t('main.search') }}</label>
|
||||
<v-icon name="io-search-outline" class="absolute my-auto inset-y-0 left-2"></v-icon>
|
||||
<input
|
||||
type="text"
|
||||
id="searchBar"
|
||||
name="searchBar"
|
||||
:placeholder="$t('main.search')"
|
||||
v-model="filterTags"
|
||||
@keypress="filterSearches(filterTags)"
|
||||
@keyup="filterSearches(filterTags)"
|
||||
class="rounded-md p-1 pl-8 placeholder:text-white"
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<ul ref="categoryList" class="flex flex-wrap justify-center">
|
||||
<ul ref="categoryList" class="flex flex-wrap">
|
||||
<li
|
||||
v-for="category in data"
|
||||
:key="category.name"
|
||||
|
Reference in New Issue
Block a user