svelte-animated-icon 1.0.2 → 1.0.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
<script lang="ts" module>
|
|
2
|
-
|
|
2
|
+
import type { HTMLAttributes } from 'svelte/elements';
|
|
3
|
+
|
|
4
|
+
export interface Props extends HTMLAttributes<HTMLDivElement> {
|
|
3
5
|
/** Pre-stripped SVG inner content (no <svg> wrapper, no bounding rect) */
|
|
4
6
|
svg: string;
|
|
5
7
|
/** SVG coordinate space of `svg`. Phosphor is 256; Remix/Lucide are 24. */
|
|
@@ -22,13 +24,27 @@
|
|
|
22
24
|
/** Override the timing easing (any CSS easing string); null = keep the template's own. */
|
|
23
25
|
easing?: string | null;
|
|
24
26
|
class?: string;
|
|
27
|
+
color?: string;
|
|
25
28
|
}
|
|
26
29
|
</script>
|
|
27
30
|
|
|
28
31
|
<script lang="ts">
|
|
29
32
|
import { getTemplate, clearProps } from './templates.svelte';
|
|
30
33
|
|
|
31
|
-
let {
|
|
34
|
+
let {
|
|
35
|
+
svg,
|
|
36
|
+
viewBox = '0 0 256 256',
|
|
37
|
+
template = 'draw',
|
|
38
|
+
size = 24,
|
|
39
|
+
trigger = 'hover',
|
|
40
|
+
active = false,
|
|
41
|
+
loop = false,
|
|
42
|
+
speed = 1,
|
|
43
|
+
easing = null,
|
|
44
|
+
class: className = '',
|
|
45
|
+
color,
|
|
46
|
+
...rest
|
|
47
|
+
}: Props = $props();
|
|
32
48
|
|
|
33
49
|
let svgEl = $state<SVGSVGElement | null>(null);
|
|
34
50
|
let anims: Animation[] = [];
|
|
@@ -80,10 +96,18 @@
|
|
|
80
96
|
</script>
|
|
81
97
|
|
|
82
98
|
<div
|
|
99
|
+
{...rest}
|
|
83
100
|
class="animated-icon {className}"
|
|
84
101
|
role="img"
|
|
85
|
-
onmouseenter={() =>
|
|
86
|
-
|
|
102
|
+
onmouseenter={(e) => {
|
|
103
|
+
if (trigger === 'hover') startAnimation();
|
|
104
|
+
if (typeof rest.onmouseenter === 'function') rest.onmouseenter(e);
|
|
105
|
+
}}
|
|
106
|
+
onmouseleave={(e) => {
|
|
107
|
+
if (trigger === 'hover') stopAnimation();
|
|
108
|
+
if (typeof rest.onmouseleave === 'function') rest.onmouseleave(e);
|
|
109
|
+
}}
|
|
110
|
+
style:color={color}
|
|
87
111
|
>
|
|
88
112
|
<svg
|
|
89
113
|
bind:this={svgEl}
|
|
@@ -96,3 +120,4 @@
|
|
|
96
120
|
{@html svg}
|
|
97
121
|
</svg>
|
|
98
122
|
</div>
|
|
123
|
+
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
|
|
1
|
+
import type { HTMLAttributes } from 'svelte/elements';
|
|
2
|
+
export interface Props extends HTMLAttributes<HTMLDivElement> {
|
|
2
3
|
/** Pre-stripped SVG inner content (no <svg> wrapper, no bounding rect) */
|
|
3
4
|
svg: string;
|
|
4
5
|
/** SVG coordinate space of `svg`. Phosphor is 256; Remix/Lucide are 24. */
|
|
@@ -21,6 +22,7 @@ export interface Props {
|
|
|
21
22
|
/** Override the timing easing (any CSS easing string); null = keep the template's own. */
|
|
22
23
|
easing?: string | null;
|
|
23
24
|
class?: string;
|
|
25
|
+
color?: string;
|
|
24
26
|
}
|
|
25
27
|
declare const AnimatedIcon: import("svelte").Component<Props, {
|
|
26
28
|
startAnimation: () => void;
|
|
@@ -8,23 +8,54 @@
|
|
|
8
8
|
&.xleft
|
|
9
9
|
align-items: flex-start
|
|
10
10
|
text-align: left
|
|
11
|
+
&.xright
|
|
12
|
+
align-items: flex-end
|
|
13
|
+
text-align: right
|
|
11
14
|
&.ycenter
|
|
12
15
|
justify-content: center
|
|
16
|
+
&.ytop
|
|
17
|
+
justify-content: flex-start
|
|
18
|
+
&.ybot
|
|
19
|
+
justify-content: flex-end
|
|
20
|
+
@media (max-width: 1024px)
|
|
21
|
+
&.xright.mleft
|
|
22
|
+
align-items: flex-start
|
|
23
|
+
text-align: left
|
|
13
24
|
|
|
14
25
|
.row
|
|
15
26
|
flex-direction: row
|
|
27
|
+
&.wrap
|
|
28
|
+
flex-wrap: wrap
|
|
16
29
|
&.ycenter
|
|
17
30
|
align-items: center
|
|
18
31
|
&.ytop
|
|
19
32
|
align-items: flex-start
|
|
33
|
+
&.ybot
|
|
34
|
+
align-items: flex-end
|
|
20
35
|
&.xbetween
|
|
21
36
|
justify-content: space-between
|
|
22
|
-
&.
|
|
37
|
+
&.xright
|
|
23
38
|
justify-content: flex-end
|
|
39
|
+
&.xleft
|
|
40
|
+
justify-content: flex-start
|
|
41
|
+
@media (max-width: 1024px)
|
|
42
|
+
&.mwrap
|
|
43
|
+
flex-wrap: wrap
|
|
24
44
|
|
|
25
45
|
.grid
|
|
26
46
|
display: grid
|
|
27
47
|
grid-auto-flow: row
|
|
48
|
+
@media (min-width: 1025px)
|
|
49
|
+
&.grid-cols-2
|
|
50
|
+
grid-template-columns: repeat(2, minmax(0, 1fr))
|
|
51
|
+
&.grid-cols-3
|
|
52
|
+
grid-template-columns: repeat(3, minmax(0, 1fr))
|
|
53
|
+
&.grid-cols-4
|
|
54
|
+
grid-template-columns: repeat(4, minmax(0, 1fr))
|
|
55
|
+
&.grid-cols-5
|
|
56
|
+
grid-template-columns: repeat(5, minmax(0, 1fr))
|
|
57
|
+
&.grid-cols-6
|
|
58
|
+
grid-template-columns: repeat(6, minmax(0, 1fr))
|
|
28
59
|
|
|
29
60
|
.animated-icon
|
|
30
|
-
color:
|
|
61
|
+
color: inherit
|
|
@@ -42,10 +42,29 @@
|
|
|
42
42
|
font-size: var(--text-4xl)
|
|
43
43
|
.text-5xl
|
|
44
44
|
font-size: var(--text-5xl)
|
|
45
|
-
|
|
46
45
|
.tt-u
|
|
47
46
|
text-transform: uppercase
|
|
47
|
+
.tt-c
|
|
48
|
+
text-transform: capitalize
|
|
49
|
+
.w400
|
|
50
|
+
font-weight: 400
|
|
51
|
+
.w500
|
|
52
|
+
font-weight: 500
|
|
53
|
+
.w600
|
|
54
|
+
font-weight: 600
|
|
55
|
+
.bold
|
|
56
|
+
font-weight: bold
|
|
57
|
+
.lh11
|
|
58
|
+
line-height: 1.1
|
|
59
|
+
.lh125
|
|
60
|
+
line-height: 1.25
|
|
61
|
+
.lh15
|
|
62
|
+
line-height: 1.5
|
|
63
|
+
.lh16
|
|
64
|
+
line-height: 1.6
|
|
48
65
|
|
|
66
|
+
.col1
|
|
67
|
+
color: var(--text10)
|
|
49
68
|
.col2
|
|
50
69
|
color: var(--text20)
|
|
51
70
|
.col3
|
|
@@ -53,13 +72,6 @@
|
|
|
53
72
|
.col-theme
|
|
54
73
|
color: var(--text100)
|
|
55
74
|
|
|
56
|
-
.w400
|
|
57
|
-
font-weight: 400
|
|
58
|
-
.w500
|
|
59
|
-
font-weight: 500
|
|
60
|
-
.w600, .bold
|
|
61
|
-
font-weight: 600
|
|
62
|
-
|
|
63
75
|
.ls-tight
|
|
64
76
|
letter-spacing: var(--ls-tight)
|
|
65
77
|
.ls-tightx
|
|
@@ -69,15 +81,6 @@
|
|
|
69
81
|
.ls-widex
|
|
70
82
|
letter-spacing: var(--ls-widex)
|
|
71
83
|
|
|
72
|
-
.lh11
|
|
73
|
-
line-height: 1.1
|
|
74
|
-
.lh125
|
|
75
|
-
line-height: 1.25
|
|
76
|
-
.lh15
|
|
77
|
-
line-height: 1.5
|
|
78
|
-
.lh16
|
|
79
|
-
line-height: 1.6
|
|
80
|
-
|
|
81
84
|
.sidebar-accordion
|
|
82
85
|
span
|
|
83
86
|
font-weight: 500
|
package/package.json
CHANGED
|
@@ -1,87 +1,89 @@
|
|
|
1
1
|
{
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
2
|
+
"name": "svelte-animated-icon",
|
|
3
|
+
"version": "1.0.3",
|
|
4
|
+
"repository": {
|
|
5
|
+
"type": "git",
|
|
6
|
+
"url": "git+https://github.com/fractalmandala/svelte-animated-icon.git"
|
|
7
|
+
},
|
|
8
|
+
"homepage": "https://svelte-animated-icon.vercel.app",
|
|
9
|
+
"bugs": {
|
|
10
|
+
"url": "https://github.com/fractalmandala/svelte-animated-icon/issues"
|
|
11
|
+
},
|
|
12
|
+
"scripts": {
|
|
13
|
+
"dev": "vite dev",
|
|
14
|
+
"build": "vite build && npm run prepack",
|
|
15
|
+
"preview": "vite preview",
|
|
16
|
+
"prepare": "svelte-kit sync || echo ''",
|
|
17
|
+
"prepack": "svelte-kit sync && svelte-package && publint",
|
|
18
|
+
"check": "svelte-kit sync && svelte-check --tsconfig ./tsconfig.json",
|
|
19
|
+
"check:watch": "svelte-kit sync && svelte-check --tsconfig ./tsconfig.json --watch",
|
|
20
|
+
"lint": "prettier --check . && eslint .",
|
|
21
|
+
"format": "prettier --write ."
|
|
22
|
+
},
|
|
23
|
+
"files": [
|
|
24
|
+
"dist",
|
|
25
|
+
"!dist/**/*.test.*",
|
|
26
|
+
"!dist/**/*.spec.*"
|
|
27
|
+
],
|
|
28
|
+
"sideEffects": [
|
|
29
|
+
"**/*.css"
|
|
30
|
+
],
|
|
31
|
+
"svelte": "./dist/index.js",
|
|
32
|
+
"types": "./dist/index.d.ts",
|
|
33
|
+
"type": "module",
|
|
34
|
+
"exports": {
|
|
35
|
+
".": {
|
|
36
|
+
"types": "./dist/index.d.ts",
|
|
37
|
+
"svelte": "./dist/index.js"
|
|
38
|
+
},
|
|
39
|
+
"./phosphor": {
|
|
40
|
+
"types": "./dist/phosphor/index.d.ts",
|
|
41
|
+
"svelte": "./dist/phosphor/index.js"
|
|
42
|
+
},
|
|
43
|
+
"./remix": {
|
|
44
|
+
"types": "./dist/remix/index.d.ts",
|
|
45
|
+
"svelte": "./dist/remix/index.js"
|
|
46
|
+
},
|
|
47
|
+
"./flowbite": {
|
|
48
|
+
"types": "./dist/flowbite/index.d.ts",
|
|
49
|
+
"svelte": "./dist/flowbite/index.js"
|
|
50
|
+
},
|
|
51
|
+
"./hero": {
|
|
52
|
+
"types": "./dist/hero/index.d.ts",
|
|
53
|
+
"svelte": "./dist/hero/index.js"
|
|
54
|
+
},
|
|
55
|
+
"./ion": {
|
|
56
|
+
"types": "./dist/ion/index.d.ts",
|
|
57
|
+
"svelte": "./dist/ion/index.js"
|
|
58
|
+
}
|
|
59
|
+
},
|
|
60
|
+
"peerDependencies": {
|
|
61
|
+
"svelte": "^5.0.0"
|
|
62
|
+
},
|
|
63
|
+
"devDependencies": {
|
|
64
|
+
"@eslint/js": "^10.0.1",
|
|
65
|
+
"@formkit/auto-animate": "^0.9.0",
|
|
66
|
+
"@sveltejs/adapter-vercel": "^6.3.3",
|
|
67
|
+
"@sveltejs/kit": "^2.63.0",
|
|
68
|
+
"@sveltejs/package": "^2.5.8",
|
|
69
|
+
"@sveltejs/vite-plugin-svelte": "^7.1.2",
|
|
70
|
+
"@types/node": "^24",
|
|
71
|
+
"eslint": "^10.4.1",
|
|
72
|
+
"eslint-config-prettier": "^10.1.8",
|
|
73
|
+
"eslint-plugin-svelte": "^3.19.0",
|
|
74
|
+
"globals": "^17.6.0",
|
|
75
|
+
"mdsvex": "^0.12.7",
|
|
76
|
+
"prettier": "^3.8.3",
|
|
77
|
+
"prettier-plugin-svelte": "^4.1.0",
|
|
78
|
+
"publint": "^0.3.21",
|
|
79
|
+
"sass": "^1.100.0",
|
|
80
|
+
"svelte": "^5.56.1",
|
|
81
|
+
"svelte-check": "^4.6.0",
|
|
82
|
+
"typescript": "^6.0.3",
|
|
83
|
+
"typescript-eslint": "^8.60.1",
|
|
84
|
+
"vite": "^8.0.16"
|
|
85
|
+
},
|
|
86
|
+
"keywords": [
|
|
87
|
+
"svelte"
|
|
88
|
+
]
|
|
89
|
+
}
|