tangled
alpha
login
or
join now
flo-bit.dev
/
blento
21
fork
atom
your personal website on atproto - mirror
blento.app
21
fork
atom
overview
issues
pulls
pipelines
small fixes
Florian
1 month ago
05c4a0e5
104b631e
+3
-22
2 changed files
expand all
collapse all
unified
split
src
lib
cards
GIFCard
EditingGifCard.svelte
index.ts
+2
-15
src/lib/cards/GIFCard/EditingGifCard.svelte
···
70
70
return trimmedUrl;
71
71
}
72
72
73
73
-
// Tenor page URL: https://tenor.com/view/name-name-gif-ID
74
74
-
const tenorMatch = trimmedUrl.match(/tenor\.com\/view\/.*-(\d+)(?:\?|$)/);
75
75
-
if (tenorMatch) {
76
76
-
// Tenor doesn't have a simple direct URL conversion, keep as-is for now
77
77
-
// Users should use the "Copy GIF" link from Tenor which gives media URL
78
78
-
return trimmedUrl;
79
79
-
}
80
80
-
81
81
-
// Tenor media URL - already correct
82
82
-
if (trimmedUrl.includes('media.tenor.com') || trimmedUrl.includes('c.tenor.com')) {
83
83
-
return trimmedUrl;
84
84
-
}
85
85
-
86
73
// Return as-is for direct GIF URLs or other sources
87
74
return trimmedUrl;
88
75
}
···
163
150
</div>
164
151
<div class="text-center">
165
152
<p class="text-base-700 dark:text-base-300 text-sm font-medium">Drop a GIF here</p>
166
166
-
<p class="text-base-500 dark:text-base-500 mt-1 text-xs">or click to enter URL</p>
153
153
+
<p class="text-base-500 dark:text-base-500 mt-1 text-xs">or click to enter GIPHY URL</p>
167
154
</div>
168
155
</div>
169
156
{/if}
···
182
169
onblur={handleUrlSubmit}
183
170
onkeydown={handleKeydown}
184
171
class="w-full rounded-lg border border-white/20 bg-white/10 px-4 py-2 text-sm text-white placeholder-white/50 transition-colors outline-none focus:border-white/40 focus:bg-white/20"
185
185
-
placeholder="Paste GIF URL"
172
172
+
placeholder="Paste GIPHY URL"
186
173
/>
187
174
<p class="mt-2 text-center text-xs text-white/60">
188
175
Press Enter to confirm, Escape to cancel
+1
-7
src/lib/cards/GIFCard/index.ts
···
39
39
minW: 1,
40
40
minH: 1,
41
41
onUrlHandler: (url, item) => {
42
42
-
const gifUrlPatterns = [
43
43
-
/\.gif(\?.*)?$/i,
44
44
-
/giphy\.com\/gifs\//i,
45
45
-
/media\.giphy\.com/i,
46
46
-
/tenor\.com/i,
47
47
-
/imgur\.com.*\.gif/i
48
48
-
];
42
42
+
const gifUrlPatterns = [/\.gif(\?.*)?$/i, /giphy\.com\/gifs\//i, /media\.giphy\.com/i];
49
43
50
44
if (gifUrlPatterns.some((pattern) => pattern.test(url))) {
51
45
// Convert Giphy page URLs to direct media URLs