sigma-ui 1.0.19 → 1.1.0

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.
@@ -420,7 +420,8 @@
420
420
  "dependencies": [],
421
421
  "registryDependencies": [],
422
422
  "files": [
423
- "infusion/Infusion.vue"
423
+ "infusion/Infusion.vue",
424
+ "infusion/index.ts"
424
425
  ],
425
426
  "type": "components:ui"
426
427
  },
@@ -5,7 +5,11 @@
5
5
  "files": [
6
6
  {
7
7
  "name": "Infusion.vue",
8
- "content": "<script setup lang=\"ts\">\ninterface Props {\n src: string;\n}\n\nconst props = withDefaults(defineProps<Props>(), {\n src: '',\n});\n</script>\n\n<template>\n <img\n class=\"fixed z-[100] top-0 left-0 w-[100vw] h-[100vh] opacity-20 dark:opacity-30 pointer-events-none object-cover\"\n :src=\"props.src\"\n >\n</template>\n"
8
+ "content": "<script setup lang=\"ts\">\nimport { computed, type CSSProperties } from 'vue';\n\ninterface Props {\n src: string;\n opacity?: number;\n opacityDark?: number;\n zIndex?: number;\n blur?: number;\n noiseIntensity?: number;\n noiseScale?: number;\n noiseOpacity?: number;\n blendMode?: CSSProperties['mixBlendMode'];\n relative?: boolean;\n type?: 'image' | 'video';\n}\n\nconst props = withDefaults(defineProps<Props>(), {\n src: '',\n opacity: 0.2,\n opacityDark: 0.3,\n zIndex: 100,\n blur: 64,\n noiseIntensity: 0.5,\n noiseScale: 1,\n noiseOpacity: 0.05,\n blendMode: 'normal',\n relative: false,\n type: 'image',\n});\n\nconst imageStyle = computed(() => ({\n '--infusion-opacity': props.opacity,\n '--infusion-opacity-dark': props.opacityDark,\n '--infusion-z-index': props.zIndex,\n '--infusion-blur': `${props.blur}px`,\n '--infusion-noise-intensity': props.noiseIntensity,\n '--infusion-noise-scale': props.noiseScale,\n '--infusion-noise-opacity': props.noiseOpacity,\n 'mixBlendMode': props.blendMode,\n}));\n\nconst noiseDataUrl = computed(() => {\n if (props.noiseIntensity === 0) {\n return '';\n }\n\n const canvas = document.createElement('canvas');\n canvas.width = 256;\n canvas.height = 256;\n const context = canvas.getContext('2d');\n\n if (!context) {\n return '';\n }\n\n const imageData = context.createImageData(canvas.width, canvas.height);\n const data = imageData.data;\n\n for (let index = 0; index < data.length; index += 4) {\n const value = Math.random() * 255;\n data[index] = value;\n data[index + 1] = value;\n data[index + 2] = value;\n data[index + 3] = props.noiseIntensity * 255;\n }\n\n context.putImageData(imageData, 0, 0);\n return canvas.toDataURL();\n});\n\nconst containerClass = computed(() => [\n 'infusion-container',\n {\n 'infusion-container--relative': props.relative,\n },\n]);\n</script>\n\n<template>\n <div\n :class=\"containerClass\"\n :style=\"imageStyle\"\n >\n <img\n v-if=\"props.type === 'image'\"\n class=\"infusion-image\"\n :src=\"props.src\"\n alt=\"\"\n >\n <video\n v-if=\"props.type === 'video'\"\n class=\"infusion-video\"\n :src=\"props.src\"\n autoplay\n loop\n muted\n playsinline\n alt=\"\"\n />\n <div\n v-if=\"noiseIntensity > 0\"\n class=\"infusion-noise\"\n :style=\"{ backgroundImage: `url(${noiseDataUrl})` }\"\n />\n </div>\n</template>\n\n<style scoped>\n.infusion-container {\n position: fixed;\n z-index: var(--infusion-z-index);\n top: 0;\n left: 0;\n overflow: hidden;\n width: 100vw;\n height: 100vh;\n pointer-events: none;\n}\n\n.infusion-container--relative {\n position: absolute;\n z-index: var(--infusion-z-index);\n top: 0;\n left: 0;\n width: 100%;\n height: 100%;\n}\n\n.infusion-image {\n width: 100%;\n height: 100%;\n filter: blur(var(--infusion-blur));\n object-fit: cover;\n opacity: var(--infusion-opacity);\n transform: scale(1.1)\n}\n\n.dark .infusion-image {\n opacity: var(--infusion-opacity-dark);\n}\n\n.infusion-video {\n width: 100%;\n height: 100%;\n filter: blur(var(--infusion-blur));\n object-fit: cover;\n opacity: var(--infusion-opacity);\n transform: scale(1.1)\n}\n\n.dark .infusion-video {\n opacity: var(--infusion-opacity-dark);\n}\n\n.infusion-noise {\n position: absolute;\n top: 0;\n left: 0;\n width: 100%;\n height: 100%;\n background-repeat: repeat;\n background-size: calc(256px * var(--infusion-noise-scale));\n mix-blend-mode: overlay;\n opacity: var(--infusion-noise-opacity);\n}\n</style>\n"
9
+ },
10
+ {
11
+ "name": "index.ts",
12
+ "content": "export { default as Infusion } from './Infusion.vue';\n"
9
13
  }
10
14
  ],
11
15
  "type": "components:ui"
@@ -5,7 +5,11 @@
5
5
  "files": [
6
6
  {
7
7
  "name": "Infusion.vue",
8
- "content": "<script setup lang=\"ts\">\ninterface Props {\n src: string;\n}\n\nconst props = withDefaults(defineProps<Props>(), {\n src: '',\n});\n</script>\n\n<template>\n <img\n class=\"fixed z-[100] top-0 left-0 w-[100vw] h-[100vh] opacity-20 dark:opacity-30 pointer-events-none object-cover\"\n :src=\"props.src\"\n >\n</template>\n"
8
+ "content": "<script setup lang=\"ts\">\nimport { computed, type CSSProperties } from 'vue';\n\ninterface Props {\n src: string;\n opacity?: number;\n opacityDark?: number;\n zIndex?: number;\n blur?: number;\n noiseIntensity?: number;\n noiseScale?: number;\n noiseOpacity?: number;\n blendMode?: CSSProperties['mixBlendMode'];\n relative?: boolean;\n type?: 'image' | 'video';\n}\n\nconst props = withDefaults(defineProps<Props>(), {\n src: '',\n opacity: 0.2,\n opacityDark: 0.3,\n zIndex: 100,\n blur: 64,\n noiseIntensity: 0.5,\n noiseScale: 1,\n noiseOpacity: 0.05,\n blendMode: 'normal',\n relative: false,\n type: 'image',\n});\n\nconst imageStyle = computed(() => ({\n '--infusion-opacity': props.opacity,\n '--infusion-opacity-dark': props.opacityDark,\n '--infusion-z-index': props.zIndex,\n '--infusion-blur': `${props.blur}px`,\n '--infusion-noise-intensity': props.noiseIntensity,\n '--infusion-noise-scale': props.noiseScale,\n '--infusion-noise-opacity': props.noiseOpacity,\n 'mixBlendMode': props.blendMode,\n}));\n\nconst noiseDataUrl = computed(() => {\n if (props.noiseIntensity === 0) {\n return '';\n }\n\n const canvas = document.createElement('canvas');\n canvas.width = 256;\n canvas.height = 256;\n const context = canvas.getContext('2d');\n\n if (!context) {\n return '';\n }\n\n const imageData = context.createImageData(canvas.width, canvas.height);\n const data = imageData.data;\n\n for (let index = 0; index < data.length; index += 4) {\n const value = Math.random() * 255;\n data[index] = value;\n data[index + 1] = value;\n data[index + 2] = value;\n data[index + 3] = props.noiseIntensity * 255;\n }\n\n context.putImageData(imageData, 0, 0);\n return canvas.toDataURL();\n});\n\nconst containerClass = computed(() => [\n 'top-0 left-0 overflow-hidden pointer-events-none z-(--infusion-z-index)',\n props.relative\n ? 'absolute w-full h-full'\n : 'fixed w-screen h-screen',\n]);\n\nconst mediaClass = 'w-full h-full object-cover scale-110 opacity-(--infusion-opacity) dark:opacity-(--infusion-opacity-dark)';\nconst noiseClass = 'absolute top-0 left-0 w-full h-full bg-repeat mix-blend-overlay';\n</script>\n\n<template>\n <div\n :class=\"containerClass\"\n :style=\"imageStyle\"\n >\n <img\n v-if=\"props.type === 'image'\"\n :class=\"mediaClass\"\n :src=\"props.src\"\n :style=\"{\n filter: `blur(var(--infusion-blur))`,\n }\"\n alt=\"\"\n >\n <video\n v-if=\"props.type === 'video'\"\n :class=\"mediaClass\"\n :src=\"props.src\"\n :style=\"{\n filter: `blur(var(--infusion-blur))`,\n }\"\n autoplay\n loop\n muted\n playsinline\n alt=\"\"\n />\n <div\n v-if=\"noiseIntensity > 0\"\n :class=\"noiseClass\"\n :style=\"{\n backgroundImage: `url(${noiseDataUrl})`,\n backgroundSize: 'calc(256px * var(--infusion-noise-scale))',\n opacity: 'var(--infusion-noise-opacity)',\n }\"\n />\n </div>\n</template>\n"
9
+ },
10
+ {
11
+ "name": "index.ts",
12
+ "content": "export { default as Infusion } from './Infusion.vue';\n"
9
13
  }
10
14
  ],
11
15
  "type": "components:ui"
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "sigma-ui",
3
3
  "type": "module",
4
- "version": "1.0.19",
4
+ "version": "1.1.0",
5
5
  "description": "CLI for SIGMA-UI components.",
6
6
  "publishConfig": {
7
7
  "access": "public"