Feature/Update versioning logic (#7)
All checks were successful
Build and Publish Docker Image / Build and Validate (push) Successful in 8s
Build and Publish Docker Image / Publish to Registry (push) Successful in 7s

Reviewed-on: #7
Co-authored-by: Juan Sebastian Montoya <juansmm@outlook.com>
Co-committed-by: Juan Sebastian Montoya <juansmm@outlook.com>
This commit is contained in:
Juan Sebastián Montoya 2025-11-26 11:22:30 -05:00 committed by Juan Sebastián Montoya
parent c933f5f8cc
commit 28c820488e
6 changed files with 117 additions and 9 deletions

View file

@ -72,10 +72,25 @@
text-align: center;
text-shadow: 2px 2px 4px rgba(0,0,0,0.5);
}
#version {
position: absolute;
top: 20px;
right: 20px;
color: rgba(255, 255, 255, 0.7);
font-size: 14px;
text-shadow: 2px 2px 4px rgba(0,0,0,0.5);
z-index: 100;
font-family: 'Courier New', monospace;
}
@media (max-width: 768px) {
#instructions {
font-size: 14px;
}
#version {
font-size: 12px;
top: 10px;
right: 10px;
}
}
</style>
</head>
@ -85,6 +100,8 @@
<div>Health: <span id="health">100</span></div>
</div>
<div id="version">v<span id="versionNumber">-</span></div>
<div id="gameOver">
<h1>Game Over!</h1>
<p>Final Score: <span id="finalScore">0</span></p>
@ -97,6 +114,27 @@
<script src="https://cdnjs.cloudflare.com/ajax/libs/three.js/r128/three.min.js"></script>
<script>
// Load and display version information
(function() {
fetch('/version.json')
.then(response => {
if (response.ok) {
return response.json();
}
throw new Error('Version file not found');
})
.then(data => {
const versionElement = document.getElementById('versionNumber');
if (versionElement && data.version) {
versionElement.textContent = data.version;
}
})
.catch(error => {
// Silently fail if version.json doesn't exist (e.g., in development)
console.debug('Version information not available:', error.message);
});
})();
// Base GameObject class
class GameObject {
constructor(scene, groundSize) {