Files
cz-web/measure.js
2026-10-01 10:53:13 +08:00

28 lines
1.0 KiB
JavaScript
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
// @ts-nocheck
// 临时几何量测:把要测的选择器写进 SEL,执行 `node measure.js <sel...>` 生成命令
const SELS = [
'.project-detail__breadcrumb',
'.project-info-card',
'.project-info-card__logo',
'.project-info-card__name',
'.project-info-card__meta',
'.project-info-card__status',
'.project-detail__tabs',
'.project-detail__tab',
'.project-progress__title',
'.project-progress__head',
'.project-progress__track',
'.project-progress__range',
'.project-milestones__title',
'.project-milestones__track',
'.project-milestones__node',
'.project-milestones__dot',
'.project-team__title',
'.project-team__list',
'.project-team__avatar',
]
const arr = JSON.stringify(SELS).replace(/"/g, '\\"')
const js = `(function(){const o={};for(const s of ${JSON.stringify(SELS)}){const e=document.querySelector(s);if(!e){o[s]=null;continue}const r=e.getBoundingClientRect();o[s]=[+r.x.toFixed(1),+r.y.toFixed(1),+r.width.toFixed(1),+r.height.toFixed(1)]}return JSON.stringify(o)})()`
console.log(js)