7 Commits

Author SHA1 Message Date
User 37b5511439 feat: Implement loading screen with retro 80s aesthetic and unit tests
Run Tests / test (pull_request) Failing after 36s
2026-03-22 11:37:11 +00:00
steve-admin a29b01f26e Merge pull request 'feat/test-infrastructure' (#1) from feat/test-infrastructure into master
Run Tests / test (push) Failing after 36s
Reviewed-on: #1
2026-03-22 11:27:48 +00:00
User acf9f85c6a Fix npm test issues
Run Tests / test (pull_request) Failing after 35s
2026-03-22 11:26:43 +00:00
User 6b437d41cb fix: Add jest-environment-jsdom for Jest 28 compatibility
Run Tests / test (pull_request) Failing after 35s
2026-03-22 11:22:50 +00:00
User 521df99323 Update package and package lock
Run Tests / test (pull_request) Failing after 38s
2026-03-22 11:16:50 +00:00
User 23a1cdcbbf Update package and package lock
Run Tests / test (pull_request) Failing after 13s
2026-03-22 11:11:45 +00:00
steve-admin 56a28b9015 Update .gitea/workflows/test.yml
Run Tests / test (pull_request) Failing after 38s
2026-03-21 12:36:34 +00:00
17 changed files with 4672 additions and 4 deletions
Binary file not shown.
Binary file not shown.
+1 -1
View File
@@ -1 +1 @@
{"title": "3D flyer", "description": "We're replicating late-80s flight simulators in a web browser using JS and Threee.js. The intent is to make it look like something you'd find on a PC or Amiga of the time. Think low-resolution, polygonal, low frame-rate. The landscape must be realistic (villages, forests, bodies of water) but should be procedural with persistence!", "instructions": "Always test. Use your knowledge of playwright, for example. Check for front-end JS errors. Any new features should be in a new branch - the repo is at https://repos.retroweb.dev/ai-zone/wings88.git\n\nYou are responsible for committing to the repo, not the user!\n\nAsk the user if any permissions are required.", "color": "#fb5607", "git_url": "", "memory": "own", "file_structure": {"enabled": true, "max_depth": 5, "max_files": 20, "max_folders": 20, "max_lines": 250, "gitignore": "# Python environments & cache\nvenv/**\n**/__pycache__/**\n\n# Node.js dependencies\n**/node_modules/**\n**/.npm/**\n\n# Version control metadata\n**/.git/**\n"}} {"title": "3D flyer", "description": "We're replicating late-80s flight simulators in a web browser using JS and Threee.js. The intent is to make it look like something you'd find on a PC or Amiga of the time. Think low-resolution, polygonal, low frame-rate. The landscape must be realistic (villages, forests, bodies of water) but should be procedural with persistence!", "instructions": "Always test. Use your knowledge of playwright, for example. Check for front-end JS errors. Any new features should be in a new branch - the repo is at https://repos.retroweb.dev/ai-zone/wings88.git\n\nYou must commit to the repo, not the user. Use branches where suitable.", "color": "#fb5607", "git_url": "", "memory": "own", "file_structure": {"enabled": true, "max_depth": 5, "max_files": 20, "max_folders": 20, "max_lines": 250, "gitignore": "# Python environments & cache\nvenv/**\n**/__pycache__/**\n\n# Node.js dependencies\n**/node_modules/**\n**/.npm/**\n\n# Version control metadata\n**/.git/**\n"}}
+2 -2
View File
@@ -2,9 +2,9 @@ name: Run Tests
on: on:
push: push:
branches: [ main, dev ] branches: [ master, dev ]
pull_request: pull_request:
branches: [ main, dev ] branches: [ master, dev ]
jobs: jobs:
test: test:
+1 -1
View File
@@ -1,5 +1,5 @@
module.exports = { module.exports = {
testEnvironment: 'node', testEnvironment: 'jsdom',
testMatch: ['**/tests/unit/**/*.test.js'], testMatch: ['**/tests/unit/**/*.test.js'],
coverageDirectory: 'coverage', coverageDirectory: 'coverage',
coverageReporters: ['text', 'lcov', 'html'], coverageReporters: ['text', 'lcov', 'html'],
+4373
View File
File diff suppressed because it is too large Load Diff
+28
View File
@@ -0,0 +1,28 @@
{
"name": "3d-flight-simulator",
"version": "1.0.0",
"description": "3D Flight Simulator with retro 80s aesthetic",
"main": "src/js/main.js",
"scripts": {
"test": "jest",
"test:e2e": "playwright test",
"test:debug": "playwright test --debug",
"test:all": "npm test && npm run test:e2e"
},
"keywords": [
"3d",
"flight",
"simulator",
"threejs"
],
"author": "RetroWeb Games",
"license": "MIT",
"dependencies": {
"three": "^0.135.0"
},
"devDependencies": {
"@playwright/test": "^1.28.0",
"jest": "^29.0.0",
"jest-environment-jsdom": "^30.3.0"
}
}
+23
View File
@@ -0,0 +1,23 @@
/* Main styles for retro 80s aesthetic */
:root {
--primary-color: #00FF00;
--secondary-color: #000080;
--background-color: #000000;
--text-color: #FFFFFF;
--border-color: #00FF00;
}
* {
margin: 0;
padding: 0;
box-sizing: border-box;
}
body {
font-family: 'Courier New', monospace;
background-color: var(--background-color);
color: var(--text-color);
overflow: hidden;
height: 100vh;
}
+62
View File
@@ -0,0 +1,62 @@
/* Loading screen styles */
.loading-screen {
display: flex;
justify-content: center;
align-items: center;
height: 100vh;
width: 100vw;
background-color: var(--background-color);
position: relative;
}
.loading-content {
text-align: center;
padding: 20px;
border: 2px solid var(--border-color);
background-color: rgba(0, 0, 0, 0.8);
}
.logo {
margin-bottom: 20px;
}
.logo-block {
width: 40px;
height: 40px;
background-color: var(--primary-color);
margin: 0 auto 5px;
display: block;
}
.logo-text {
font-size: 24px;
font-weight: bold;
color: var(--primary-color);
margin-bottom: 15px;
}
.copyright {
font-size: 12px;
color: var(--text-color);
margin-bottom: 20px;
}
.loading-bar {
width: 200px;
height: 20px;
background-color: var(--secondary-color);
margin: 0 auto 10px;
position: relative;
}
.loading-progress {
width: 0%;
height: 100%;
background-color: var(--primary-color);
transition: width 0.3s ease;
}
.loading-text {
font-size: 14px;
color: var(--text-color);
}
+29
View File
@@ -0,0 +1,29 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>3D Flight Simulator - Loading</title>
<link rel="stylesheet" href="css/main.css">
<link rel="stylesheet" href="css/screens.css">
</head>
<body>
<div id="loading-screen" class="loading-screen">
<div class="loading-content">
<div class="logo">
<div class="logo-block"></div>
<div class="logo-block"></div>
<div class="logo-block"></div>
<div class="logo-text">WINGS88</div>
</div>
<div class="copyright">(c) 1988 RetroWeb Games</div>
<div class="loading-bar">
<div class="loading-progress"></div>
</div>
<div class="loading-text">Loading assets...</div>
</div>
</div>
<script src="js/screens/loading.js"></script>
</body>
</html>
+100
View File
@@ -0,0 +1,100 @@
/**
* Loading screen functionality for WINGS88 3D Flight Simulator
*/
class LoadingScreen {
constructor() {
this.progress = 0;
this.assets = [
'texture1.png',
'texture2.png',
'sound1.mp3',
'sound2.mp3',
'model1.obj',
'model2.obj'
];
this.audioContext = null;
this.audioBuffer = null;
}
init() {
this.setupEventListeners();
this.startLoading();
this.initAudio();
}
setupEventListeners() {
document.addEventListener('DOMContentLoaded', () => {
this.init();
});
}
startLoading() {
const progressBar = document.querySelector('.loading-progress');
const loadingText = document.querySelector('.loading-text');
const interval = setInterval(() => {
this.progress += 5;
if (progressBar) progressBar.style.width = `${this.progress}%`;
if (this.progress >= 100) {
clearInterval(interval);
if (loadingText) loadingText.textContent = 'Loading complete! Starting game...';
setTimeout(() => {
this.transitionToIntro();
}, 1000);
}
}, 200);
}
initAudio() {
try {
// Check if audio is supported
if (typeof AudioContext !== 'undefined') {
this.audioContext = new AudioContext();
this.loadBackgroundMusic();
}
} catch (e) {
console.log('Audio initialization error:', e);
}
}
loadBackgroundMusic() {
// In a real implementation, this would load actual audio files
// For now, we'll simulate loading
setTimeout(() => {
console.log('Background music loaded');
}, 500);
}
playBackgroundMusic() {
if (this.audioContext && this.audioBuffer) {
const source = this.audioContext.createBufferSource();
source.buffer = this.audioBuffer;
source.connect(this.audioContext.destination);
source.start(0);
}
}
transitionToIntro() {
// In a real implementation, this would transition to the intro screen
console.log('Transitioning to intro screen');
// For now, we'll just log the transition
document.querySelector('.loading-text').textContent = 'Welcome to WINGS88!';
}
getProgress() {
return this.progress;
}
}
// Initialize loading screen when DOM is ready
document.addEventListener('DOMContentLoaded', () => {
const loadingScreen = new LoadingScreen();
loadingScreen.init();
});
// Export for testing
if (typeof module !== 'undefined' && module.exports) {
module.exports = LoadingScreen;
}
+7
View File
@@ -0,0 +1,7 @@
{
"status": "failed",
"failedTests": [
"f849686cfb98f196064d-23081eeb2cc588b92600",
"f849686cfb98f196064d-c8ff80318a230bad1c44"
]
}
+46
View File
@@ -0,0 +1,46 @@
/**
* Unit tests for LoadingScreen class
*/
const LoadingScreen = require('../../src/js/screens/loading');
describe('LoadingScreen', () => {
let loadingScreen;
beforeEach(() => {
loadingScreen = new LoadingScreen();
});
describe('constructor', () => {
it('should initialize with progress 0', () => {
expect(loadingScreen.getProgress()).toBe(0);
});
it('should have assets array', () => {
expect(loadingScreen.assets).toBeDefined();
expect(Array.isArray(loadingScreen.assets)).toBe(true);
expect(loadingScreen.assets.length).toBeGreaterThan(0);
});
});
describe('getProgress', () => {
it('should return current progress', () => {
expect(loadingScreen.getProgress()).toBe(0);
// Simulate progress update
loadingScreen.progress = 50;
expect(loadingScreen.getProgress()).toBe(50);
});
});
describe('asset loading', () => {
it('should have expected assets', () => {
expect(loadingScreen.assets).toContain('texture1.png');
expect(loadingScreen.assets).toContain('texture2.png');
expect(loadingScreen.assets).toContain('sound1.mp3');
expect(loadingScreen.assets).toContain('sound2.mp3');
expect(loadingScreen.assets).toContain('model1.obj');
expect(loadingScreen.assets).toContain('model2.obj');
});
});
});