update home page
This commit is contained in:
40
parse_css.js
Normal file
40
parse_css.js
Normal file
@@ -0,0 +1,40 @@
|
||||
const fs = require('fs');
|
||||
const html = fs.readFileSync('/Users/apple/.gemini/antigravity-ide/brain/ea503590-6ba8-4b57-9e9c-c9c8fe9a2395/about_reference.html', 'utf8');
|
||||
|
||||
// Match all <style> blocks
|
||||
const styleRegex = /<style[^>]*>([\s\S]*?)<\/style>/gi;
|
||||
let styles = '';
|
||||
let match;
|
||||
while ((match = styleRegex.exec(html)) !== null) {
|
||||
styles += match[1] + '\n';
|
||||
}
|
||||
|
||||
function extractCSS(selector) {
|
||||
// Very simple regex to find the block for a selector
|
||||
const regex = new RegExp(selector.replace(/\./g, '\\.') + '\\s*\\{([^}]+)\\}', 'gi');
|
||||
let results = [];
|
||||
let m;
|
||||
while ((m = regex.exec(styles)) !== null) {
|
||||
results.push(m[1].trim());
|
||||
}
|
||||
return results.length > 0 ? results.join('\n') : 'NOT FOUND';
|
||||
}
|
||||
|
||||
console.log("=== .top-bar ===");
|
||||
console.log(extractCSS('.top-bar'));
|
||||
|
||||
console.log("\n=== .header ===");
|
||||
console.log(extractCSS('.header'));
|
||||
|
||||
console.log("\n=== .page-title-container ===");
|
||||
console.log(extractCSS('.page-title-container'));
|
||||
|
||||
console.log("\n=== .page-title ===");
|
||||
console.log(extractCSS('.page-title'));
|
||||
|
||||
console.log("\n=== .breadcrumbs ===");
|
||||
console.log(extractCSS('.breadcrumbs'));
|
||||
|
||||
console.log("\n=== .page-title-additional ===");
|
||||
console.log(extractCSS('.page-title-additional'));
|
||||
|
||||
Reference in New Issue
Block a user