Files
carrot-hunter/Carrot_Hunter/debug.html

122 lines
2.8 KiB
HTML

<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Carrot Hunter - Debug</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0, user-scalable=no">
<style>
* {
padding: 0;
margin: 0;
}
html, body {
background: #000;
color: #fff;
overflow: hidden;
touch-action: none;
-ms-touch-action: none;
}
canvas {
touch-action-delay: none;
touch-action: none;
-ms-touch-action: none;
}
#debug {
position: fixed;
top: 10px;
left: 10px;
background: rgba(255,0,0,0.8);
color: white;
padding: 10px;
font-family: monospace;
font-size: 12px;
z-index: 9999;
max-width: 90%;
max-height: 200px;
overflow: auto;
}
.ok {
background: rgba(0,255,0,0.8) !important;
}
</style>
</head>
<body>
<div id="debug">Loading...</div>
<div id="fb-root"></div>
<script>
var debugLog = [];
function log(msg, isError) {
console.log(msg);
debugLog.push((isError ? '❌ ' : '✓ ') + msg);
updateDebug();
}
function updateDebug() {
var div = document.getElementById('debug');
div.innerHTML = debugLog.join('<br>');
if (debugLog.length > 0 && !debugLog[debugLog.length - 1].startsWith('❌')) {
div.className = 'ok';
}
}
window.onerror = function(msg, url, line) {
log('ERROR: ' + msg + ' at line ' + line, true);
return false;
};
log('Starting...');
</script>
<script src="c2runtime.js" onload="log('c2runtime.js loaded')" onerror="log('Failed to load c2runtime.js', true)"></script>
<canvas id="c2canvas" width="854" height="480">
<h1>Your browser does not support HTML5 Canvas</h1>
</canvas>
<script>
log('Canvas element created');
var canvas = document.getElementById('c2canvas');
if (canvas) {
log('Canvas found: ' + canvas.width + 'x' + canvas.height);
} else {
log('Canvas NOT found!', true);
}
</script>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"
onload="log('jQuery loaded: v' + jQuery.fn.jquery)"
onerror="log('Failed to load jQuery', true)"></script>
<script>
// Wait for jQuery to load
var checkJQuery = setInterval(function() {
if (typeof jQuery !== 'undefined') {
clearInterval(checkJQuery);
log('jQuery ready');
loadWebAppStart();
}
}, 100);
function loadWebAppStart() {
var script = document.createElement('script');
script.src = 'c2webappstart.js';
script.onload = function() {
log('c2webappstart.js loaded');
setTimeout(function() {
if (typeof cr_createRuntime !== 'undefined') {
log('Game initialized successfully!');
} else {
log('cr_createRuntime not found', true);
}
}, 1000);
};
script.onerror = function() {
log('Failed to load c2webappstart.js', true);
};
document.body.appendChild(script);
}
</script>
</body>
</html>