mirror of
https://github.com/0PandaDEV/Qopy.git
synced 2025-04-21 13:14:04 +02:00
added new icons
This commit is contained in:
parent
14fb5c37a9
commit
51d2243e73
13 changed files with 195 additions and 185 deletions
22
app.vue
22
app.vue
|
@ -5,7 +5,7 @@
|
|||
spellcheck="false" class="search" type="text" placeholder="Type to filter entries...">
|
||||
<div class="bottom-bar">
|
||||
<div class="left">
|
||||
<img class="logo" width="18px" src="/Logo.svg" alt="">
|
||||
<img class="logo" width="18px" src="/logo.png" alt="">
|
||||
<p>Qopy</p>
|
||||
</div>
|
||||
<div class="right">
|
||||
|
@ -32,9 +32,14 @@
|
|||
:class="['result clothoid-corner', { 'selected': isSelected(groupIndex, index) }]"
|
||||
@click="selectItem(groupIndex, index)"
|
||||
:ref="el => { if (isSelected(groupIndex, index)) selectedElement = el as HTMLElement }">
|
||||
<img v-if="item.content_type === 'image'" :src="getComputedImageUrl(item)" alt="Image" class="favicon-image">
|
||||
<img v-else-if="isUrl(item.content)" :src="getFaviconFromDb(item.favicon ?? '')" alt="Favicon" class="favicon">
|
||||
<FileIcon class="file" v-else />
|
||||
<template v-if="item.content_type === 'image'">
|
||||
<img :src="getComputedImageUrl(item)" alt="Image" class="image" @error="onImageError">
|
||||
<IconsImage v-show="imageLoadError" class="icon" />
|
||||
</template>
|
||||
<img v-else-if="hasFavicon(item.favicon ?? '')" :src="getFaviconFromDb(item.favicon ?? '')" alt="Favicon" class="favicon">
|
||||
<IconsFile class="icon" v-else-if="item.content_type === 'files'" />
|
||||
<IconsText class="icon" v-else-if="item.content_type === 'text'" />
|
||||
<IconsCode class="icon" v-else-if="item.content_type === 'code'" />
|
||||
<span v-if="item.content_type === 'image'">Image ({{ item.dimensions || 'Loading...' }})</span>
|
||||
<span v-else>{{ truncateContent(item.content) }}</span>
|
||||
</div>
|
||||
|
@ -225,13 +230,8 @@ const truncateContent = (content: string): string => {
|
|||
return content.length > maxChars ? content.slice(0, maxChars - 3) + '...' : content;
|
||||
};
|
||||
|
||||
const isUrl = (str: string): boolean => {
|
||||
try {
|
||||
new URL(str);
|
||||
return true;
|
||||
} catch {
|
||||
return false;
|
||||
}
|
||||
const hasFavicon = (str: string): boolean => {
|
||||
return str.trim() !== '';
|
||||
};
|
||||
|
||||
const isYoutubeWatchUrl = (url: string): boolean => {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue