@levita-js/vue 0.2.1 → 0.3.1
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.
- package/README.md +2 -2
- package/dist/index.cjs +9 -1
- package/dist/index.d.cts +19 -1
- package/dist/index.d.cts.map +1 -1
- package/dist/index.d.mts +19 -1
- package/dist/index.d.mts.map +1 -1
- package/dist/index.mjs +9 -1
- package/dist/index.mjs.map +1 -1
- package/dist/style.css +57 -0
- package/package.json +8 -5
package/README.md
CHANGED
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
## Installation
|
|
6
6
|
|
|
7
7
|
```bash
|
|
8
|
-
npm install
|
|
8
|
+
npm install @levita-js/vue
|
|
9
9
|
```
|
|
10
10
|
|
|
11
11
|
## Quick Start
|
|
@@ -13,7 +13,7 @@ npm install levita-js @levita-js/vue
|
|
|
13
13
|
```vue
|
|
14
14
|
<script setup>
|
|
15
15
|
import { Tilt } from "@levita-js/vue";
|
|
16
|
-
import "levita-js/style.css";
|
|
16
|
+
import "@levita-js/vue/style.css";
|
|
17
17
|
</script>
|
|
18
18
|
|
|
19
19
|
<template>
|
package/dist/index.cjs
CHANGED
|
@@ -16,7 +16,7 @@ let vue = require("vue");
|
|
|
16
16
|
* ```vue
|
|
17
17
|
* <script setup>
|
|
18
18
|
* import { Tilt } from '@levita-js/vue';
|
|
19
|
-
* import 'levita-js/style.css';
|
|
19
|
+
* import '@levita-js/vue/style.css';
|
|
20
20
|
* <\/script>
|
|
21
21
|
*
|
|
22
22
|
* <template>
|
|
@@ -77,6 +77,14 @@ const Tilt = (0, vue.defineComponent)({
|
|
|
77
77
|
type: [String, Boolean],
|
|
78
78
|
default: void 0
|
|
79
79
|
},
|
|
80
|
+
gyroRange: {
|
|
81
|
+
type: Number,
|
|
82
|
+
default: void 0
|
|
83
|
+
},
|
|
84
|
+
gyroSmoothing: {
|
|
85
|
+
type: Number,
|
|
86
|
+
default: void 0
|
|
87
|
+
},
|
|
80
88
|
disabled: {
|
|
81
89
|
type: Boolean,
|
|
82
90
|
default: void 0
|
package/dist/index.d.cts
CHANGED
|
@@ -16,7 +16,7 @@ import { Axis, GyroscopeMode } from "levita-js";
|
|
|
16
16
|
* ```vue
|
|
17
17
|
* <script setup>
|
|
18
18
|
* import { Tilt } from '@levita-js/vue';
|
|
19
|
-
* import 'levita-js/style.css';
|
|
19
|
+
* import '@levita-js/vue/style.css';
|
|
20
20
|
* </script>
|
|
21
21
|
*
|
|
22
22
|
* <template>
|
|
@@ -75,6 +75,14 @@ declare const Tilt: vue.DefineComponent<vue.ExtractPropTypes<{
|
|
|
75
75
|
type: PropType<GyroscopeMode>;
|
|
76
76
|
default: undefined;
|
|
77
77
|
};
|
|
78
|
+
gyroRange: {
|
|
79
|
+
type: NumberConstructor;
|
|
80
|
+
default: undefined;
|
|
81
|
+
};
|
|
82
|
+
gyroSmoothing: {
|
|
83
|
+
type: NumberConstructor;
|
|
84
|
+
default: undefined;
|
|
85
|
+
};
|
|
78
86
|
disabled: {
|
|
79
87
|
type: BooleanConstructor;
|
|
80
88
|
default: undefined;
|
|
@@ -134,6 +142,14 @@ declare const Tilt: vue.DefineComponent<vue.ExtractPropTypes<{
|
|
|
134
142
|
type: PropType<GyroscopeMode>;
|
|
135
143
|
default: undefined;
|
|
136
144
|
};
|
|
145
|
+
gyroRange: {
|
|
146
|
+
type: NumberConstructor;
|
|
147
|
+
default: undefined;
|
|
148
|
+
};
|
|
149
|
+
gyroSmoothing: {
|
|
150
|
+
type: NumberConstructor;
|
|
151
|
+
default: undefined;
|
|
152
|
+
};
|
|
137
153
|
disabled: {
|
|
138
154
|
type: BooleanConstructor;
|
|
139
155
|
default: undefined;
|
|
@@ -155,6 +171,8 @@ declare const Tilt: vue.DefineComponent<vue.ExtractPropTypes<{
|
|
|
155
171
|
maxGlare: number;
|
|
156
172
|
shadow: boolean;
|
|
157
173
|
gyroscope: GyroscopeMode;
|
|
174
|
+
gyroRange: number;
|
|
175
|
+
gyroSmoothing: number;
|
|
158
176
|
disabled: boolean;
|
|
159
177
|
eventsEl: HTMLElement | null;
|
|
160
178
|
}, SlotsType<{
|
package/dist/index.d.cts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.cts","names":[],"sources":["../src/index.ts"],"mappings":";;;;;;;;AAoCA;;;;;;;;;;;;;;;;;;;;cAAa,IAAA,MAAI,eAAA,
|
|
1
|
+
{"version":3,"file":"index.d.cts","names":[],"sources":["../src/index.ts"],"mappings":";;;;;;;;AAoCA;;;;;;;;;;;;;;;;;;;;cAAa,IAAA,MAAI,eAAA,CAsBqB,GAAA,CAtBrB,gBAAA;;;;;;;;;;;;;;;;;;;;;;;;;;UAUS,QAAA,CAAS,IAAA;;;;;;;;;;;;;;;;;;;;UAML,QAAA,CAAS,aAAA;;;;;;;;;;;;;;;;UAMT,QAAA,CAAS,WAAA;;;oBAtBtB,GAAA,CAAA,YAAA;;4GAsBqB,GAAA,CAAA,gBAAA;;;;;;;;;;;;;;;;;;;;;;;;;;UAZZ,QAAA,CAAS,IAAA;;;;;;;;;;;;;;;;;;;;UAML,QAAA,CAAS,aAAA;;;;;;;;;;;;;;;;UAMT,QAAA,CAAS,WAAA;;;;;;;;;;;;;;;;;;;;;WAGA,MAAA;AAAA"}
|
package/dist/index.d.mts
CHANGED
|
@@ -16,7 +16,7 @@ import { PropType, SlotsType } from "vue";
|
|
|
16
16
|
* ```vue
|
|
17
17
|
* <script setup>
|
|
18
18
|
* import { Tilt } from '@levita-js/vue';
|
|
19
|
-
* import 'levita-js/style.css';
|
|
19
|
+
* import '@levita-js/vue/style.css';
|
|
20
20
|
* </script>
|
|
21
21
|
*
|
|
22
22
|
* <template>
|
|
@@ -75,6 +75,14 @@ declare const Tilt: vue.DefineComponent<vue.ExtractPropTypes<{
|
|
|
75
75
|
type: PropType<GyroscopeMode>;
|
|
76
76
|
default: undefined;
|
|
77
77
|
};
|
|
78
|
+
gyroRange: {
|
|
79
|
+
type: NumberConstructor;
|
|
80
|
+
default: undefined;
|
|
81
|
+
};
|
|
82
|
+
gyroSmoothing: {
|
|
83
|
+
type: NumberConstructor;
|
|
84
|
+
default: undefined;
|
|
85
|
+
};
|
|
78
86
|
disabled: {
|
|
79
87
|
type: BooleanConstructor;
|
|
80
88
|
default: undefined;
|
|
@@ -134,6 +142,14 @@ declare const Tilt: vue.DefineComponent<vue.ExtractPropTypes<{
|
|
|
134
142
|
type: PropType<GyroscopeMode>;
|
|
135
143
|
default: undefined;
|
|
136
144
|
};
|
|
145
|
+
gyroRange: {
|
|
146
|
+
type: NumberConstructor;
|
|
147
|
+
default: undefined;
|
|
148
|
+
};
|
|
149
|
+
gyroSmoothing: {
|
|
150
|
+
type: NumberConstructor;
|
|
151
|
+
default: undefined;
|
|
152
|
+
};
|
|
137
153
|
disabled: {
|
|
138
154
|
type: BooleanConstructor;
|
|
139
155
|
default: undefined;
|
|
@@ -155,6 +171,8 @@ declare const Tilt: vue.DefineComponent<vue.ExtractPropTypes<{
|
|
|
155
171
|
maxGlare: number;
|
|
156
172
|
shadow: boolean;
|
|
157
173
|
gyroscope: GyroscopeMode;
|
|
174
|
+
gyroRange: number;
|
|
175
|
+
gyroSmoothing: number;
|
|
158
176
|
disabled: boolean;
|
|
159
177
|
eventsEl: HTMLElement | null;
|
|
160
178
|
}, SlotsType<{
|
package/dist/index.d.mts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.mts","names":[],"sources":["../src/index.ts"],"mappings":";;;;;;;;AAoCA;;;;;;;;;;;;;;;;;;;;cAAa,IAAA,MAAI,eAAA,
|
|
1
|
+
{"version":3,"file":"index.d.mts","names":[],"sources":["../src/index.ts"],"mappings":";;;;;;;;AAoCA;;;;;;;;;;;;;;;;;;;;cAAa,IAAA,MAAI,eAAA,CAsBqB,GAAA,CAtBrB,gBAAA;;;;;;;;;;;;;;;;;;;;;;;;;;UAUS,QAAA,CAAS,IAAA;;;;;;;;;;;;;;;;;;;;UAML,QAAA,CAAS,aAAA;;;;;;;;;;;;;;;;UAMT,QAAA,CAAS,WAAA;;;oBAtBtB,GAAA,CAAA,YAAA;;4GAsBqB,GAAA,CAAA,gBAAA;;;;;;;;;;;;;;;;;;;;;;;;;;UAZZ,QAAA,CAAS,IAAA;;;;;;;;;;;;;;;;;;;;UAML,QAAA,CAAS,aAAA;;;;;;;;;;;;;;;;UAMT,QAAA,CAAS,WAAA;;;;;;;;;;;;;;;;;;;;;WAGA,MAAA;AAAA"}
|
package/dist/index.mjs
CHANGED
|
@@ -15,7 +15,7 @@ import { defineComponent, h, onMounted, onUnmounted, ref, watch } from "vue";
|
|
|
15
15
|
* ```vue
|
|
16
16
|
* <script setup>
|
|
17
17
|
* import { Tilt } from '@levita-js/vue';
|
|
18
|
-
* import 'levita-js/style.css';
|
|
18
|
+
* import '@levita-js/vue/style.css';
|
|
19
19
|
* <\/script>
|
|
20
20
|
*
|
|
21
21
|
* <template>
|
|
@@ -76,6 +76,14 @@ const Tilt = defineComponent({
|
|
|
76
76
|
type: [String, Boolean],
|
|
77
77
|
default: void 0
|
|
78
78
|
},
|
|
79
|
+
gyroRange: {
|
|
80
|
+
type: Number,
|
|
81
|
+
default: void 0
|
|
82
|
+
},
|
|
83
|
+
gyroSmoothing: {
|
|
84
|
+
type: Number,
|
|
85
|
+
default: void 0
|
|
86
|
+
},
|
|
79
87
|
disabled: {
|
|
80
88
|
type: Boolean,
|
|
81
89
|
default: void 0
|
package/dist/index.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.mjs","names":[],"sources":["../src/index.ts"],"sourcesContent":["import type { Axis, GyroscopeMode } from \"levita-js\";\nimport { buildOptions, Levita, OPTION_KEYS } from \"levita-js\";\nimport {\n\tdefineComponent,\n\th,\n\tonMounted,\n\tonUnmounted,\n\ttype PropType,\n\tref,\n\ttype SlotsType,\n\twatch,\n} from \"vue\";\n\n/**\n * Vue 3 wrapper for the Levita 3D tilt effect.\n *\n * Accepts all `LevitaOptions` as props. The Levita instance is created\n * on mount and destroyed on unmount. Changing any tilt prop recreates\n * the instance.\n *\n * Exposes `element`, `instance`, and `requestPermission()` via template ref.\n *\n * @example\n * ```vue\n * <script setup>\n * import { Tilt } from '@levita-js/vue';\n * import 'levita-js/style.css';\n * </script>\n *\n * <template>\n * <Tilt :glare=\"true\" :shadow=\"true\" :max=\"20\">\n * <h1>Hello</h1>\n * </Tilt>\n * </template>\n * ```\n */\nexport const Tilt = defineComponent({\n\tname: \"Tilt\",\n\n\tprops: {\n\t\tmax: { type: Number, default: undefined },\n\t\tperspective: { type: Number, default: undefined },\n\t\tscale: { type: Number, default: undefined },\n\t\tspeed: { type: Number, default: undefined },\n\t\teasing: { type: String, default: undefined },\n\t\treverse: { type: Boolean, default: undefined },\n\t\taxis: { type: String as PropType<Axis>, default: undefined },\n\t\treset: { type: Boolean, default: undefined },\n\t\tglare: { type: Boolean, default: undefined },\n\t\tmaxGlare: { type: Number, default: undefined },\n\t\tshadow: { type: Boolean, default: undefined },\n\t\tgyroscope: {\n\t\t\ttype: [String, Boolean] as PropType<GyroscopeMode>,\n\t\t\tdefault: undefined,\n\t\t},\n\t\tdisabled: { type: Boolean, default: undefined },\n\t\teventsEl: { type: Object as PropType<HTMLElement | null>, default: undefined },\n\t},\n\n\tslots: Object as SlotsType<{ default: Record<string, never> }>,\n\n\tsetup(props, { slots, attrs, expose }) {\n\t\tconst elRef = ref<HTMLElement | null>(null);\n\t\tlet instance: Levita | null = null;\n\n\t\t/** Create a fresh Levita instance on the container element. */\n\t\tconst init = () => {\n\t\t\tif (!elRef.value) return;\n\t\t\tinstance?.destroy();\n\t\t\tinstance = new Levita(elRef.value, buildOptions(props));\n\t\t};\n\n\t\t/** Request accelerometer permission (must be called from a user gesture on iOS). */\n\t\tconst requestPermission = async (): Promise<boolean> => {\n\t\t\treturn (await instance?.requestPermission()) ?? false;\n\t\t};\n\n\t\texpose({\n\t\t\t/** The underlying DOM element. */\n\t\t\tget element() {\n\t\t\t\treturn elRef.value;\n\t\t\t},\n\t\t\t/** The Levita instance driving the tilt effect. */\n\t\t\tget instance() {\n\t\t\t\treturn instance;\n\t\t\t},\n\t\t\trequestPermission,\n\t\t});\n\n\t\tonMounted(init);\n\n\t\tonUnmounted(() => {\n\t\t\tinstance?.destroy();\n\t\t\tinstance = null;\n\t\t});\n\n\t\twatch(\n\t\t\t() => OPTION_KEYS.map((k) => props[k]),\n\t\t\t() => init(),\n\t\t);\n\n\t\treturn () => h(\"div\", { ...attrs, ref: elRef }, slots.default?.({}));\n\t},\n});\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;AAoCA,MAAa,OAAO,gBAAgB;CACnC,MAAM;CAEN,OAAO;EACN,KAAK;GAAE,MAAM;GAAQ,SAAS;GAAW;EACzC,aAAa;GAAE,MAAM;GAAQ,SAAS;GAAW;EACjD,OAAO;GAAE,MAAM;GAAQ,SAAS;GAAW;EAC3C,OAAO;GAAE,MAAM;GAAQ,SAAS;GAAW;EAC3C,QAAQ;GAAE,MAAM;GAAQ,SAAS;GAAW;EAC5C,SAAS;GAAE,MAAM;GAAS,SAAS;GAAW;EAC9C,MAAM;GAAE,MAAM;GAA0B,SAAS;GAAW;EAC5D,OAAO;GAAE,MAAM;GAAS,SAAS;GAAW;EAC5C,OAAO;GAAE,MAAM;GAAS,SAAS;GAAW;EAC5C,UAAU;GAAE,MAAM;GAAQ,SAAS;GAAW;EAC9C,QAAQ;GAAE,MAAM;GAAS,SAAS;GAAW;EAC7C,WAAW;GACV,MAAM,CAAC,QAAQ,QAAQ;GACvB,SAAS;GACT;EACD,UAAU;GAAE,MAAM;GAAS,SAAS;GAAW;EAC/C,UAAU;GAAE,MAAM;GAAwC,SAAS;GAAW;EAC9E;CAED,OAAO;CAEP,MAAM,OAAO,EAAE,OAAO,OAAO,UAAU;EACtC,MAAM,QAAQ,IAAwB,KAAK;EAC3C,IAAI,WAA0B;;EAG9B,MAAM,aAAa;AAClB,OAAI,CAAC,MAAM,MAAO;AAClB,aAAU,SAAS;AACnB,cAAW,IAAI,OAAO,MAAM,OAAO,aAAa,MAAM,CAAC;;;EAIxD,MAAM,oBAAoB,YAA8B;AACvD,UAAQ,MAAM,UAAU,mBAAmB,IAAK;;AAGjD,SAAO;GAEN,IAAI,UAAU;AACb,WAAO,MAAM;;GAGd,IAAI,WAAW;AACd,WAAO;;GAER;GACA,CAAC;AAEF,YAAU,KAAK;AAEf,oBAAkB;AACjB,aAAU,SAAS;AACnB,cAAW;IACV;AAEF,cACO,YAAY,KAAK,MAAM,MAAM,GAAG,QAChC,MAAM,CACZ;AAED,eAAa,EAAE,OAAO;GAAE,GAAG;GAAO,KAAK;GAAO,EAAE,MAAM,UAAU,EAAE,CAAC,CAAC;;CAErE,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.mjs","names":[],"sources":["../src/index.ts"],"sourcesContent":["import type { Axis, GyroscopeMode } from \"levita-js\";\nimport { buildOptions, Levita, OPTION_KEYS } from \"levita-js\";\nimport {\n\tdefineComponent,\n\th,\n\tonMounted,\n\tonUnmounted,\n\ttype PropType,\n\tref,\n\ttype SlotsType,\n\twatch,\n} from \"vue\";\n\n/**\n * Vue 3 wrapper for the Levita 3D tilt effect.\n *\n * Accepts all `LevitaOptions` as props. The Levita instance is created\n * on mount and destroyed on unmount. Changing any tilt prop recreates\n * the instance.\n *\n * Exposes `element`, `instance`, and `requestPermission()` via template ref.\n *\n * @example\n * ```vue\n * <script setup>\n * import { Tilt } from '@levita-js/vue';\n * import '@levita-js/vue/style.css';\n * </script>\n *\n * <template>\n * <Tilt :glare=\"true\" :shadow=\"true\" :max=\"20\">\n * <h1>Hello</h1>\n * </Tilt>\n * </template>\n * ```\n */\nexport const Tilt = defineComponent({\n\tname: \"Tilt\",\n\n\tprops: {\n\t\tmax: { type: Number, default: undefined },\n\t\tperspective: { type: Number, default: undefined },\n\t\tscale: { type: Number, default: undefined },\n\t\tspeed: { type: Number, default: undefined },\n\t\teasing: { type: String, default: undefined },\n\t\treverse: { type: Boolean, default: undefined },\n\t\taxis: { type: String as PropType<Axis>, default: undefined },\n\t\treset: { type: Boolean, default: undefined },\n\t\tglare: { type: Boolean, default: undefined },\n\t\tmaxGlare: { type: Number, default: undefined },\n\t\tshadow: { type: Boolean, default: undefined },\n\t\tgyroscope: {\n\t\t\ttype: [String, Boolean] as PropType<GyroscopeMode>,\n\t\t\tdefault: undefined,\n\t\t},\n\t\tgyroRange: { type: Number, default: undefined },\n\t\tgyroSmoothing: { type: Number, default: undefined },\n\t\tdisabled: { type: Boolean, default: undefined },\n\t\teventsEl: { type: Object as PropType<HTMLElement | null>, default: undefined },\n\t},\n\n\tslots: Object as SlotsType<{ default: Record<string, never> }>,\n\n\tsetup(props, { slots, attrs, expose }) {\n\t\tconst elRef = ref<HTMLElement | null>(null);\n\t\tlet instance: Levita | null = null;\n\n\t\t/** Create a fresh Levita instance on the container element. */\n\t\tconst init = () => {\n\t\t\tif (!elRef.value) return;\n\t\t\tinstance?.destroy();\n\t\t\tinstance = new Levita(elRef.value, buildOptions(props));\n\t\t};\n\n\t\t/** Request accelerometer permission (must be called from a user gesture on iOS). */\n\t\tconst requestPermission = async (): Promise<boolean> => {\n\t\t\treturn (await instance?.requestPermission()) ?? false;\n\t\t};\n\n\t\texpose({\n\t\t\t/** The underlying DOM element. */\n\t\t\tget element() {\n\t\t\t\treturn elRef.value;\n\t\t\t},\n\t\t\t/** The Levita instance driving the tilt effect. */\n\t\t\tget instance() {\n\t\t\t\treturn instance;\n\t\t\t},\n\t\t\trequestPermission,\n\t\t});\n\n\t\tonMounted(init);\n\n\t\tonUnmounted(() => {\n\t\t\tinstance?.destroy();\n\t\t\tinstance = null;\n\t\t});\n\n\t\twatch(\n\t\t\t() => OPTION_KEYS.map((k) => props[k]),\n\t\t\t() => init(),\n\t\t);\n\n\t\treturn () => h(\"div\", { ...attrs, ref: elRef }, slots.default?.({}));\n\t},\n});\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;AAoCA,MAAa,OAAO,gBAAgB;CACnC,MAAM;CAEN,OAAO;EACN,KAAK;GAAE,MAAM;GAAQ,SAAS;GAAW;EACzC,aAAa;GAAE,MAAM;GAAQ,SAAS;GAAW;EACjD,OAAO;GAAE,MAAM;GAAQ,SAAS;GAAW;EAC3C,OAAO;GAAE,MAAM;GAAQ,SAAS;GAAW;EAC3C,QAAQ;GAAE,MAAM;GAAQ,SAAS;GAAW;EAC5C,SAAS;GAAE,MAAM;GAAS,SAAS;GAAW;EAC9C,MAAM;GAAE,MAAM;GAA0B,SAAS;GAAW;EAC5D,OAAO;GAAE,MAAM;GAAS,SAAS;GAAW;EAC5C,OAAO;GAAE,MAAM;GAAS,SAAS;GAAW;EAC5C,UAAU;GAAE,MAAM;GAAQ,SAAS;GAAW;EAC9C,QAAQ;GAAE,MAAM;GAAS,SAAS;GAAW;EAC7C,WAAW;GACV,MAAM,CAAC,QAAQ,QAAQ;GACvB,SAAS;GACT;EACD,WAAW;GAAE,MAAM;GAAQ,SAAS;GAAW;EAC/C,eAAe;GAAE,MAAM;GAAQ,SAAS;GAAW;EACnD,UAAU;GAAE,MAAM;GAAS,SAAS;GAAW;EAC/C,UAAU;GAAE,MAAM;GAAwC,SAAS;GAAW;EAC9E;CAED,OAAO;CAEP,MAAM,OAAO,EAAE,OAAO,OAAO,UAAU;EACtC,MAAM,QAAQ,IAAwB,KAAK;EAC3C,IAAI,WAA0B;;EAG9B,MAAM,aAAa;AAClB,OAAI,CAAC,MAAM,MAAO;AAClB,aAAU,SAAS;AACnB,cAAW,IAAI,OAAO,MAAM,OAAO,aAAa,MAAM,CAAC;;;EAIxD,MAAM,oBAAoB,YAA8B;AACvD,UAAQ,MAAM,UAAU,mBAAmB,IAAK;;AAGjD,SAAO;GAEN,IAAI,UAAU;AACb,WAAO,MAAM;;GAGd,IAAI,WAAW;AACd,WAAO;;GAER;GACA,CAAC;AAEF,YAAU,KAAK;AAEf,oBAAkB;AACjB,aAAU,SAAS;AACnB,cAAW;IACV;AAEF,cACO,YAAY,KAAK,MAAM,MAAM,GAAG,QAChC,MAAM,CACZ;AAED,eAAa,EAAE,OAAO;GAAE,GAAG;GAAO,KAAK;GAAO,EAAE,MAAM,UAAU,EAAE,CAAC,CAAC;;CAErE,CAAC"}
|
package/dist/style.css
ADDED
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
.levita {
|
|
2
|
+
--levita-x: 0deg;
|
|
3
|
+
--levita-y: 0deg;
|
|
4
|
+
--levita-scale: 1;
|
|
5
|
+
--levita-perspective: 1000px;
|
|
6
|
+
--levita-speed: 0ms;
|
|
7
|
+
--levita-easing: ease-out;
|
|
8
|
+
|
|
9
|
+
transform: perspective(var(--levita-perspective)) rotateX(var(--levita-x))
|
|
10
|
+
rotateY(var(--levita-y)) scale3d(var(--levita-scale), var(--levita-scale), var(--levita-scale));
|
|
11
|
+
transform-style: preserve-3d;
|
|
12
|
+
transition: transform var(--levita-speed) var(--levita-easing);
|
|
13
|
+
will-change: transform;
|
|
14
|
+
touch-action: pinch-zoom;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
/* Glare overlay */
|
|
18
|
+
.levita-glare {
|
|
19
|
+
position: absolute;
|
|
20
|
+
inset: 0;
|
|
21
|
+
overflow: hidden;
|
|
22
|
+
pointer-events: none;
|
|
23
|
+
border-radius: inherit;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
.levita-glare-inner {
|
|
27
|
+
--levita-glare-opacity: 0;
|
|
28
|
+
--levita-glare-x: 50%;
|
|
29
|
+
--levita-glare-y: 50%;
|
|
30
|
+
|
|
31
|
+
position: absolute;
|
|
32
|
+
inset: -50%;
|
|
33
|
+
background: radial-gradient(
|
|
34
|
+
circle at var(--levita-glare-x) var(--levita-glare-y),
|
|
35
|
+
rgba(255, 255, 255, var(--levita-glare-opacity)),
|
|
36
|
+
transparent 60%
|
|
37
|
+
);
|
|
38
|
+
transition: opacity var(--levita-speed) var(--levita-easing);
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
/* Dynamic shadow */
|
|
42
|
+
.levita-shadow {
|
|
43
|
+
--levita-shadow-x: 0px;
|
|
44
|
+
--levita-shadow-y: 0px;
|
|
45
|
+
|
|
46
|
+
filter: drop-shadow(var(--levita-shadow-x) var(--levita-shadow-y) 20px rgba(0, 0, 0, 0.2));
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
/* Layers */
|
|
50
|
+
[data-levita-offset] {
|
|
51
|
+
--levita-offset-x: calc(var(--levita-percent-x, 0) * var(--levita-offset, 0) * 0.15px);
|
|
52
|
+
--levita-offset-y: calc(var(--levita-percent-y, 0) * var(--levita-offset, 0) * 0.15px);
|
|
53
|
+
--levita-offset-z: calc(var(--levita-offset, 0) * 1px);
|
|
54
|
+
|
|
55
|
+
transform: translate3d(var(--levita-offset-x), var(--levita-offset-y), var(--levita-offset-z));
|
|
56
|
+
transition: transform var(--levita-speed) var(--levita-easing);
|
|
57
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@levita-js/vue",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.3.1",
|
|
4
4
|
"description": "Vue wrapper for Levita 3D tilt & parallax",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.cjs",
|
|
@@ -16,7 +16,8 @@
|
|
|
16
16
|
"types": "./dist/index.d.cts",
|
|
17
17
|
"default": "./dist/index.cjs"
|
|
18
18
|
}
|
|
19
|
-
}
|
|
19
|
+
},
|
|
20
|
+
"./style.css": "./dist/style.css"
|
|
20
21
|
},
|
|
21
22
|
"files": [
|
|
22
23
|
"dist"
|
|
@@ -25,12 +26,14 @@
|
|
|
25
26
|
"access": "public",
|
|
26
27
|
"provenance": true
|
|
27
28
|
},
|
|
28
|
-
"sideEffects":
|
|
29
|
+
"sideEffects": [
|
|
30
|
+
"*.css"
|
|
31
|
+
],
|
|
29
32
|
"peerDependencies": {
|
|
30
33
|
"vue": ">=3.3"
|
|
31
34
|
},
|
|
32
35
|
"dependencies": {
|
|
33
|
-
"levita-js": "0.
|
|
36
|
+
"levita-js": "0.3.1"
|
|
34
37
|
},
|
|
35
38
|
"devDependencies": {
|
|
36
39
|
"@vue/test-utils": "^2.4.6",
|
|
@@ -46,7 +49,7 @@
|
|
|
46
49
|
},
|
|
47
50
|
"homepage": "https://github.com/Jeromearsene/levita#readme",
|
|
48
51
|
"scripts": {
|
|
49
|
-
"build": "tsdown",
|
|
52
|
+
"build": "tsdown && cp ../core/src/style.css dist/style.css",
|
|
50
53
|
"type-check": "vue-tsc --noEmit"
|
|
51
54
|
}
|
|
52
55
|
}
|