Files
site-portfolio/shfin.mjs
T

17 lines
1008 B
JavaScript

import puppeteer from 'puppeteer';
const b = await puppeteer.launch({ args:['--no-sandbox','--disable-setuid-sandbox','--use-gl=angle','--enable-unsafe-swiftshader'] });
const p = await b.newPage();
const errs=[]; p.on('console',m=>{if(m.type()==='error')errs.push(m.text())}); p.on('pageerror',e=>errs.push('PE '+e.message));
await p.goto('http://10.200.201.3:4175/_lab/neu-card.html',{waitUntil:'load',timeout:60000});
await new Promise(r=>setTimeout(r,1200));
const r = await p.evaluate(()=>{
const card=document.querySelector('#sec-shader .card-shader-host .contact-card');
const cs=getComputedStyle(card);
const wrap=document.querySelector('#sec-shader .card-shader');
return { boxShadow: cs.boxShadow.slice(0,40), glow: cs.backgroundImage.slice(0,30),
shaderLayer: getComputedStyle(wrap).position, shaderZ: getComputedStyle(wrap).zIndex,
contentZ: getComputedStyle(card.querySelector('.contact-card__body')).zIndex };
});
console.log(JSON.stringify({r, errs},null,1));
await b.close();