@minicode-dev/chat 0.1.4 → 0.1.5

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.
@@ -0,0 +1 @@
1
+ {"version":3,"file":"thunderScene3d-FMMuwJRP.js","names":["boltFlicker","ARCS","ARC_POINTS","rand","min","max","softDot","canvas","size","ctx","gradient","CanvasTexture","jagged","points","from","to","pass","passes","next","i","a","b","length","mid","spread","tube","path","CurvePath","LineCurve3","Mesh","TubeGeometry","radius","material","createBolt","group","Group","core","MeshBasicMaterial","AdditiveBlending","glow","width","power","add","scale","main","branches","start","Vector3","disposeObject","child","boltEmblem","shape","Shape","x","y","index","geometry","ExtrudeGeometry","MeshStandardMaterial","isLowPower","createThunderScene","lowPower","SPARKS","CLOUDS","renderer","WebGLRenderer","scene","Scene","camera","PerspectiveCamera","flash","PointLight","glowLight","AmbientLight","dot","cloudPositions","cloudGeometry","BufferGeometry","BufferAttribute","cloudBase","Color","cloudLit","cloudMaterial","PointsMaterial","clouds","Points","emblem","shellMaterial","shell","IcosahedronGeometry","arcMaterial","LineBasicMaterial","arcs","Line","sparkPositions","sparkColors","velocity","life","maxLife","sparkGeometry","sparks","bolts","cursor","time","flashLevel","shake","punch","arcTimer","emit","n","count","origin","speed","addBolt","bolt","redrawArcs","end","positions","arc","point","jitter","hitCore","reducedMotion","dt","intro","overshoot","opacity","p","drag","t","height"],"sources":["../../src/effects/thunder/thunderScene3d.js"],"sourcesContent":["// Three.js storm for the Zumbido effect. Loaded lazily; `three` is an optional peer, so\n// ThunderEffect falls back to the 2D canvas scene when this module or WebGL is unavailable.\nimport {\n AdditiveBlending, AmbientLight, BufferAttribute, BufferGeometry, CanvasTexture, Color, CurvePath, ExtrudeGeometry,\n Group, IcosahedronGeometry, Line, LineBasicMaterial, LineCurve3, Mesh, MeshBasicMaterial, MeshStandardMaterial,\n PerspectiveCamera, PointLight, Points, PointsMaterial, Scene, Shape, TubeGeometry, Vector3, WebGLRenderer,\n} from 'three';\nimport { BOLT_LIFE_S, boltFlicker } from './timeline.js';\n\nconst ARCS = 3;\nconst ARC_POINTS = 14;\nconst rand = (min, max) => min + Math.random() * (max - min);\n\nfunction softDot(size = 64) {\n const canvas = document.createElement('canvas');\n canvas.width = size;\n canvas.height = size;\n const ctx = canvas.getContext('2d');\n const gradient = ctx.createRadialGradient(size / 2, size / 2, 0, size / 2, size / 2, size / 2);\n gradient.addColorStop(0, 'rgba(255,255,255,1)');\n gradient.addColorStop(0.4, 'rgba(255,255,255,.5)');\n gradient.addColorStop(1, 'rgba(255,255,255,0)');\n ctx.fillStyle = gradient;\n ctx.fillRect(0, 0, size, size);\n return new CanvasTexture(canvas);\n}\n\n// Midpoint displacement: every pass splits each segment and pushes its midpoint sideways.\nfunction jagged(from, to, passes, spread) {\n let points = [from, to];\n for (let pass = 0; pass < passes; pass += 1) {\n const next = [points[0]];\n for (let i = 1; i < points.length; i += 1) {\n const a = points[i - 1];\n const b = points[i];\n const length = a.distanceTo(b);\n const mid = a.clone().lerp(b, 0.5);\n mid.x += rand(-0.5, 0.5) * length * spread;\n mid.y += rand(-0.5, 0.5) * length * spread * 0.2;\n mid.z += rand(-0.5, 0.5) * length * spread * 0.6;\n next.push(mid, b);\n }\n points = next;\n }\n return points;\n}\n\nfunction tube(points, radius, material) {\n const path = new CurvePath();\n for (let i = 1; i < points.length; i += 1) path.add(new LineCurve3(points[i - 1], points[i]));\n return new Mesh(new TubeGeometry(path, points.length * 2, radius, 5, false), material);\n}\n\nfunction createBolt(from, to, power) {\n const group = new Group();\n const core = new MeshBasicMaterial({ color: 0xffffff, transparent: true, blending: AdditiveBlending, depthWrite: false });\n const glow = new MeshBasicMaterial({ color: 0x7fa8ff, transparent: true, opacity: 0.4, blending: AdditiveBlending, depthWrite: false });\n const width = 0.6 + power;\n const add = (points, scale) => {\n group.add(tube(points, 0.03 * scale * width, core));\n group.add(tube(points, 0.16 * scale * width, glow));\n };\n const main = jagged(from, to, 6, 0.45);\n add(main, 1);\n const branches = 2 + Math.round(power * 3);\n for (let i = 0; i < branches; i += 1) {\n const start = main[Math.floor(rand(0.15, 0.7) * main.length)];\n const end = start.clone().add(new Vector3(rand(-1.8, 1.8), rand(-2.2, -0.8), rand(-0.6, 0.6)));\n add(jagged(start, end, 4, 0.5), 0.45);\n }\n return { group, core, glow, age: 0 };\n}\n\nfunction disposeObject(object) {\n object.traverse((child) => {\n child.geometry?.dispose();\n if (child.material) [].concat(child.material).forEach((material) => material.dispose());\n });\n}\n\nfunction boltEmblem() {\n const shape = new Shape();\n [[0.15, 1.6], [-0.7, -0.1], [-0.05, -0.1], [-0.3, -1.6], [0.75, 0.25], [0.1, 0.25], [0.55, 1.6]]\n .forEach(([x, y], index) => (index ? shape.lineTo(x, y) : shape.moveTo(x, y)));\n const geometry = new ExtrudeGeometry(shape, { depth: 0.32, bevelEnabled: true, bevelThickness: 0.08, bevelSize: 0.06, bevelSegments: 3 });\n geometry.center();\n const material = new MeshStandardMaterial({ color: 0xffd23f, emissive: 0xff8a00, emissiveIntensity: 0.5, metalness: 0.35, roughness: 0.3 });\n return new Mesh(geometry, material);\n}\n\n// Phones and low-core devices get fewer particles, no MSAA and a lower pixel ratio.\nconst isLowPower = () => (typeof matchMedia === 'function' && matchMedia('(pointer: coarse)').matches)\n || (navigator.hardwareConcurrency || 8) <= 4;\n\nexport function createThunderScene(canvas, { reducedMotion = false } = {}) {\n const lowPower = isLowPower();\n const SPARKS = lowPower ? 360 : 700;\n const CLOUDS = lowPower ? 50 : 90;\n const renderer = new WebGLRenderer({ canvas, alpha: true, antialias: !lowPower, powerPreference: 'high-performance' });\n renderer.setPixelRatio(Math.min(lowPower ? 1.5 : 2, window.devicePixelRatio || 1));\n renderer.setClearColor(0x000000, 0);\n const scene = new Scene();\n const camera = new PerspectiveCamera(50, 1, 0.1, 60);\n camera.position.set(0, 0.3, 7.5);\n\n const flash = new PointLight(0xcfe0ff, 0, 30, 1.6);\n flash.position.set(0, 4, 2);\n const glowLight = new PointLight(0xffb52e, 1.2, 8, 2);\n glowLight.position.set(0, 0.5, 1.6);\n scene.add(new AmbientLight(0x6a78c8, 0.35), flash, glowLight);\n\n const dot = softDot();\n const cloudPositions = new Float32Array(CLOUDS * 3);\n for (let i = 0; i < CLOUDS; i += 1) cloudPositions.set([rand(-9, 9), rand(2.6, 4.6), rand(-7, -1.5)], i * 3);\n const cloudGeometry = new BufferGeometry();\n cloudGeometry.setAttribute('position', new BufferAttribute(cloudPositions, 3));\n const cloudBase = new Color(0x262c4a);\n const cloudLit = new Color(0xb9c8ff);\n const cloudMaterial = new PointsMaterial({ size: 5.5, map: dot, color: cloudBase.clone(), transparent: true, opacity: 0.9, depthWrite: false });\n const clouds = new Points(cloudGeometry, cloudMaterial);\n scene.add(clouds);\n\n const emblem = boltEmblem();\n const shellMaterial = new MeshBasicMaterial({ color: 0x6fd3ff, wireframe: true, transparent: true, opacity: 0.15, blending: AdditiveBlending, depthWrite: false });\n const shell = new Mesh(new IcosahedronGeometry(1.75, 1), shellMaterial);\n const arcMaterial = new LineBasicMaterial({ color: 0x9fdcff, transparent: true, opacity: 0.5, blending: AdditiveBlending, depthWrite: false });\n const arcs = Array.from({ length: ARCS }, () => {\n const geometry = new BufferGeometry();\n geometry.setAttribute('position', new BufferAttribute(new Float32Array(ARC_POINTS * 3), 3));\n return new Line(geometry, arcMaterial);\n });\n const core = new Group();\n core.add(emblem, shell, ...arcs);\n scene.add(core);\n\n const sparkPositions = new Float32Array(SPARKS * 3);\n const sparkColors = new Float32Array(SPARKS * 3);\n const velocity = new Float32Array(SPARKS * 3);\n const life = new Float32Array(SPARKS);\n const maxLife = new Float32Array(SPARKS).fill(1);\n const sparkGeometry = new BufferGeometry();\n sparkGeometry.setAttribute('position', new BufferAttribute(sparkPositions, 3));\n sparkGeometry.setAttribute('color', new BufferAttribute(sparkColors, 3));\n const sparks = new Points(sparkGeometry, new PointsMaterial({ size: lowPower ? 0.14 : 0.12, map: dot, vertexColors: true, transparent: true, blending: AdditiveBlending, depthWrite: false }));\n sparks.frustumCulled = false;\n scene.add(sparks);\n\n const bolts = [];\n let cursor = 0;\n let time = 0;\n let flashLevel = 0;\n let shake = 0;\n let punch = 0;\n let arcTimer = 0;\n\n const emit = (origin, count, speed) => {\n for (let n = 0; n < count; n += 1) {\n const i = cursor;\n cursor = (cursor + 1) % SPARKS;\n sparkPositions.set([origin.x + rand(-0.1, 0.1), origin.y + rand(-0.1, 0.1), origin.z + rand(-0.1, 0.1)], i * 3);\n velocity.set([rand(-1, 1) * speed, rand(0.2, 1.4) * speed, rand(-1, 1) * speed * 0.6], i * 3);\n maxLife[i] = rand(0.5, 1.3);\n life[i] = maxLife[i];\n }\n };\n\n const addBolt = (from, to, power) => {\n const bolt = createBolt(from, to, power);\n bolts.push(bolt);\n scene.add(bolt.group);\n };\n\n const redrawArcs = () => {\n arcs.forEach((arc) => {\n const start = new Vector3(rand(-1, 1), rand(-1, 1), rand(-1, 1)).setLength(1.2);\n const end = start.clone().add(new Vector3(rand(-1, 1), rand(-1, 1), rand(-1, 1)).setLength(rand(0.5, 1.1)));\n const positions = arc.geometry.attributes.position;\n for (let i = 0; i < ARC_POINTS; i += 1) {\n const point = start.clone().lerp(end, i / (ARC_POINTS - 1));\n const jitter = i === 0 || i === ARC_POINTS - 1 ? 0 : 0.12;\n positions.setXYZ(i, point.x + rand(-jitter, jitter), point.y + rand(-jitter, jitter), point.z + rand(-jitter, jitter));\n }\n positions.needsUpdate = true;\n });\n };\n\n return {\n strike(power = 1, x = 0) {\n const from = new Vector3(x * 4 + rand(-0.6, 0.6), 4.6, rand(-2.5, -0.5));\n const hitCore = power >= 0.9;\n const to = hitCore\n ? new Vector3(core.position.x + rand(-0.2, 0.2), core.position.y + 1.3, 0.2)\n : new Vector3(x * 4.5 + rand(-1.2, 1.2), -3.4, rand(-1.5, 0.5));\n addBolt(from, to, power);\n if (power > 0.7) addBolt(new Vector3(-from.x * 0.6 + rand(-1, 1), 4.6, rand(-3, -1)), new Vector3(rand(-5, 5), -3.4, rand(-2, 0)), power * 0.5);\n emit(to, Math.round((lowPower ? 90 : 160) * power), 3.5 + power * 2.5);\n flash.position.x = from.x;\n flashLevel = Math.max(flashLevel, power);\n if (!reducedMotion) shake = Math.max(shake, power);\n if (hitCore) punch = 1;\n },\n render(dt) {\n time += dt;\n flashLevel = Math.max(0, flashLevel - dt * 3.2);\n shake = Math.max(0, shake - dt * 2.2);\n punch = Math.max(0, punch - dt * 2.5);\n\n flash.intensity = flashLevel * 9;\n glowLight.intensity = 1.2 + flashLevel * 3;\n cloudMaterial.color.copy(cloudBase).lerp(cloudLit, Math.min(1, flashLevel * 1.1));\n clouds.position.x = Math.sin(time * 0.1) * 0.4;\n\n // Grows in over 0.6 s with a slight overshoot, then bobs and recoils on direct hits.\n const intro = Math.min(1, time / 0.6);\n const overshoot = 1 + 1.7 * (intro - 1) ** 3 + 0.7 * (intro - 1) ** 2;\n core.scale.setScalar(Math.max(0.001, overshoot * (1 + punch * punch * 0.22)));\n core.position.y = 0.2 + Math.sin(time * 1.6) * 0.12;\n emblem.rotation.y = time * 0.9;\n emblem.material.emissiveIntensity = 0.5 + flashLevel * 2.5;\n shell.rotation.set(time * 0.3, time * 0.45, 0);\n shellMaterial.opacity = 0.12 + flashLevel * 0.5;\n arcMaterial.opacity = 0.35 + flashLevel * 0.65;\n\n arcTimer -= dt;\n if (arcTimer <= 0) { redrawArcs(); arcTimer = 0.06; }\n if (Math.random() < dt * 6) emit(core.position.clone().add(new Vector3(rand(-0.6, 0.6), rand(-1, 1), 0.3)), 4, 1.5);\n\n camera.position.x = (Math.random() - 0.5) * shake * 0.35;\n camera.position.y = 0.3 + (Math.random() - 0.5) * shake * 0.25;\n camera.lookAt(0, 0.4, 0);\n\n for (let i = bolts.length - 1; i >= 0; i -= 1) {\n const bolt = bolts[i];\n bolt.age += dt;\n if (bolt.age >= BOLT_LIFE_S) {\n scene.remove(bolt.group);\n disposeObject(bolt.group);\n bolts.splice(i, 1);\n continue;\n }\n const opacity = boltFlicker(bolt.age);\n bolt.core.opacity = opacity;\n bolt.glow.opacity = 0.4 * opacity;\n }\n\n for (let i = 0; i < SPARKS; i += 1) {\n const p = i * 3;\n if (life[i] <= 0) { sparkColors[p] = 0; sparkColors[p + 1] = 0; sparkColors[p + 2] = 0; continue; }\n life[i] -= dt;\n velocity[p + 1] -= 7 * dt;\n const drag = 1 - 1.5 * dt;\n velocity[p] *= drag; velocity[p + 1] *= drag; velocity[p + 2] *= drag;\n sparkPositions[p] += velocity[p] * dt;\n sparkPositions[p + 1] += velocity[p + 1] * dt;\n sparkPositions[p + 2] += velocity[p + 2] * dt;\n // White-hot at birth, cooling through gold to dim blue.\n const t = Math.max(0, life[i] / maxLife[i]);\n sparkColors[p] = t;\n sparkColors[p + 1] = (0.55 + 0.45 * t) * t;\n sparkColors[p + 2] = (0.35 + 0.65 * t) * t;\n }\n sparkGeometry.attributes.position.needsUpdate = true;\n sparkGeometry.attributes.color.needsUpdate = true;\n\n renderer.render(scene, camera);\n },\n resize(width, height) {\n renderer.setSize(width, height, false);\n camera.aspect = width / height;\n // Portrait chat windows widen the lens so the storm and emblem still fit.\n camera.fov = camera.aspect < 1 ? Math.min(85, (50 / Math.max(camera.aspect, 0.55)) * 0.8) : 50;\n camera.updateProjectionMatrix();\n },\n dispose() {\n bolts.length = 0;\n disposeObject(scene);\n dot.dispose();\n renderer.dispose();\n renderer.forceContextLoss?.();\n },\n };\n}\n"],"mappings":";;;AASA,IAAMC,KAAO,GACPC,KAAa,IACbC,KAAQ,GAAK,MAAQC,IAAM,KAAK,OAAO,KAAKC,IAAMD;AAExD,SAASE,GAAQ,IAAO,IAAI;CAC1B,IAAMC,IAAS,SAAS,cAAc,QAAQ;CAE9C,AADA,EAAO,QAAQC,GACf,EAAO,SAASA;CAChB,IAAMC,IAAMF,EAAO,WAAW,IAAI,GAC5BG,IAAWD,EAAI,qBAAqBD,IAAO,GAAGA,IAAO,GAAG,GAAGA,IAAO,GAAGA,IAAO,GAAGA,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
@@ -0,0 +1,45 @@
1
+ // src/effects/thunder/timeline.js
2
+ var e = 7e3, t = Object.freeze([
3
+ {
4
+ at: 550,
5
+ power: .9,
6
+ x: 0
7
+ },
8
+ {
9
+ at: 1380,
10
+ power: .85,
11
+ x: -.6
12
+ },
13
+ {
14
+ at: 2205,
15
+ power: 1,
16
+ x: .4
17
+ },
18
+ {
19
+ at: 3815,
20
+ power: .8,
21
+ x: -.3
22
+ },
23
+ {
24
+ at: 4320,
25
+ power: .6,
26
+ x: .75
27
+ },
28
+ {
29
+ at: 5010,
30
+ power: 1,
31
+ x: -.1
32
+ },
33
+ {
34
+ at: 6200,
35
+ power: .45,
36
+ x: .6
37
+ }
38
+ ]);
39
+ function n(e) {
40
+ return e < .05 ? 1 : e < .09 ? .2 : e < .15 ? 1 : Math.max(0, 1 - (e - .15) / .4);
41
+ }
42
+ var r = .55;
43
+ export { n as i, t as n, e as r, r as t };
44
+
45
+ //# sourceMappingURL=timeline-BLBedCYj.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"timeline-BLBedCYj.js","names":["THUNDER_DURATION_MS","THUNDER_CUES","boltFlicker","age","BOLT_LIFE_S"],"sources":["../../src/effects/thunder/timeline.js"],"sourcesContent":["/**\n * Timing for the Zumbido (thunder) effect, in ms from the start of `effects/nudge.mp3`.\n * Cues match the recording's high-band transients; recalibrate them whenever the mix changes.\n * Keep cues >= 350 ms apart: full-screen flashes must stay under three per second.\n * Power >= 0.9 strikes the 3D emblem directly.\n */\nexport const THUNDER_DURATION_MS = 7000;\n// Without a playing recording the visuals wait this long so both starts line up.\nexport const AUDIO_WAIT_MS = 400;\nexport const THUNDER_CUES = Object.freeze([\n { at: 550, power: 0.9, x: 0 },\n { at: 1380, power: 0.85, x: -0.6 },\n { at: 2205, power: 1, x: 0.4 },\n { at: 3815, power: 0.8, x: -0.3 },\n { at: 4320, power: 0.6, x: 0.75 },\n { at: 5010, power: 1, x: -0.1 },\n { at: 6200, power: 0.45, x: 0.6 },\n]);\n\n/** Opacity of a bolt `age` seconds after it strikes: two fast flickers, then a fade. */\nexport function boltFlicker(age) {\n if (age < 0.05) return 1;\n if (age < 0.09) return 0.2;\n if (age < 0.15) return 1;\n return Math.max(0, 1 - (age - 0.15) / 0.4);\n}\nexport const BOLT_LIFE_S = 0.55;\n"],"mappings":";AAMA,IAAaA,IAAsB,KAGtBC,IAAe,OAAO,OAAO;CACxC;EAAE,IAAI;EAAK,OAAO;EAAK,GAAG;CAAE;CAC5B;EAAE,IAAI;EAAM,OAAO;EAAM,GAAG;CAAK;CACjC;EAAE,IAAI;EAAM,OAAO;EAAG,GAAG;CAAI;CAC7B;EAAE,IAAI;EAAM,OAAO;EAAK,GAAG;CAAK;CAChC;EAAE,IAAI;EAAM,OAAO;EAAK,GAAG;CAAK;CAChC;EAAE,IAAI;EAAM,OAAO;EAAG,GAAG;CAAK;CAC9B;EAAE,IAAI;EAAM,OAAO;EAAM,GAAG;CAAI;AAClC,CAAC;AAGD,SAAgBC,EAAY,GAAK;CAI/B,OAHIC,IAAM,MAAa,IACnBA,IAAM,MAAa,KACnBA,IAAM,MAAa,IAChB,KAAK,IAAI,GAAG,KAAKA,IAAM,OAAQ,EAAG;AAC3C;AACA,IAAaC,IAAc"}