Skip to content

Commit 3c7945e

Browse files
committed
use SvelteUI Lottie over DotLottieSvelte
1 parent be11374 commit 3c7945e

5 files changed

Lines changed: 423 additions & 38 deletions

File tree

package-lock.json

Lines changed: 0 additions & 27 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@
1111
"indexl10n": "node scripts/programatic-langs.js && node scripts/translation-index.js"
1212
},
1313
"dependencies": {
14-
"@lottiefiles/dotlottie-svelte": "^0.10.6",
1514
"penguinmod": "github:PenguinMod/PenguinMod-ApiModule",
1615
"PenguinMod-MarkDown": "github:PenguinMod/PenguinMod-MarkDownNew",
1716
"PenguinMod-SvelteUI": "github:PenguinMod/PenguinMod-SvelteUI"
Lines changed: 52 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,9 @@
11
<script>
2-
import { DotLottieSvelte } from '@lottiefiles/dotlottie-svelte';
2+
// components
3+
import { Lottie } from "PenguinMod-SvelteUI";
4+
import Icon from "$lib/components/Icon/Component.svelte";
35
</script>
46

5-
<h1>DotLottieSvelte</h1>
6-
<h2>@lottiefiles/dotlottie-svelte</h2>
7-
87
<h3>hoverdevice</h3>
98
<p>
109
<span><b>{"/asset/penguin/animated/lottie/hoverdevice.json"}</b></span>
@@ -13,11 +12,14 @@
1312
</p>
1413
<div class="row">
1514
<div class="card">
16-
<DotLottieSvelte
15+
<Lottie
1716
src="/asset/penguin/animated/lottie/hoverdevice.json"
18-
autoplay={true}
19-
loop={true}
20-
/>
17+
autoplay
18+
>
19+
<div class="card-lottie-placeholder">
20+
<Icon style="font-size:48px;">downloading</Icon>
21+
</div>
22+
</Lottie>
2123
</div>
2224
<div class="card">
2325
<img
@@ -26,6 +28,30 @@
2628
/>
2729
</div>
2830
</div>
31+
<h3>test</h3>
32+
<p>
33+
<span><b>{"/asset/penguin/animated/lottie/test.json"}</b></span>
34+
<span>vs.</span>
35+
<span><b>{"/asset/penguin/animated/svg/test.svg"}</b></span>
36+
</p>
37+
<div class="row">
38+
<div class="card">
39+
<Lottie
40+
src="/asset/penguin/animated/lottie/test.json"
41+
autoplay
42+
>
43+
<div class="card-lottie-placeholder">
44+
<Icon style="font-size:48px;">downloading</Icon>
45+
</div>
46+
</Lottie>
47+
</div>
48+
<div class="card">
49+
<img
50+
src="/asset/penguin/animated/svg/test.svg"
51+
alt="Penguin"
52+
/>
53+
</div>
54+
</div>
2955

3056
<style>
3157
.row {
@@ -39,11 +65,27 @@
3965
width: 480px;
4066
height: 480px;
4167
}
68+
.card :global(div[data-penguinmodsvelteui-lottie-placeholder="true"]) {
69+
left: 0;
70+
top: 0;
71+
width: 100%;
72+
height: 100%;
73+
}
74+
.card-lottie-placeholder {
75+
width: 100%;
76+
height: 100%;
4277
43-
img {
78+
display: flex;
79+
flex-direction: column;
80+
align-items: center;
81+
justify-content: center;
82+
}
83+
.card :global(div[data-penguinmodsvelteui-lottie="true"]),
84+
.card img {
4485
width: 100%;
4586
height: 100%;
46-
87+
}
88+
.card img {
4789
object-fit: contain;
4890
}
4991
</style>

static/asset/penguin/animated/lottie/test.json

Lines changed: 1 addition & 0 deletions
Large diffs are not rendered by default.

0 commit comments

Comments
 (0)