hanc-webrtc-widgets 2.5.2 → 2.5.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,6 +1,6 @@
1
1
  import { LitElement } from 'lit';
2
2
  import { HancAiWidgetConfig, WidgetMode } from '../orb/components';
3
- type ColorPreset = 'indigo' | 'cyan' | 'emerald' | 'rose' | 'amber';
3
+ type ColorPreset = 'indigo' | 'cyan' | 'emerald' | 'rose' | 'amber' | 'white' | 'black' | 'orange';
4
4
  type ThemeMode = 'auto' | 'dark' | 'light';
5
5
  export declare class HancAiOrbElement extends LitElement {
6
6
  static styles: import('lit').CSSResult[];
@@ -1 +1 @@
1
- export declare const orbFragmentShader = "\nuniform float uTime;\nuniform float uAudioBass;\nuniform float uAudioMid;\nuniform float uAudioTreble;\nuniform float uAudioLevel;\nuniform vec3 uColorPrimary;\nuniform vec3 uColorSecondary;\nuniform vec3 uColorAccent;\nuniform vec3 uColorDepth;\nuniform vec3 uColorHighlight;\nuniform float uFresnelPower;\nuniform float uGlowIntensity;\nuniform float uColorContrast;\n\nvarying vec3 vNormal;\nvarying vec3 vPosition;\nvarying vec2 vUv;\nvarying float vDisplacement;\nvarying float vElevation;\n\n// Simplex noise for fragment effects\nvec3 mod289(vec3 x) {\n return x - floor(x * (1.0 / 289.0)) * 289.0;\n}\n\nvec4 mod289(vec4 x) {\n return x - floor(x * (1.0 / 289.0)) * 289.0;\n}\n\nvec4 permute(vec4 x) {\n return mod289(((x * 34.0) + 1.0) * x);\n}\n\nvec4 taylorInvSqrt(vec4 r) {\n return 1.79284291400159 - 0.85373472095314 * r;\n}\n\nfloat snoise(vec3 v) {\n const vec2 C = vec2(1.0 / 6.0, 1.0 / 3.0);\n const vec4 D = vec4(0.0, 0.5, 1.0, 2.0);\n\n vec3 i = floor(v + dot(v, C.yyy));\n vec3 x0 = v - i + dot(i, C.xxx);\n\n vec3 g = step(x0.yzx, x0.xyz);\n vec3 l = 1.0 - g;\n vec3 i1 = min(g.xyz, l.zxy);\n vec3 i2 = max(g.xyz, l.zxy);\n\n vec3 x1 = x0 - i1 + C.xxx;\n vec3 x2 = x0 - i2 + C.yyy;\n vec3 x3 = x0 - D.yyy;\n\n i = mod289(i);\n vec4 p = permute(permute(permute(\n i.z + vec4(0.0, i1.z, i2.z, 1.0))\n + i.y + vec4(0.0, i1.y, i2.y, 1.0))\n + i.x + vec4(0.0, i1.x, i2.x, 1.0));\n\n float n_ = 1.0 / 7.0;\n vec3 ns = n_ * D.wyz - D.xzx;\n\n vec4 j = p - 49.0 * floor(p * ns.z * ns.z);\n\n vec4 x_ = floor(j * ns.z);\n vec4 y_ = floor(j - 7.0 * x_);\n\n vec4 x = x_ * ns.x + ns.yyyy;\n vec4 y = y_ * ns.x + ns.yyyy;\n vec4 h = 1.0 - abs(x) - abs(y);\n\n vec4 b0 = vec4(x.xy, y.xy);\n vec4 b1 = vec4(x.zw, y.zw);\n\n vec4 s0 = floor(b0) * 2.0 + 1.0;\n vec4 s1 = floor(b1) * 2.0 + 1.0;\n vec4 sh = -step(h, vec4(0.0));\n\n vec4 a0 = b0.xzyw + s0.xzyw * sh.xxyy;\n vec4 a1 = b1.xzyw + s1.xzyw * sh.zzww;\n\n vec3 p0 = vec3(a0.xy, h.x);\n vec3 p1 = vec3(a0.zw, h.y);\n vec3 p2 = vec3(a1.xy, h.z);\n vec3 p3 = vec3(a1.zw, h.w);\n\n vec4 norm = taylorInvSqrt(vec4(dot(p0, p0), dot(p1, p1), dot(p2, p2), dot(p3, p3)));\n p0 *= norm.x;\n p1 *= norm.y;\n p2 *= norm.z;\n p3 *= norm.w;\n\n vec4 m = max(0.6 - vec4(dot(x0, x0), dot(x1, x1), dot(x2, x2), dot(x3, x3)), 0.0);\n m = m * m;\n return 42.0 * dot(m * m, vec4(dot(p0, x0), dot(p1, x1), dot(p2, x2), dot(p3, x3)));\n}\n\nvoid main() {\n // View direction for fresnel\n vec3 viewDirection = normalize(cameraPosition - vPosition);\n\n // Fresnel effect - edge glow\n float fresnel = pow(1.0 - max(dot(viewDirection, vNormal), 0.0), uFresnelPower);\n\n // Dynamic color mixing based on audio - using multiple noise layers for smoke effect\n float colorMix = snoise(vPosition * 2.0 + uTime * 0.5) * 0.5 + 0.5;\n colorMix += vDisplacement * 2.0;\n\n // Secondary noise layer for more complex smoke patterns\n float smokeLayer = snoise(vPosition * 1.2 - uTime * 0.3) * 0.5 + 0.5;\n colorMix = colorMix * 0.6 + smokeLayer * 0.4;\n\n // Apply contrast to make smoke patterns more visible\n colorMix = (colorMix - 0.5) * uColorContrast + 0.5;\n colorMix = clamp(colorMix, 0.0, 1.0);\n\n // Audio-reactive color shifts\n float audioInfluence = uAudioBass * 0.4 + uAudioMid * 0.35 + uAudioTreble * 0.25;\n\n // 4-color gradient for volumetric smoke effect:\n // depth (0.0) -> primary (0.33) -> secondary (0.66) -> highlight (1.0)\n vec3 gradientColor;\n if (colorMix < 0.33) {\n // Depth to Primary\n float t = colorMix / 0.33;\n gradientColor = mix(uColorDepth, uColorPrimary, t);\n } else if (colorMix < 0.66) {\n // Primary to Secondary\n float t = (colorMix - 0.33) / 0.33;\n gradientColor = mix(uColorPrimary, uColorSecondary, t);\n } else {\n // Secondary to Highlight\n float t = (colorMix - 0.66) / 0.34;\n gradientColor = mix(uColorSecondary, uColorHighlight, t);\n }\n\n // Add accent color based on audio peaks\n gradientColor = mix(gradientColor, uColorAccent, audioInfluence * 0.5);\n\n // Iridescent effect\n float iridescence = snoise(vPosition * 3.0 + uTime * 0.3) * 0.15;\n vec3 iridescentShift = vec3(\n sin(iridescence * 6.28 + 0.0) * 0.1,\n sin(iridescence * 6.28 + 2.09) * 0.1,\n sin(iridescence * 6.28 + 4.18) * 0.1\n );\n gradientColor += iridescentShift * (0.5 + audioInfluence);\n\n // Inner glow effect\n float innerGlow = pow(1.0 - fresnel, 3.0) * 0.3;\n vec3 glowColor = uColorAccent * innerGlow * (1.0 + uAudioLevel * 2.0);\n\n // Edge glow (fresnel)\n vec3 edgeGlow = mix(uColorSecondary, uColorAccent, audioInfluence) * fresnel * uGlowIntensity;\n\n // Pulsing highlights\n float pulse = sin(uTime * 2.0 + vPosition.y * 5.0) * 0.5 + 0.5;\n pulse *= uAudioMid;\n vec3 pulseHighlight = uColorAccent * pulse * 0.2;\n\n // Subsurface scattering simulation\n float sss = pow(max(dot(viewDirection, -vNormal), 0.0), 2.0) * 0.15;\n vec3 sssColor = uColorPrimary * sss * (1.0 + uAudioBass);\n\n // Combine all effects\n vec3 finalColor = gradientColor + edgeGlow + glowColor + pulseHighlight + sssColor;\n\n // Add depth variation\n float depthFade = smoothstep(-1.0, 1.0, vPosition.z);\n finalColor *= 0.8 + depthFade * 0.2;\n\n // Tone mapping and gamma correction\n finalColor = finalColor / (finalColor + vec3(1.0));\n finalColor = pow(finalColor, vec3(1.0 / 2.2));\n\n // Alpha based on fresnel for soft edges\n float alpha = 0.9 + fresnel * 0.1;\n\n gl_FragColor = vec4(finalColor, alpha);\n}\n";
1
+ export declare const orbFragmentShader = "\nuniform float uTime;\nuniform float uAudioBass;\nuniform float uAudioMid;\nuniform float uAudioTreble;\nuniform float uAudioLevel;\nuniform vec3 uColorPrimary;\nuniform vec3 uColorSecondary;\nuniform vec3 uColorAccent;\nuniform vec3 uColorDepth;\nuniform vec3 uColorHighlight;\nuniform float uFresnelPower;\nuniform float uGlowIntensity;\nuniform float uColorContrast;\n\nvarying vec3 vNormal;\nvarying vec3 vPosition;\nvarying vec2 vUv;\nvarying float vDisplacement;\nvarying float vElevation;\n\n// Simplex noise for fragment effects\nvec3 mod289(vec3 x) {\n return x - floor(x * (1.0 / 289.0)) * 289.0;\n}\n\nvec4 mod289(vec4 x) {\n return x - floor(x * (1.0 / 289.0)) * 289.0;\n}\n\nvec4 permute(vec4 x) {\n return mod289(((x * 34.0) + 1.0) * x);\n}\n\nvec4 taylorInvSqrt(vec4 r) {\n return 1.79284291400159 - 0.85373472095314 * r;\n}\n\nfloat snoise(vec3 v) {\n const vec2 C = vec2(1.0 / 6.0, 1.0 / 3.0);\n const vec4 D = vec4(0.0, 0.5, 1.0, 2.0);\n\n vec3 i = floor(v + dot(v, C.yyy));\n vec3 x0 = v - i + dot(i, C.xxx);\n\n vec3 g = step(x0.yzx, x0.xyz);\n vec3 l = 1.0 - g;\n vec3 i1 = min(g.xyz, l.zxy);\n vec3 i2 = max(g.xyz, l.zxy);\n\n vec3 x1 = x0 - i1 + C.xxx;\n vec3 x2 = x0 - i2 + C.yyy;\n vec3 x3 = x0 - D.yyy;\n\n i = mod289(i);\n vec4 p = permute(permute(permute(\n i.z + vec4(0.0, i1.z, i2.z, 1.0))\n + i.y + vec4(0.0, i1.y, i2.y, 1.0))\n + i.x + vec4(0.0, i1.x, i2.x, 1.0));\n\n float n_ = 1.0 / 7.0;\n vec3 ns = n_ * D.wyz - D.xzx;\n\n vec4 j = p - 49.0 * floor(p * ns.z * ns.z);\n\n vec4 x_ = floor(j * ns.z);\n vec4 y_ = floor(j - 7.0 * x_);\n\n vec4 x = x_ * ns.x + ns.yyyy;\n vec4 y = y_ * ns.x + ns.yyyy;\n vec4 h = 1.0 - abs(x) - abs(y);\n\n vec4 b0 = vec4(x.xy, y.xy);\n vec4 b1 = vec4(x.zw, y.zw);\n\n vec4 s0 = floor(b0) * 2.0 + 1.0;\n vec4 s1 = floor(b1) * 2.0 + 1.0;\n vec4 sh = -step(h, vec4(0.0));\n\n vec4 a0 = b0.xzyw + s0.xzyw * sh.xxyy;\n vec4 a1 = b1.xzyw + s1.xzyw * sh.zzww;\n\n vec3 p0 = vec3(a0.xy, h.x);\n vec3 p1 = vec3(a0.zw, h.y);\n vec3 p2 = vec3(a1.xy, h.z);\n vec3 p3 = vec3(a1.zw, h.w);\n\n vec4 norm = taylorInvSqrt(vec4(dot(p0, p0), dot(p1, p1), dot(p2, p2), dot(p3, p3)));\n p0 *= norm.x;\n p1 *= norm.y;\n p2 *= norm.z;\n p3 *= norm.w;\n\n vec4 m = max(0.6 - vec4(dot(x0, x0), dot(x1, x1), dot(x2, x2), dot(x3, x3)), 0.0);\n m = m * m;\n return 42.0 * dot(m * m, vec4(dot(p0, x0), dot(p1, x1), dot(p2, x2), dot(p3, x3)));\n}\n\n// 3-octave fBM for organic plasma\nfloat fbm(vec3 p) {\n float v = 0.0, a = 0.5;\n v += a * snoise(p); a *= 0.5; p *= 2.0;\n v += a * snoise(p); a *= 0.5; p *= 2.0;\n v += a * snoise(p);\n return v;\n}\n\nvoid main() {\n vec3 viewDirection = normalize(cameraPosition - vPosition);\n float fresnel = pow(1.0 - max(dot(viewDirection, vNormal), 0.0), uFresnelPower);\n float audioInfluence = uAudioBass * 0.4 + uAudioMid * 0.35 + uAudioTreble * 0.25;\n\n // === DEEP PLASMA \u2014 domain-warped fBM ===\n vec3 warpedPos = vPosition + vec3(\n snoise(vPosition * 1.5 + uTime * 0.15),\n snoise(vPosition * 1.5 + vec3(5.2, 1.3, 2.8) + uTime * 0.12),\n snoise(vPosition * 1.5 + vec3(1.7, 9.2, 4.1) + uTime * 0.1)\n ) * 0.75;\n\n // Original spot size frequencies with fBM depth\n float colorMix = fbm(warpedPos * 2.0 + uTime * 0.5) * 0.5 + 0.5;\n colorMix += vDisplacement * 2.0;\n\n float smokeLayer = snoise(warpedPos * 1.2 - uTime * 0.3) * 0.5 + 0.5;\n colorMix = colorMix * 0.6 + smokeLayer * 0.4;\n\n // Deep slow layer for volumetric depth\n float deepLayer = snoise(vPosition * 0.7 + uTime * 0.08) * 0.5 + 0.5;\n colorMix = colorMix * 0.8 + deepLayer * 0.2;\n\n colorMix = (colorMix - 0.5) * (uColorContrast * 1.5) + 0.5;\n colorMix = clamp(colorMix, 0.0, 1.0);\n\n // 4-color gradient for volumetric smoke effect:\n // depth (0.0) -> primary (0.33) -> secondary (0.66) -> highlight (1.0)\n vec3 gradientColor;\n if (colorMix < 0.33) {\n // Depth to Primary\n float t = colorMix / 0.33;\n gradientColor = mix(uColorDepth, uColorPrimary, t);\n } else if (colorMix < 0.66) {\n // Primary to Secondary\n float t = (colorMix - 0.33) / 0.33;\n gradientColor = mix(uColorPrimary, uColorSecondary, t);\n } else {\n // Secondary to Highlight\n float t = (colorMix - 0.66) / 0.34;\n gradientColor = mix(uColorSecondary, uColorHighlight, t);\n }\n\n // Add accent color based on audio peaks\n gradientColor = mix(gradientColor, uColorAccent, audioInfluence * 0.5);\n\n // Iridescent effect (scaled by brightness to avoid color artifacts on dark themes)\n float iridescence = snoise(vPosition * 3.0 + uTime * 0.3) * 0.15;\n vec3 iridescentShift = vec3(\n sin(iridescence * 6.28 + 0.0) * 0.1,\n sin(iridescence * 6.28 + 2.09) * 0.1,\n sin(iridescence * 6.28 + 4.18) * 0.1\n );\n float baseBrightness = dot(gradientColor, vec3(0.299, 0.587, 0.114));\n gradientColor += iridescentShift * (0.5 + audioInfluence) * clamp(baseBrightness * 3.0, 0.0, 1.0);\n\n // Inner glow \u2014 core radiates like a sun\n float innerGlow = pow(1.0 - fresnel, 2.5) * 0.5;\n vec3 glowColor = mix(uColorAccent, uColorHighlight, 0.3) * innerGlow * (1.0 + uAudioLevel * 2.5);\n\n // Edge glow (fresnel)\n vec3 edgeGlow = mix(uColorSecondary, uColorAccent, audioInfluence) * fresnel * uGlowIntensity;\n\n // Pulsing highlights\n float pulse = sin(uTime * 2.0 + vPosition.y * 5.0) * 0.5 + 0.5;\n pulse *= uAudioMid;\n vec3 pulseHighlight = uColorAccent * pulse * 0.2;\n\n // Subsurface scattering \u2014 light bleeding through from inside\n float sss = pow(max(dot(viewDirection, -vNormal), 0.0), 1.5) * 0.25;\n vec3 sssColor = mix(uColorPrimary, uColorHighlight, 0.4) * sss * (1.0 + uAudioBass * 1.5);\n\n // Combine all effects\n vec3 finalColor = gradientColor + edgeGlow + glowColor + pulseHighlight + sssColor;\n\n // Add depth variation\n float depthFade = smoothstep(-1.0, 1.0, vPosition.z);\n finalColor *= 0.8 + depthFade * 0.2;\n\n // Tone mapping and gamma correction\n finalColor = finalColor / (finalColor + vec3(1.0));\n finalColor = pow(finalColor, vec3(1.0 / 2.2));\n\n // Alpha based on fresnel for soft edges\n float alpha = 0.9 + fresnel * 0.1;\n\n gl_FragColor = vec4(finalColor, alpha);\n}\n";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "hanc-webrtc-widgets",
3
- "version": "2.5.2",
3
+ "version": "2.5.3",
4
4
  "type": "module",
5
5
  "main": "dist/hanc-webrtc-widgets.umd.js",
6
6
  "module": "dist/hanc-webrtc-widgets.es.js",