按钮颜色

This commit is contained in:
tianmo committed 2026-09-19 19:01:49 +08:00
1 parent b258d736fd
commit 5808e3dfce
5 files changed
+57 -6

No files matched your search

+13
View File
@@ -7,8 +7,21 @@ const { createRequire } = require('node:module');
const roots = ['.', 'release/UNIVERSAL_SpineViewer'];
for (const root of roots) {
const html = fs.readFileSync(path.join(root, 'viewer/spine.html'), 'utf8');
const css = fs.readFileSync(path.join(root, 'viewer/spine.css'), 'utf8');
const script = html.match(/<script>([\s\S]*?)<\/script>/)[1];
new vm.Script(script);
for (const id of ['groupThumbBtn', 'thumbBtn']) {
const button = html.match(new RegExp(`<button id="${id}"[^>]*>`))[0];
assert.match(button, /data-instant-tooltip/);
assert.match(button, /data-tooltip=/);
assert.doesNotMatch(button, /\stitle=/);
}
assert.match(css, /#groupThumbBtn:hover::after, #thumbBtn:hover::after \{ opacity: 1; visibility: visible; \}/);
assert.match(css, /#groupThumbBtn \{[^}]*background: #2e7d32;/);
assert.match(css, /#thumbBtn \{[^}]*background: #1976d2;/);
assert.match(css, /#groupThumbBtn::after \{[^}]*background: #256628;/);
assert.match(css, /#thumbBtn::after \{[^}]*background: #155fa8;/);
assert.match(script, /if \(el\.hasAttribute\('data-instant-tooltip'\)\) el\.dataset\.tooltip = text;/);
const i18n = script.slice(script.indexOf('\tconst I18N_LANGUAGES'), script.indexOf('\tapplyStaticI18n();'));
const markers = script.slice(script.indexOf('\tfunction renderKeyframeMarkers('), script.indexOf('\tfunction seekTo('));
const manifest = JSON.parse(fs.readFileSync(path.join(root, 'manifest.json'), 'utf8'));