-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathfont_size_test.html
More file actions
263 lines (243 loc) Β· 10.1 KB
/
font_size_test.html
File metadata and controls
263 lines (243 loc) Β· 10.1 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
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Font Size Upgrade Test</title>
<script src="https://d3js.org/d3.v7.min.js"></script>
<link rel="stylesheet" href="diagram-sizing-fixes.css">
<link rel="stylesheet" href="diagrams/diagram-styles.css">
<style>
body {
font-family: "Inter", "Segoe UI", "Roboto", "Helvetica Neue", Arial, sans-serif;
margin: 0;
padding: 20px;
background: #f8fafc;
color: #1e293b;
line-height: 1.6;
}
.header {
text-align: center;
margin-bottom: 40px;
padding: 30px;
background: white;
border-radius: 12px;
box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}
.comparison-container {
display: grid;
grid-template-columns: 1fr 1fr;
gap: 30px;
margin: 30px 0;
}
.test-section {
background: white;
padding: 25px;
border-radius: 12px;
box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
border: 1px solid #e2e8f0;
}
.section-title {
font-size: 1.4rem;
font-weight: 600;
margin-bottom: 15px;
color: #1e293b;
}
.diagram-container {
min-height: 400px;
border: 2px solid #e2e8f0;
border-radius: 8px;
padding: 15px;
background: linear-gradient(135deg, #fafbfc 0%, #f1f5f9 100%);
position: relative;
}
.font-indicator {
position: absolute;
top: 10px;
right: 10px;
padding: 6px 12px;
border-radius: 20px;
font-size: 0.75rem;
font-weight: 600;
background: #dcfce7;
color: #166534;
}
.feature-list {
margin: 20px 0;
padding: 20px;
background: #f1f5f9;
border-radius: 8px;
}
.feature-list h3 {
color: #1e293b;
margin-top: 0;
}
.feature-list ul {
margin: 0;
padding-left: 20px;
}
.feature-list li {
margin: 8px 0;
color: #64748b;
}
@media (max-width: 768px) {
.comparison-container {
grid-template-columns: 1fr;
}
}
</style>
</head>
<body>
<div class="header">
<h1>π Font Size Upgrade Validation</h1>
<p>Testing improved readability with larger, more professional font sizes</p>
</div>
<div class="feature-list">
<h3>π― Font Size Improvements Applied</h3>
<ul>
<li><strong>Title Text:</strong> 18px β 22px (+22% larger)</li>
<li><strong>Subtitle Text:</strong> 14px β 18px (+29% larger)</li>
<li><strong>Normal Text:</strong> 12px β 15px (+25% larger)</li>
<li><strong>Small Text:</strong> 10px β 13px (+30% larger)</li>
<li><strong>Code Text:</strong> 10px β 13px (+30% larger)</li>
<li><strong>Mobile Responsive:</strong> All sizes maintain proportional scaling</li>
</ul>
</div>
<div class="comparison-container">
<div class="test-section">
<div class="section-title">BufferView Architecture</div>
<div class="diagram-container">
<div class="font-indicator">π Larger Fonts</div>
<div id="bufferview-test" style="width: 100%; min-height: 350px;"></div>
</div>
</div>
<div class="test-section">
<div class="section-title">MultiIndex Structure</div>
<div class="diagram-container">
<div class="font-indicator">π Larger Fonts</div>
<div id="multiindex-test" style="width: 100%; min-height: 350px;"></div>
</div>
</div>
</div>
<div class="comparison-container">
<div class="test-section">
<div class="section-title">Transform System</div>
<div class="diagram-container">
<div class="font-indicator">π Larger Fonts</div>
<div id="transform-test" style="width: 100%; min-height: 400px;"></div>
</div>
</div>
<div class="test-section">
<div class="section-title">Coordinate Systems</div>
<div class="diagram-container">
<div class="font-indicator">π Larger Fonts</div>
<div id="coord-systems-test" style="width: 100%; min-height: 400px;"></div>
</div>
</div>
</div>
<div class="test-section" style="margin-top: 30px;">
<div class="section-title">π Responsive Font Testing</div>
<p>Resize your browser window to see how fonts scale responsively while maintaining readability.</p>
<div style="display: grid; grid-template-columns: 1fr 1fr; gap: 20px; margin-top: 20px;">
<div style="width: 70%; border: 2px solid #2563eb; padding: 15px; border-radius: 8px;">
<h4 style="margin-top: 0; color: #2563eb;">70% Width Test</h4>
<div id="narrow-test" style="width: 100%; min-height: 250px;"></div>
</div>
<div style="width: 50%; border: 2px solid #16a34a; padding: 15px; border-radius: 8px;">
<h4 style="margin-top: 0; color: #16a34a;">50% Width Test</h4>
<div id="very-narrow-test" style="width: 100%; min-height: 250px;"></div>
</div>
</div>
</div>
<!-- Load all diagram scripts -->
<script src="diagrams/diagrams.js"></script>
<script src="diagrams/buffer_view/bufferview_architecture.js"></script>
<script src="diagrams/tensor_coordinates/multiindex_structure.js"></script>
<script src="diagrams/transforms/transform_system_architecture.js"></script>
<script src="diagrams/coordinate-systems-diagrams.js"></script>
<script>
document.addEventListener('DOMContentLoaded', function() {
console.log('π€ Testing enlarged font sizes across all diagrams...');
// Test all diagram types with improved fonts
const tests = [
{
name: 'BufferView Architecture',
func: 'createBufferViewArchitecture',
containers: ['#bufferview-test', '#narrow-test']
},
{
name: 'MultiIndex Structure',
func: 'createMultiIndexStructure',
containers: ['#multiindex-test', '#very-narrow-test']
},
{
name: 'Transform System',
func: 'createTransformSystemArchitecture',
containers: ['#transform-test']
},
{
name: 'Coordinate Systems',
func: () => CoordinateSystemDiagrams.fiveCoordinateSpaces('#coord-systems-test'),
containers: []
}
];
let successCount = 0;
tests.forEach(test => {
try {
if (typeof test.func === 'string' && typeof window[test.func] === 'function') {
test.containers.forEach(container => {
window[test.func](container);
console.log(`β
${test.name} loaded with larger fonts in ${container}`);
});
successCount++;
} else if (typeof test.func === 'function') {
test.func();
console.log(`β
${test.name} loaded with larger fonts`);
successCount++;
}
} catch (error) {
console.error(`β ${test.name} failed:`, error);
}
});
// Font size validation
setTimeout(() => {
const svgTexts = document.querySelectorAll('svg text');
const fontSizes = Array.from(svgTexts).map(text => {
const fontSize = window.getComputedStyle(text)['font-size'];
return parseInt(fontSize);
});
const avgFontSize = fontSizes.reduce((a, b) => a + b, 0) / fontSizes.length;
const minFontSize = Math.min(...fontSizes);
const maxFontSize = Math.max(...fontSizes);
console.log(`π Font Size Analysis:`);
console.log(` Average: ${avgFontSize.toFixed(1)}px`);
console.log(` Range: ${minFontSize}px - ${maxFontSize}px`);
console.log(` Total text elements: ${fontSizes.length}`);
if (avgFontSize >= 14) {
console.log('β
Font sizes successfully increased - good readability!');
} else {
console.log('β οΈ Some fonts may still be too small');
}
}, 2000);
// Responsive testing
let resizeTimeout;
window.addEventListener('resize', function() {
clearTimeout(resizeTimeout);
resizeTimeout = setTimeout(() => {
console.log('π Testing responsive font scaling...');
// Re-render diagrams to test responsive behavior
if (typeof createBufferViewArchitecture === 'function') {
createBufferViewArchitecture('#bufferview-test');
createBufferViewArchitecture('#narrow-test');
}
if (typeof createMultiIndexStructure === 'function') {
createMultiIndexStructure('#multiindex-test');
createMultiIndexStructure('#very-narrow-test');
}
}, 300);
});
console.log(`π Font size upgrade test completed: ${successCount}/${tests.length} diagrams loaded`);
});
</script>
</body>
</html>