fix(i18n): add 'home' body class to English homepage so section__title margin applies
This commit is contained in:
1 parent
9d78567386
commit
939ce8fcc9
88 files changed
+1830
-2
No files matched your search
+32
@@ -0,0 +1,32 @@
|
||||
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 m = new ShaderMount(host, meshGradientFragmentShader, { u_colors: colors, u_colorsCount: colors.length, u_distortion:1.2, u_swirl:0.8, u_grainMixer:0.08, u_grainOverlay:0.04 }, { preserveDrawingBuffer:true, antialias:true }, 1.0);
|
||||
const gl=m.gl, pr=m.program;
|
||||
// правильное чтение: getUniform ВОЗВРАЩАЕТ значение
|
||||
const gf=(n)=>gl.getUniform(pr, gl.getUniformLocation(pr,n));
|
||||
const colorsWritten = gf('u_colors[0]'); // Float32Array(4)
|
||||
const countWritten = gf('u_colorsCount'); // number
|
||||
const swirlWritten = gf('u_swirl');
|
||||
// readPixels скан
|
||||
m.render(performance.now()); m.render(performance.now());
|
||||
const W=m.canvasElement.width,H=m.canvasElement.height; const buf=new Uint8Array(W*H*4); gl.readPixels(0,0,W,H,gl.RGBA,gl.UNSIGNED_BYTE,buf);
|
||||
let bright=0,maxc=0; for(let i=0;i<buf.length;i+=4){const mx=Math.max(buf[i],buf[i+1],buf[i+2]); if(mx>120)bright++; maxc=Math.max(maxc,mx);}
|
||||
return {
|
||||
u_colors0: colorsWritten ? Array.from(colorsWritten).map(x=>+x.toFixed(2)) : null,
|
||||
u_colorsCount: countWritten,
|
||||
u_swirl: swirlWritten,
|
||||
brightPixels: bright, maxChannel: maxc,
|
||||
};
|
||||
});
|
||||
console.log(JSON.stringify(r,null,1));
|
||||
await b.close();
|
||||
Reference in new issue
Block a user