import puppeteer from 'puppeteer'; const b = await puppeteer.launch({ args:['--no-sandbox','--disable-setuid-sandbox','--use-gl=angle','--enable-unsafe-swiftshader','--ignore-gpu-blocklist'] }); const p = await b.newPage(); await p.setViewport({width:1100,height:1300}); await p.goto('http://10.200.201.3:4175/_lab/neu-card.html',{waitUntil:'load',timeout:60000}); await new Promise(r=>setTimeout(r,800)); const r = await p.evaluate(async ()=>{ const mod = await import('/vendor/paper-shaders/index.js'); const { ShaderMount, meshGradientFragmentShader, getShaderColorFromString } = mod; const host = document.createElement('div'); host.style.cssText='width:300px;height:200px;position:relative'; document.body.appendChild(host); const colors = ['#7c5cff','#00c2c7','#ff5c8a','#ffb347'].map(getShaderColorFromString); const uniforms = { u_colors: colors, u_colorsCount: colors.length, u_distortion:1.2, u_swirl:0.8, u_grainMixer:0.08, u_grainOverlay:0.04 }; const m = new ShaderMount(host, meshGradientFragmentShader, uniforms, { preserveDrawingBuffer:true, antialias:true }, 1.0); const gl=m.gl, pr=m.program; const f=(n)=>{const l=gl.getUniformLocation(pr,n);const v=new Float32Array(4);gl.getUniform(pr,l,v);return Array.from(v).map(x=>+x.toFixed(3));}; const fi=(n)=>{const l=gl.getUniformLocation(pr,n);const v=new Float32Array(1);gl.getUniform(pr,l,v);return v[0];}; return { u_swirl: fi('u_swirl'), u_distortion: fi('u_distortion'), u_colorsCount: fi('u_colorsCount'), u_color0: f('u_colors[0]'), u_color1: f('u_colors[1]'), }; }); console.log(JSON.stringify(r,null,1)); await b.close();