Files
BreakEscape/verify-css.html

210 lines
8.2 KiB
HTML

<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>CSS Verification</title>
<!-- Include the game's CSS -->
<link rel="stylesheet" href="css/main.css">
<link rel="stylesheet" href="css/minigames-framework.css">
<link rel="stylesheet" href="css/password-minigame.css">
<link rel="stylesheet" href="css/notifications.css">
<style>
body {
background: #1a1a1a;
color: white;
font-family: 'Press Start 2P', monospace;
margin: 0;
padding: 20px;
}
.verification-container {
max-width: 600px;
margin: 0 auto;
}
.test-element {
margin: 20px 0;
padding: 20px;
border: 2px solid #444;
border-radius: 10px;
background: #2a2a2a;
}
.status {
display: inline-block;
padding: 5px 10px;
border-radius: 3px;
font-size: 8px;
margin-left: 10px;
}
.status.success {
background: #2ecc71;
color: white;
}
.status.error {
background: #e74c3c;
color: white;
}
</style>
</head>
<body>
<div class="verification-container">
<h1>CSS Verification Test</h1>
<p>This page verifies that the password minigame CSS is properly loaded and applied.</p>
<div class="test-element">
<h2>Password Field with Monitor Bezel Test</h2>
<div class="password-minigame-area">
<div class="monitor-bezel">
<div class="monitor-screen">
<div class="password-input-container">
<label for="test-password">Password:</label>
<div class="password-field-wrapper">
<input type="password" id="test-password" class="password-field" placeholder="Enter password...">
<button type="button" class="toggle-password-btn">👁️‍🗨️</button>
</div>
</div>
<div class="password-hint-container">
<button type="button" class="hint-btn">Show Hint</button>
</div>
</div>
</div>
</div>
<div id="password-status" class="status error">CSS NOT LOADED</div>
</div>
<div class="test-element">
<h2>Hint System Test</h2>
<div class="password-hint-container">
<button type="button" class="hint-btn">Show Hint</button>
<div class="password-hint" style="display: none;">
<strong>Hint:</strong> This is a test hint
</div>
</div>
<div id="hint-status" class="status error">CSS NOT LOADED</div>
</div>
<div class="test-element">
<h2>Onscreen Keyboard Test</h2>
<div class="onscreen-keyboard">
<div class="keyboard-row">
<button class="key" data-key="q">Q</button>
<button class="key" data-key="w">W</button>
<button class="key" data-key="e">E</button>
<button class="key key-backspace" data-key="Backspace"></button>
</div>
</div>
<div id="keyboard-status" class="status error">CSS NOT LOADED</div>
</div>
<div class="test-element">
<h2>Action Buttons Test</h2>
<div class="password-actions">
<button type="button" class="submit-btn">Submit</button>
<button type="button" class="cancel-btn">Cancel</button>
</div>
<div id="buttons-status" class="status error">CSS NOT LOADED</div>
</div>
<div class="test-element">
<h2>Attempts Counter Test</h2>
<div class="attempts-counter">
Attempts: <span>0</span>/3
</div>
<div id="counter-status" class="status error">CSS NOT LOADED</div>
</div>
<div class="test-element">
<h2>Overall Status</h2>
<div id="overall-status" class="status error">VERIFICATION IN PROGRESS</div>
</div>
</div>
<script>
// Check if CSS classes are properly styled
function verifyCSS() {
let allPassed = true;
// Check monitor bezel background
const monitorBezel = document.querySelector('.monitor-bezel');
if (monitorBezel) {
const styles = window.getComputedStyle(monitorBezel);
if (styles.backgroundImage && styles.backgroundImage !== 'none') {
document.getElementById('password-status').textContent = 'CSS LOADED';
document.getElementById('password-status').className = 'status success';
} else {
allPassed = false;
}
}
// Check hint button
const hintBtn = document.querySelector('.hint-btn');
if (hintBtn) {
const styles = window.getComputedStyle(hintBtn);
if (styles.backgroundColor === 'rgb(243, 156, 18)' || styles.backgroundColor === '#f39c12') {
document.getElementById('hint-status').textContent = 'CSS LOADED';
document.getElementById('hint-status').className = 'status success';
} else {
allPassed = false;
}
}
// Check keyboard keys
const key = document.querySelector('.key');
if (key) {
const styles = window.getComputedStyle(key);
if (styles.backgroundColor === 'rgb(68, 68, 68)' || styles.backgroundColor === '#444') {
document.getElementById('keyboard-status').textContent = 'CSS LOADED';
document.getElementById('keyboard-status').className = 'status success';
} else {
allPassed = false;
}
}
// Check submit button
const submitBtn = document.querySelector('.submit-btn');
if (submitBtn) {
const styles = window.getComputedStyle(submitBtn);
if (styles.backgroundColor === 'rgb(46, 204, 113)' || styles.backgroundColor === '#2ecc71') {
document.getElementById('buttons-status').textContent = 'CSS LOADED';
document.getElementById('buttons-status').className = 'status success';
} else {
allPassed = false;
}
}
// Check attempts counter
const counter = document.querySelector('.attempts-counter');
if (counter) {
const styles = window.getComputedStyle(counter);
if (styles.color === 'rgb(243, 156, 18)' || styles.color === '#f39c12') {
document.getElementById('counter-status').textContent = 'CSS LOADED';
document.getElementById('counter-status').className = 'status success';
} else {
allPassed = false;
}
}
// Overall status
if (allPassed) {
document.getElementById('overall-status').textContent = 'ALL CSS LOADED SUCCESSFULLY';
document.getElementById('overall-status').className = 'status success';
} else {
document.getElementById('overall-status').textContent = 'SOME CSS NOT LOADED';
document.getElementById('overall-status').className = 'status error';
}
}
// Run verification after page loads
window.addEventListener('load', () => {
setTimeout(verifyCSS, 100); // Small delay to ensure CSS is loaded
});
</script>
</body>
</html>