-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtest_modal.html
More file actions
82 lines (71 loc) · 2.37 KB
/
Copy pathtest_modal.html
File metadata and controls
82 lines (71 loc) · 2.37 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
<!DOCTYPE html>
<html lang="zh-TW">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Modal Test</title>
<style>
body {
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
padding: 20px;
}
.test-button {
background: #667eea;
color: white;
border: none;
padding: 10px 20px;
border-radius: 6px;
cursor: pointer;
margin: 10px 0;
}
.test-results {
margin-top: 20px;
padding: 10px;
background: #f8f9fa;
border-radius: 6px;
}
</style>
</head>
<body>
<h1>Help Modal Test</h1>
<button class="test-button" onclick="testModalOpen()">Test Modal Open</button>
<button class="test-button" onclick="testModalClose()">Test Modal Close</button>
<button class="test-button" onclick="testScrollLock()">Test Background Scroll Lock</button>
<div class="test-results" id="test-results">
<h3>Test Results:</h3>
<p>Click the buttons above to test the modal functionality.</p>
</div>
<script>
function logResult(message) {
const resultsDiv = document.getElementById('test-results');
const p = document.createElement('p');
p.textContent = `${new Date().toLocaleTimeString()}: ${message}`;
resultsDiv.appendChild(p);
}
function testModalOpen() {
fetch('http://localhost:8000/demo/')
.then(response => response.text())
.then(html => {
// Check if modal elements exist
if (html.includes('lp-help-overlay') && html.includes('lp-help-modal')) {
logResult('✅ Modal elements found in HTML');
// Open the demo page in a new window to test actual functionality
window.open('http://localhost:8000/demo/', '_blank');
logResult('📱 Opened demo page in new window for manual testing');
} else {
logResult('❌ Modal elements not found in HTML');
}
})
.catch(error => {
logResult(`❌ Error fetching page: ${error.message}`);
});
}
function testModalClose() {
logResult('ℹ️ Manual test: In the demo page, click the × button or press Escape to close');
}
function testScrollLock() {
logResult('ℹ️ Manual test: In the demo page, open modal and try to scroll background');
}
</script>
</body>
</html>