Files
BreakEscape/test-phone-minigame.html.old
Z. Cliffe Schreuders 01010e7e20 refactor: Remove old phone-messages minigame and transition to phone-chat
- Deleted `phone-messages-minigame.js` and archived related CSS.
- Updated `interactions.js` to exclusively use phone-chat with runtime conversion.
- Enhanced error handling for phone interactions.
- Marked completion of old phone minigame removal in implementation log.
- Added detailed cleanup summary documentation.
2025-10-30 10:16:31 +00:00

175 lines
6.5 KiB
HTML

<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Phone Messages Minigame Test</title>
<link rel="stylesheet" href="css/main.css">
<link rel="stylesheet" href="css/minigames-framework.css">
<link rel="stylesheet" href="css/phone.css">
<style>
body {
background: #000;
color: #00ff00;
font-family: 'Courier New', monospace;
margin: 0;
padding: 20px;
}
.test-container {
max-width: 800px;
margin: 0 auto;
text-align: center;
}
.test-button {
background: #333;
color: #00ff00;
border: 2px solid #555;
padding: 15px 30px;
margin: 10px;
border-radius: 8px;
cursor: pointer;
font-family: 'Courier New', monospace;
font-size: 14px;
transition: all 0.3s ease;
}
.test-button:hover {
background: #444;
border-color: #00ff00;
box-shadow: 0 0 10px rgba(0, 255, 0, 0.3);
}
.instructions {
background: rgba(0, 255, 0, 0.1);
border: 1px solid rgba(0, 255, 0, 0.3);
padding: 20px;
margin: 20px 0;
border-radius: 8px;
text-align: left;
}
</style>
</head>
<body>
<div class="test-container">
<h1>Phone Messages Minigame Test</h1>
<div class="instructions">
<h3>Test Instructions:</h3>
<ul>
<li><strong>Reception Phone:</strong> Contains a voicemail from IT Team about server room access code</li>
<li><strong>CEO Phone:</strong> Shows recent call log with suspicious contacts</li>
<li><strong>Controls:</strong> Use arrow keys to navigate, spacebar to play/stop voice messages, escape to go back</li>
<li><strong>Voice Messages:</strong> Uses Web Speech API to play back voice content</li>
</ul>
</div>
<button class="test-button" onclick="testReceptionPhone()">Test Reception Phone</button>
<button class="test-button" onclick="testCEOPhone()">Test CEO Phone</button>
<button class="test-button" onclick="testMultipleMessages()">Test Multiple Messages</button>
<div id="status" style="margin-top: 20px; color: #666;"></div>
</div>
<!-- Import the minigame framework -->
<script type="module">
import { MinigameFramework } from './js/minigames/index.js';
// Make framework available globally for testing
window.MinigameFramework = MinigameFramework;
// Test data
const receptionPhoneData = {
title: 'Reception Phone',
messages: [
{
type: 'voice',
sender: 'IT Team',
text: 'Voicemail: Security breach detected in server room. Changed access code to 4829. - IT Team',
voice: 'Security breach detected in server room. Changed access code to 4829. - IT Team',
timestamp: '2:15 AM',
read: false
}
]
};
const ceoPhoneData = {
title: 'CEO Phone',
messages: [
{
type: 'text',
sender: 'Call Log',
text: 'Recent calls:\n- Offshore Bank (3:45 AM)\n- Unknown (2:30 AM)\n- Data Buyer (1:15 AM)',
timestamp: 'Last 24 hours',
read: false
}
]
};
const multipleMessagesData = {
title: 'Multi-Message Phone',
messages: [
{
type: 'voice',
sender: 'IT Team',
text: 'Voicemail: Security breach detected in server room. Changed access code to 4829. - IT Team',
voice: 'Security breach detected in server room. Changed access code to 4829. - IT Team',
timestamp: '2:15 AM',
read: false
},
{
type: 'text',
sender: 'CEO',
text: 'Meeting moved to 3 PM. Bring the documents.',
timestamp: '1:30 PM',
read: false
},
{
type: 'voice',
sender: 'Unknown',
text: 'Voicemail: The transfer is complete. Delete all traces.',
voice: 'The transfer is complete. Delete all traces.',
timestamp: '11:45 PM',
read: false
}
]
};
// Test functions
window.testReceptionPhone = function() {
document.getElementById('status').textContent = 'Starting Reception Phone test...';
MinigameFramework.startMinigame('phone-messages', null, {
...receptionPhoneData,
onComplete: (success, result) => {
document.getElementById('status').textContent = `Reception Phone test completed: ${success ? 'Success' : 'Failed'}`;
}
});
};
window.testCEOPhone = function() {
document.getElementById('status').textContent = 'Starting CEO Phone test...';
MinigameFramework.startMinigame('phone-messages', null, {
...ceoPhoneData,
onComplete: (success, result) => {
document.getElementById('status').textContent = `CEO Phone test completed: ${success ? 'Success' : 'Failed'}`;
}
});
};
window.testMultipleMessages = function() {
document.getElementById('status').textContent = 'Starting Multiple Messages test...';
MinigameFramework.startMinigame('phone-messages', null, {
...multipleMessagesData,
onComplete: (success, result) => {
document.getElementById('status').textContent = `Multiple Messages test completed: ${success ? 'Success' : 'Failed'}`;
}
});
};
console.log('Phone Messages Minigame Test Page Loaded');
console.log('Available test functions: testReceptionPhone(), testCEOPhone(), testMultipleMessages()');
</script>
</body>
</html>