tangled
alpha
login
or
join now
flo-bit.dev
/
blento
your personal website on atproto - mirror
blento.app
20
fork
atom
overview
issues
pulls
pipelines
edits
unbedenklich
2 weeks ago
708fd34a
46564bb0
+9
-4
2 changed files
expand all
collapse all
unified
split
src
lib
cards
index.ts
website
EditableWebsite.svelte
+2
src/lib/cards/index.ts
···
19
19
import { BlueskyProfileCardDefinition } from './BlueskyProfileCard';
20
20
import { GithubProfileCardDefitition } from './GitHubProfileCard';
21
21
import { FluidTextCardDefinition } from './FluidTextCard';
22
22
+
import { GifCardDefinition } from './GIFCard';
22
23
import { PopfeedReviewsCardDefinition } from './PopfeedReviews';
23
24
import { TealFMPlaysCardDefinition } from './TealFMPlaysCard';
24
25
import { PhotoGalleryCardDefinition } from './PhotoGalleryCard';
···
46
47
GithubProfileCardDefitition,
47
48
TetrisCardDefinition,
48
49
FluidTextCardDefinition,
50
50
+
GifCardDefinition,
49
51
PopfeedReviewsCardDefinition,
50
52
TealFMPlaysCardDefinition,
51
53
PhotoGalleryCardDefinition,
+7
-4
src/lib/website/EditableWebsite.svelte
···
324
324
}
325
325
326
326
async function processImageFile(file: File, gridX?: number, gridY?: number) {
327
327
-
const compressedFile = await compressImage(file);
328
328
-
const objectUrl = URL.createObjectURL(compressedFile);
327
327
+
const isGif = file.type === 'image/gif';
328
328
+
329
329
+
// Don't compress GIFs to preserve animation
330
330
+
const processedFile = isGif ? file : await compressImage(file);
331
331
+
const objectUrl = URL.createObjectURL(processedFile);
329
332
330
333
let item = createEmptyCard(data.page);
331
334
332
332
-
item.cardType = 'image';
335
335
+
item.cardType = isGif ? 'gif' : 'image';
333
336
item.cardData = {
334
334
-
blob: compressedFile,
337
337
+
blob: processedFile,
335
338
objectUrl
336
339
};
337
340