forked from mswnlz/mswnlz.github.io
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdebug_layout.js
More file actions
71 lines (61 loc) · 2.2 KB
/
debug_layout.js
File metadata and controls
71 lines (61 loc) · 2.2 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
// Debug script to check for layout issues on production site
// Run this in the browser console on https://pan.devmini.space/
console.log('=== Layout Debug Script ===');
// Check if VitePress has loaded
console.log('VitePress app:', document.querySelector('#app'));
// Check for JavaScript errors
window.addEventListener('error', (e) => {
console.error('JavaScript Error:', e.error);
});
// Check for unhandled promise rejections
window.addEventListener('unhandledrejection', (e) => {
console.error('Unhandled Promise Rejection:', e.reason);
});
// Check CSS loading
console.log('Stylesheets loaded:');
Array.from(document.styleSheets).forEach((sheet, index) => {
try {
console.log(`${index + 1}. ${sheet.href} - Rules: ${sheet.cssRules?.length || 'N/A'}`);
} catch (e) {
console.log(`${index + 1}. ${sheet.href} - Error accessing rules:`, e.message);
}
});
// Check for VPFeatures grid
const features = document.querySelector('.VPHomeFeatures .items');
if (features) {
console.log('Features container found:', features);
console.log('Grid template columns:', getComputedStyle(features).gridTemplateColumns);
console.log('Feature items count:', features.children.length);
// Check each feature item
Array.from(features.children).forEach((item, index) => {
const vpFeature = item.querySelector('.VPFeature');
if (vpFeature) {
const computedStyle = getComputedStyle(vpFeature);
console.log(`Feature ${index + 1}:`, {
width: computedStyle.width,
height: computedStyle.height,
display: computedStyle.display,
position: computedStyle.position
});
}
});
} else {
console.warn('Features container not found');
}
// Check for CommitHistory component
const commitHistory = document.querySelector('.commit-history-container');
if (commitHistory) {
console.log('CommitHistory found:', commitHistory);
} else {
console.warn('CommitHistory not found');
}
// Check Vue app mounting
setTimeout(() => {
const vueApp = document.querySelector('#app').__vue_app__;
if (vueApp) {
console.log('Vue app mounted successfully');
} else {
console.warn('Vue app not found or not mounted');
}
}, 2000);
console.log('=== Debug script complete ===');