Files
CodeLikeDemo/index.html
2026-03-27 18:21:29 +08:00

48 lines
1.4 KiB
HTML

<!DOCTYPE html>
<html lang="zh-CN">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Project Vibe: Ship It! - 完整流程高保真原型</title>
<!-- 引入 TailwindCSS CDN -->
<script src="https://cdn.tailwindcss.com"></script>
<!-- 引入自定义样式 -->
<link rel="stylesheet" href="./css/main.css">
</head>
<body class="h-screen w-screen relative overflow-hidden bg-[#1e1e2f] select-none font-sans text-slate-100">
<div id="app-container"></div>
<!-- 引入主逻辑前,先加载视图 -->
<script>
async function loadViews() {
const views = ['screen-start', 'screen-game', 'screen-win', 'screen-gameover'];
const container = document.getElementById('app-container');
for(let v of views) {
const res = await fetch('./views/' + v + '.html');
const htmlStr = await res.text();
const div = document.createElement('div');
div.innerHTML = htmlStr;
container.appendChild(div.firstElementChild);
}
// 加载完成后加载主脚本
const script = document.createElement('script');
script.src = './js/main.js';
document.body.appendChild(script);
}
loadViews();
</script>
</body>
</html>