Spaces:
Running
Running
File size: 5,662 Bytes
2c77579 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 |
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Choose Your Own 3D Adventure Map</title>
<style>
body {
font-family: 'Courier New', monospace;
background-color: #1a1a1a; /* Slightly lighter dark */
color: #e0e0e0; /* Slightly softer white */
margin: 0;
padding: 0;
overflow: hidden;
display: flex;
flex-direction: column;
height: 100vh;
}
#game-container {
display: flex;
flex-grow: 1;
overflow: hidden;
}
#scene-container {
flex-grow: 3;
position: relative;
border-right: 2px solid #444; /* Darker border */
background-color: #000; /* Black background for scene */
}
#ui-container {
flex-grow: 2;
padding: 20px;
overflow-y: auto;
background-color: #2a2a2a; /* Dark UI area */
display: flex;
flex-direction: column;
border-left: 1px solid #444;
}
#story-title {
color: #ffd700; /* Gold */
margin-top: 0;
border-bottom: 1px solid #555;
padding-bottom: 10px;
font-size: 1.4em;
}
#story-content {
margin-bottom: 20px;
line-height: 1.6;
flex-grow: 1; /* Allow story to take up space */
}
#story-content p { margin: 0 0 1em 0; }
#choices-container {
margin-top: 10px; /* Reduced margin */
padding-top: 15px;
border-top: 1px solid #555;
}
#choices-container h3 {
margin-top: 0;
margin-bottom: 10px;
color: #aaa;
font-size: 1em;
text-transform: uppercase;
letter-spacing: 1px;
}
.choice-button {
display: block;
width: calc(100% - 22px); /* Account for padding/border */
padding: 12px 10px; /* Slightly more padding */
margin-bottom: 10px;
background-color: #444; /* Darker buttons */
color: #e0e0e0;
border: 1px solid #666;
border-radius: 5px;
cursor: pointer;
text-align: left;
font-family: 'Courier New', monospace;
font-size: 1em;
transition: background-color 0.2s, color 0.2s;
}
.choice-button:hover:not(:disabled) {
background-color: #ffd700; /* Gold hover */
color: #1a1a1a;
border-color: #fff;
}
.choice-button:disabled {
background-color: #333; /* Darker disabled */
color: #777;
cursor: not-allowed;
border-color: #555;
opacity: 0.7;
}
.choice-button[title]:disabled {
text-decoration: line-through; /* Indicate locked */
}
#stats-inventory-container {
margin-top: 20px;
padding: 15px 0;
border-top: 1px solid #555;
font-size: 0.9em;
}
#stats-inventory-container h4 {
margin: 0 0 8px 0;
color: #aaa;
font-size: 0.9em;
text-transform: uppercase;
letter-spacing: 1px;
}
#stats-display, #inventory-display {
margin-bottom: 15px;
line-height: 1.8; /* Spacing for badges */
}
#stats-display span, #inventory-display span {
display: inline-block;
background-color: #3a3a3a;
padding: 3px 10px;
border-radius: 15px;
margin-right: 8px;
margin-bottom: 6px; /* Wrap nicely */
border: 1px solid #555;
white-space: nowrap; /* Prevent badges breaking */
}
#inventory-display span { cursor: help; } /* Add tooltip cursor */
#inventory-display .item-quest { background-color: #666030; border-color: #999048;}
#inventory-display .item-weapon { background-color: #663030; border-color: #994848;}
#inventory-display .item-armor { background-color: #306630; border-color: #489948;}
#inventory-display .item-spell { background-color: #303066; border-color: #484899;}
#inventory-display .item-unknown { background-color: #555; border-color: #777;}
canvas { display: block; }
</style>
</head>
<body>
<div id="game-container">
<div id="scene-container"></div>
<div id="ui-container">
<h2 id="story-title">Loading Adventure...</h2>
<div id="story-content">
<p>Please wait while the adventure loads.</p>
</div>
<div id="stats-inventory-container">
<h4>Status</h4>
<div id="stats-display"></div>
<h4>Inventory</h4>
<div id="inventory-display"></div>
</div>
<div id="choices-container">
<h3>What will you do?</h3>
<div id="choices"></div>
</div>
</div>
</div>
<script type="importmap">
{
"imports": {
"three": "https://unpkg.com/[email protected]/build/three.module.js",
"three/addons/": "https://unpkg.com/[email protected]/examples/jsm/"
}
}
</script>
<script type="module" src="game.js"></script>
</body>
</html> |