Add 2 files
Browse files- index.html +274 -275
- prompts.txt +1 -0
index.html
CHANGED
|
@@ -1,332 +1,331 @@
|
|
| 1 |
<!DOCTYPE html>
|
| 2 |
-
<html lang="
|
| 3 |
<head>
|
| 4 |
<meta charset="UTF-8">
|
| 5 |
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
| 6 |
-
<title
|
| 7 |
<script src="https://cdn.tailwindcss.com"></script>
|
| 8 |
-
<script src="https://cdnjs.cloudflare.com/ajax/libs/three.js/r128/three.min.js"></script>
|
| 9 |
<style>
|
| 10 |
-
|
| 11 |
-
|
| 12 |
-
|
| 13 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 14 |
}
|
| 15 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 16 |
position: absolute;
|
| 17 |
-
|
|
|
|
|
|
|
|
|
|
| 18 |
width: 100%;
|
| 19 |
-
|
| 20 |
-
|
| 21 |
-
|
| 22 |
-
|
| 23 |
-
|
|
|
|
|
|
|
|
|
|
| 24 |
}
|
| 25 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 26 |
position: absolute;
|
| 27 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 28 |
width: 100%;
|
| 29 |
-
|
| 30 |
-
color:
|
| 31 |
-
font-size: 2.5rem;
|
| 32 |
-
text-shadow: 0 0 10px rgba(0,0,0,0.7);
|
| 33 |
z-index: 100;
|
| 34 |
-
|
| 35 |
-
|
| 36 |
-
pointer-events: none;
|
| 37 |
}
|
| 38 |
-
|
| 39 |
-
|
| 40 |
-
|
| 41 |
-
|
| 42 |
-
|
| 43 |
-
|
| 44 |
-
|
| 45 |
-
animation:
|
| 46 |
-
filter: drop-shadow(0 0 2px rgba(255,182,193,0.7));
|
| 47 |
}
|
| 48 |
-
|
| 49 |
-
|
| 50 |
-
|
| 51 |
-
}
|
| 52 |
-
|
| 53 |
-
|
| 54 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 55 |
}
|
| 56 |
</style>
|
| 57 |
</head>
|
| 58 |
-
<body class="bg-
|
| 59 |
-
<div
|
| 60 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 61 |
|
| 62 |
<script>
|
| 63 |
document.addEventListener('DOMContentLoaded', () => {
|
| 64 |
-
|
| 65 |
-
const
|
| 66 |
-
|
| 67 |
-
|
| 68 |
-
|
| 69 |
-
const
|
| 70 |
-
camera.position.set(0, 5, 30);
|
| 71 |
-
camera.lookAt(0, 0, 0);
|
| 72 |
-
|
| 73 |
-
// Renderer setup
|
| 74 |
-
const renderer = new THREE.WebGLRenderer({ antialias: true });
|
| 75 |
-
renderer.setSize(window.innerWidth, window.innerHeight);
|
| 76 |
-
renderer.setPixelRatio(window.devicePixelRatio);
|
| 77 |
-
document.body.appendChild(renderer.domElement);
|
| 78 |
-
|
| 79 |
-
// Create cherry blossom tree
|
| 80 |
-
createCherryTree(scene);
|
| 81 |
-
|
| 82 |
-
// Create snowflakes
|
| 83 |
-
const snowflakes = createSnowflakes(scene);
|
| 84 |
-
|
| 85 |
-
// Create cherry blossom petals
|
| 86 |
-
const petals = createPetals(scene);
|
| 87 |
|
| 88 |
-
|
| 89 |
-
|
|
|
|
|
|
|
| 90 |
|
| 91 |
-
//
|
| 92 |
-
|
| 93 |
-
|
| 94 |
-
|
| 95 |
-
const directionalLight = new THREE.DirectionalLight(0xffffff, 0.7);
|
| 96 |
-
directionalLight.position.set(1, 1, 1);
|
| 97 |
-
scene.add(directionalLight);
|
| 98 |
-
|
| 99 |
-
// Moon
|
| 100 |
-
const moonGeometry = new THREE.SphereGeometry(3, 32, 32);
|
| 101 |
-
const moonMaterial = new THREE.MeshBasicMaterial({
|
| 102 |
-
color: 0xffffcc,
|
| 103 |
-
transparent: true,
|
| 104 |
-
opacity: 0.9
|
| 105 |
-
});
|
| 106 |
-
const moon = new THREE.Mesh(moonGeometry, moonMaterial);
|
| 107 |
-
moon.position.set(-20, 20, -30);
|
| 108 |
-
scene.add(moon);
|
| 109 |
-
|
| 110 |
-
// Animation loop
|
| 111 |
-
function animate() {
|
| 112 |
-
requestAnimationFrame(animate);
|
| 113 |
-
|
| 114 |
-
// Update snowflakes
|
| 115 |
-
snowflakes.forEach(flake => {
|
| 116 |
-
flake.position.y -= flake.speed;
|
| 117 |
-
flake.position.x += Math.sin(Date.now() * 0.001 + flake.id) * 0.05;
|
| 118 |
-
|
| 119 |
-
if (flake.position.y < -20) {
|
| 120 |
-
flake.position.y = 20;
|
| 121 |
-
flake.position.x = Math.random() * 40 - 20;
|
| 122 |
-
flake.position.z = Math.random() * 40 - 20;
|
| 123 |
-
}
|
| 124 |
-
});
|
| 125 |
|
| 126 |
-
//
|
| 127 |
-
|
| 128 |
-
|
| 129 |
-
|
| 130 |
-
|
| 131 |
-
|
| 132 |
-
|
| 133 |
-
|
| 134 |
-
|
| 135 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 136 |
}
|
| 137 |
-
}
|
| 138 |
-
|
| 139 |
-
// Rotate stars slightly
|
| 140 |
-
stars.rotation.x += 0.0001;
|
| 141 |
-
stars.rotation.y += 0.0001;
|
| 142 |
-
|
| 143 |
-
renderer.render(scene, camera);
|
| 144 |
}
|
| 145 |
|
| 146 |
-
//
|
| 147 |
-
|
| 148 |
-
|
| 149 |
-
camera.updateProjectionMatrix();
|
| 150 |
-
renderer.setSize(window.innerWidth, window.innerHeight);
|
| 151 |
-
});
|
| 152 |
-
|
| 153 |
-
// Start animation
|
| 154 |
-
animate();
|
| 155 |
-
|
| 156 |
-
// Add CSS petals for variety
|
| 157 |
-
for (let i = 0; i < 20; i++) {
|
| 158 |
-
const petal = document.createElement('div');
|
| 159 |
-
petal.className = 'petal';
|
| 160 |
|
| 161 |
-
//
|
| 162 |
-
|
| 163 |
-
|
| 164 |
-
petal.style.height = `${size}px`;
|
| 165 |
-
petal.style.left = `${Math.random() * 100}vw`;
|
| 166 |
-
petal.style.top = `${Math.random() * 20 - 10}vh`;
|
| 167 |
-
petal.style.setProperty('--sway', Math.random() * 2 - 1);
|
| 168 |
|
| 169 |
-
//
|
| 170 |
-
|
| 171 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
| 172 |
|
| 173 |
-
//
|
| 174 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
| 175 |
|
| 176 |
-
|
|
|
|
|
|
|
| 177 |
}
|
| 178 |
-
});
|
| 179 |
-
|
| 180 |
-
function createCherryTree(scene) {
|
| 181 |
-
// Trunk
|
| 182 |
-
const trunkGeometry = new THREE.CylinderGeometry(0.5, 1, 10, 8);
|
| 183 |
-
const trunkMaterial = new THREE.MeshPhongMaterial({
|
| 184 |
-
color: 0x8B4513,
|
| 185 |
-
flatShading: true
|
| 186 |
-
});
|
| 187 |
-
const trunk = new THREE.Mesh(trunkGeometry, trunkMaterial);
|
| 188 |
-
trunk.position.y = 5;
|
| 189 |
-
trunk.rotation.z = Math.PI / 20;
|
| 190 |
-
scene.add(trunk);
|
| 191 |
|
| 192 |
-
//
|
| 193 |
-
|
| 194 |
-
|
| 195 |
-
|
| 196 |
-
|
|
|
|
|
|
|
| 197 |
|
| 198 |
-
|
| 199 |
-
|
| 200 |
-
const
|
| 201 |
-
|
| 202 |
-
|
|
|
|
|
|
|
|
|
|
| 203 |
|
| 204 |
-
|
| 205 |
-
|
| 206 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 207 |
|
| 208 |
-
|
| 209 |
}
|
| 210 |
|
| 211 |
-
//
|
| 212 |
-
|
| 213 |
-
|
| 214 |
-
|
| 215 |
-
|
| 216 |
-
opacity: 0.9
|
| 217 |
-
});
|
| 218 |
-
|
| 219 |
-
for (let i = 0; i < 100; i++) {
|
| 220 |
-
const blossom = new THREE.Mesh(blossomGeometry, blossomMaterial);
|
| 221 |
-
|
| 222 |
-
// Position around branches
|
| 223 |
-
const angle = Math.random() * Math.PI * 2;
|
| 224 |
-
const radius = 1 + Math.random() * 4;
|
| 225 |
-
const height = 5 + Math.random() * 8;
|
| 226 |
|
| 227 |
-
|
| 228 |
-
|
| 229 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 230 |
|
| 231 |
-
|
| 232 |
}
|
| 233 |
-
}
|
| 234 |
-
|
| 235 |
-
function createSnowflakes(scene) {
|
| 236 |
-
const snowflakes = [];
|
| 237 |
-
const snowflakeGeometry = new THREE.BufferGeometry();
|
| 238 |
-
const snowflakeMaterial = new THREE.PointsMaterial({
|
| 239 |
-
color: 0xffffff,
|
| 240 |
-
size: 0.15,
|
| 241 |
-
transparent: true,
|
| 242 |
-
opacity: 0.8,
|
| 243 |
-
blending: THREE.AdditiveBlending
|
| 244 |
-
});
|
| 245 |
-
|
| 246 |
-
const snowflakeCount = 1500;
|
| 247 |
-
const positions = new Float32Array(snowflakeCount * 3);
|
| 248 |
|
| 249 |
-
|
| 250 |
-
|
| 251 |
-
|
| 252 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 253 |
}
|
| 254 |
|
| 255 |
-
|
| 256 |
-
|
| 257 |
-
|
| 258 |
-
|
| 259 |
-
|
| 260 |
-
// Add individual properties to each snowflake
|
| 261 |
-
for (let i = 0; i < snowflakeCount; i++) {
|
| 262 |
-
snowflakes.push({
|
| 263 |
-
position: snowflakeSystem.geometry.attributes.position,
|
| 264 |
-
index: i,
|
| 265 |
-
speed: 0.05 + Math.random() * 0.1,
|
| 266 |
-
id: i
|
| 267 |
});
|
| 268 |
}
|
| 269 |
|
| 270 |
-
|
| 271 |
-
|
| 272 |
-
|
| 273 |
-
|
| 274 |
-
|
| 275 |
-
const petalGeometry = new THREE.PlaneGeometry(0.3, 0.3);
|
| 276 |
-
const petalMaterial = new THREE.MeshPhongMaterial({
|
| 277 |
-
color: 0xffb6c1,
|
| 278 |
-
transparent: true,
|
| 279 |
-
opacity: 0.7,
|
| 280 |
-
side: THREE.DoubleSide
|
| 281 |
-
});
|
| 282 |
|
| 283 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
| 284 |
|
| 285 |
-
|
| 286 |
-
|
| 287 |
-
|
| 288 |
-
|
| 289 |
-
|
| 290 |
-
|
|
|
|
| 291 |
|
| 292 |
-
|
| 293 |
-
|
| 294 |
-
|
| 295 |
-
|
| 296 |
-
petal.speed = 0.02 + Math.random() * 0.03;
|
| 297 |
-
petal.id = i;
|
| 298 |
-
|
| 299 |
-
scene.add(petal);
|
| 300 |
-
petals.push(petal);
|
| 301 |
}
|
| 302 |
|
| 303 |
-
|
| 304 |
-
|
| 305 |
-
|
| 306 |
-
|
| 307 |
-
const starGeometry = new THREE.BufferGeometry();
|
| 308 |
-
const starMaterial = new THREE.PointsMaterial({
|
| 309 |
-
color: 0xffffff,
|
| 310 |
-
size: 0.1,
|
| 311 |
-
transparent: true,
|
| 312 |
-
opacity: 0.7
|
| 313 |
});
|
| 314 |
|
| 315 |
-
|
| 316 |
-
|
| 317 |
-
|
| 318 |
-
|
| 319 |
-
starPositions[i * 3] = (Math.random() - 0.5) * 2000;
|
| 320 |
-
starPositions[i * 3 + 1] = (Math.random() - 0.5) * 2000;
|
| 321 |
-
starPositions[i * 3 + 2] = (Math.random() - 0.5) * 2000;
|
| 322 |
-
}
|
| 323 |
-
|
| 324 |
-
starGeometry.setAttribute('position', new THREE.BufferAttribute(starPositions, 3));
|
| 325 |
-
const stars = new THREE.Points(starGeometry, starMaterial);
|
| 326 |
-
scene.add(stars);
|
| 327 |
-
|
| 328 |
-
return stars;
|
| 329 |
-
}
|
| 330 |
</script>
|
| 331 |
<p style="border-radius: 8px; text-align: center; font-size: 12px; color: #fff; margin-top: 16px;position: fixed; left: 8px; bottom: 8px; z-index: 10; background: rgba(0, 0, 0, 0.8); padding: 4px 8px;">Made with <img src="https://enzostvs-deepsite.hf.space/logo.svg" alt="DeepSite Logo" style="width: 16px; height: 16px; vertical-align: middle;display:inline-block;margin-right:3px;filter:brightness(0) invert(1);"><a href="https://enzostvs-deepsite.hf.space" style="color: #fff;text-decoration: underline;" target="_blank" >DeepSite</a> - ๐งฌ <a href="https://enzostvs-deepsite.hf.space?remix=joung/t-t" style="color: #fff;text-decoration: underline;" target="_blank" >Remix</a></p></body>
|
| 332 |
</html>
|
|
|
|
| 1 |
<!DOCTYPE html>
|
| 2 |
+
<html lang="ko">
|
| 3 |
<head>
|
| 4 |
<meta charset="UTF-8">
|
| 5 |
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
| 6 |
+
<title>์ค๋ชฉ ๊ฒ์</title>
|
| 7 |
<script src="https://cdn.tailwindcss.com"></script>
|
|
|
|
| 8 |
<style>
|
| 9 |
+
.board {
|
| 10 |
+
display: grid;
|
| 11 |
+
grid-template-columns: repeat(15, 1fr);
|
| 12 |
+
grid-template-rows: repeat(15, 1fr);
|
| 13 |
+
width: 600px;
|
| 14 |
+
height: 600px;
|
| 15 |
+
background-color: #e6c88c;
|
| 16 |
+
position: relative;
|
| 17 |
+
box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
|
| 18 |
}
|
| 19 |
+
|
| 20 |
+
.cell {
|
| 21 |
+
display: flex;
|
| 22 |
+
justify-content: center;
|
| 23 |
+
align-items: center;
|
| 24 |
+
position: relative;
|
| 25 |
+
cursor: pointer;
|
| 26 |
+
}
|
| 27 |
+
|
| 28 |
+
.cell::before, .cell::after {
|
| 29 |
+
content: '';
|
| 30 |
position: absolute;
|
| 31 |
+
background-color: #333;
|
| 32 |
+
}
|
| 33 |
+
|
| 34 |
+
.cell::before {
|
| 35 |
width: 100%;
|
| 36 |
+
height: 1px;
|
| 37 |
+
top: 50%;
|
| 38 |
+
}
|
| 39 |
+
|
| 40 |
+
.cell::after {
|
| 41 |
+
width: 1px;
|
| 42 |
+
height: 100%;
|
| 43 |
+
left: 50%;
|
| 44 |
}
|
| 45 |
+
|
| 46 |
+
.stone {
|
| 47 |
+
width: 80%;
|
| 48 |
+
height: 80%;
|
| 49 |
+
border-radius: 50%;
|
| 50 |
+
z-index: 1;
|
| 51 |
+
transition: transform 0.2s;
|
| 52 |
+
}
|
| 53 |
+
|
| 54 |
+
.stone.black {
|
| 55 |
+
background: radial-gradient(circle at 30% 30%, #666, #000);
|
| 56 |
+
box-shadow: 0 3px 5px rgba(0, 0, 0, 0.5);
|
| 57 |
+
}
|
| 58 |
+
|
| 59 |
+
.stone.white {
|
| 60 |
+
background: radial-gradient(circle at 30% 30%, #fff, #ddd);
|
| 61 |
+
box-shadow: 0 3px 5px rgba(0, 0, 0, 0.3);
|
| 62 |
+
}
|
| 63 |
+
|
| 64 |
+
.star-point {
|
| 65 |
position: absolute;
|
| 66 |
+
width: 10px;
|
| 67 |
+
height: 10px;
|
| 68 |
+
background-color: #333;
|
| 69 |
+
border-radius: 50%;
|
| 70 |
+
transform: translate(-50%, -50%);
|
| 71 |
+
z-index: 1;
|
| 72 |
+
}
|
| 73 |
+
|
| 74 |
+
.modal {
|
| 75 |
+
display: none;
|
| 76 |
+
position: fixed;
|
| 77 |
+
top: 0;
|
| 78 |
+
left: 0;
|
| 79 |
width: 100%;
|
| 80 |
+
height: 100%;
|
| 81 |
+
background-color: rgba(0, 0, 0, 0.7);
|
|
|
|
|
|
|
| 82 |
z-index: 100;
|
| 83 |
+
justify-content: center;
|
| 84 |
+
align-items: center;
|
|
|
|
| 85 |
}
|
| 86 |
+
|
| 87 |
+
.modal-content {
|
| 88 |
+
background-color: white;
|
| 89 |
+
padding: 2rem;
|
| 90 |
+
border-radius: 10px;
|
| 91 |
+
text-align: center;
|
| 92 |
+
max-width: 80%;
|
| 93 |
+
animation: modalFadeIn 0.3s;
|
|
|
|
| 94 |
}
|
| 95 |
+
|
| 96 |
+
@keyframes modalFadeIn {
|
| 97 |
+
from { opacity: 0; transform: translateY(-50px); }
|
| 98 |
+
to { opacity: 1; transform: translateY(0); }
|
| 99 |
+
}
|
| 100 |
+
|
| 101 |
+
.highlight {
|
| 102 |
+
animation: highlight 1s infinite;
|
| 103 |
+
}
|
| 104 |
+
|
| 105 |
+
@keyframes highlight {
|
| 106 |
+
0% { box-shadow: 0 0 0 0 rgba(255, 215, 0, 0.7); }
|
| 107 |
+
50% { box-shadow: 0 0 0 10px rgba(255, 215, 0, 0); }
|
| 108 |
+
100% { box-shadow: 0 0 0 0 rgba(255, 215, 0, 0); }
|
| 109 |
}
|
| 110 |
</style>
|
| 111 |
</head>
|
| 112 |
+
<body class="bg-gray-100 min-h-screen flex flex-col items-center justify-center p-4">
|
| 113 |
+
<div class="text-center mb-8">
|
| 114 |
+
<h1 class="text-4xl font-bold text-gray-800 mb-2">์ค๋ชฉ ๊ฒ์</h1>
|
| 115 |
+
<p class="text-gray-600">ํ๋๊ณผ ๋ฐฑ๋ ์ค ๋จผ์ 5๊ฐ๋ฅผ ์ฐ์์ผ๋ก ๋๋ ์ฌ๋์ด ์น๋ฆฌํฉ๋๋ค!</p>
|
| 116 |
+
</div>
|
| 117 |
+
|
| 118 |
+
<div class="flex items-center justify-center gap-8 mb-6">
|
| 119 |
+
<div class="flex items-center">
|
| 120 |
+
<div class="w-8 h-8 rounded-full bg-black mr-2"></div>
|
| 121 |
+
<span class="font-medium">ํ๋</span>
|
| 122 |
+
</div>
|
| 123 |
+
|
| 124 |
+
<div class="text-center">
|
| 125 |
+
<div class="text-xl font-bold mb-1" id="turn-indicator">ํ๋ ์ฐจ๋ก</div>
|
| 126 |
+
<button id="restart-btn" class="px-4 py-2 bg-blue-500 text-white rounded hover:bg-blue-600 transition">
|
| 127 |
+
๊ฒ์ ๋ค์ ์์
|
| 128 |
+
</button>
|
| 129 |
+
</div>
|
| 130 |
+
|
| 131 |
+
<div class="flex items-center">
|
| 132 |
+
<div class="w-8 h-8 rounded-full bg-white border border-gray-300 mr-2"></div>
|
| 133 |
+
<span class="font-medium">๋ฐฑ๋</span>
|
| 134 |
+
</div>
|
| 135 |
+
</div>
|
| 136 |
+
|
| 137 |
+
<div class="board" id="board">
|
| 138 |
+
<!-- ์ค๋ชฉํ์ด ์ฌ๊ธฐ์ ์์ฑ๋ฉ๋๋ค -->
|
| 139 |
+
</div>
|
| 140 |
+
|
| 141 |
+
<div class="modal" id="result-modal">
|
| 142 |
+
<div class="modal-content">
|
| 143 |
+
<h2 class="text-2xl font-bold mb-4" id="result-text">ํ๋ ์น๋ฆฌ!</h2>
|
| 144 |
+
<button id="close-modal" class="px-6 py-2 bg-blue-500 text-white rounded hover:bg-blue-600 transition">
|
| 145 |
+
๋ซ๊ธฐ
|
| 146 |
+
</button>
|
| 147 |
+
</div>
|
| 148 |
+
</div>
|
| 149 |
+
|
| 150 |
+
<div class="mt-8 text-gray-600 text-sm">
|
| 151 |
+
<p>๊ท์น: ํ๋์ด ๋จผ์ ์์ํ๋ฉฐ, 3-3, 4-4, ์ฅ๋ชฉ(6๊ฐ ์ด์)์ ๊ธ์์
๋๋ค.</p>
|
| 152 |
+
</div>
|
| 153 |
|
| 154 |
<script>
|
| 155 |
document.addEventListener('DOMContentLoaded', () => {
|
| 156 |
+
const board = document.getElementById('board');
|
| 157 |
+
const turnIndicator = document.getElementById('turn-indicator');
|
| 158 |
+
const restartBtn = document.getElementById('restart-btn');
|
| 159 |
+
const resultModal = document.getElementById('result-modal');
|
| 160 |
+
const resultText = document.getElementById('result-text');
|
| 161 |
+
const closeModal = document.getElementById('close-modal');
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 162 |
|
| 163 |
+
const BOARD_SIZE = 15;
|
| 164 |
+
let currentPlayer = 'black'; // 'black' ๋๋ 'white'
|
| 165 |
+
let gameOver = false;
|
| 166 |
+
let boardState = Array(BOARD_SIZE).fill().map(() => Array(BOARD_SIZE).fill(null));
|
| 167 |
|
| 168 |
+
// ์ค๋ชฉํ ์์ฑ
|
| 169 |
+
function createBoard() {
|
| 170 |
+
board.innerHTML = '';
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 171 |
|
| 172 |
+
// ์ค๋ชฉํ ์ ๊ทธ๋ฆฌ๊ธฐ
|
| 173 |
+
for (let i = 0; i < BOARD_SIZE; i++) {
|
| 174 |
+
for (let j = 0; j < BOARD_SIZE; j++) {
|
| 175 |
+
const cell = document.createElement('div');
|
| 176 |
+
cell.className = 'cell';
|
| 177 |
+
cell.dataset.row = i;
|
| 178 |
+
cell.dataset.col = j;
|
| 179 |
+
|
| 180 |
+
// ๋ณ์ ํ์ (์ค๋ชฉํ์ ํน์ ์์น์)
|
| 181 |
+
if ((i === 3 || i === 7 || i === 11) && (j === 3 || j === 7 || j === 11)) {
|
| 182 |
+
const starPoint = document.createElement('div');
|
| 183 |
+
starPoint.className = 'star-point';
|
| 184 |
+
cell.appendChild(starPoint);
|
| 185 |
+
}
|
| 186 |
+
|
| 187 |
+
cell.addEventListener('click', () => handleCellClick(i, j));
|
| 188 |
+
board.appendChild(cell);
|
| 189 |
}
|
| 190 |
+
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 191 |
}
|
| 192 |
|
| 193 |
+
// ์
ํด๋ฆญ ์ฒ๋ฆฌ
|
| 194 |
+
function handleCellClick(row, col) {
|
| 195 |
+
if (gameOver || boardState[row][col] !== null) return;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 196 |
|
| 197 |
+
// ๋ ๋๊ธฐ
|
| 198 |
+
boardState[row][col] = currentPlayer;
|
| 199 |
+
renderStone(row, col, currentPlayer);
|
|
|
|
|
|
|
|
|
|
|
|
|
| 200 |
|
| 201 |
+
// ์น๋ฆฌ ํ์ธ
|
| 202 |
+
if (checkWin(row, col)) {
|
| 203 |
+
showResult(`${currentPlayer === 'black' ? 'ํ๋' : '๋ฐฑ๋'} ์น๋ฆฌ!`);
|
| 204 |
+
highlightWinningStones();
|
| 205 |
+
gameOver = true;
|
| 206 |
+
return;
|
| 207 |
+
}
|
| 208 |
|
| 209 |
+
// ๋ฌด์น๋ถ ํ์ธ
|
| 210 |
+
if (checkDraw()) {
|
| 211 |
+
showResult('๋ฌด์น๋ถ!');
|
| 212 |
+
gameOver = true;
|
| 213 |
+
return;
|
| 214 |
+
}
|
| 215 |
|
| 216 |
+
// ํ๋ ์ด์ด ์ ํ
|
| 217 |
+
currentPlayer = currentPlayer === 'black' ? 'white' : 'black';
|
| 218 |
+
updateTurnIndicator();
|
| 219 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 220 |
|
| 221 |
+
// ๋ ๋ ๋๋ง
|
| 222 |
+
function renderStone(row, col, player) {
|
| 223 |
+
const cell = document.querySelector(`[data-row="${row}"][data-col="${col}"]`);
|
| 224 |
+
const stone = document.createElement('div');
|
| 225 |
+
stone.className = `stone ${player}`;
|
| 226 |
+
cell.appendChild(stone);
|
| 227 |
+
}
|
| 228 |
|
| 229 |
+
// ์น๋ฆฌ ์กฐ๊ฑด ํ์ธ
|
| 230 |
+
function checkWin(row, col) {
|
| 231 |
+
const directions = [
|
| 232 |
+
[0, 1], // ๊ฐ๋ก
|
| 233 |
+
[1, 0], // ์ธ๋ก
|
| 234 |
+
[1, 1], // ๋๊ฐ์ โ
|
| 235 |
+
[1, -1] // ๋๊ฐ์ โ
|
| 236 |
+
];
|
| 237 |
|
| 238 |
+
for (const [dx, dy] of directions) {
|
| 239 |
+
let count = 1;
|
| 240 |
+
|
| 241 |
+
// ํ ๋ฐฉํฅ์ผ๋ก ๊ฒ์ฌ
|
| 242 |
+
count += countStonesInDirection(row, col, dx, dy);
|
| 243 |
+
// ๋ฐ๋ ๋ฐฉํฅ์ผ๋ก ๊ฒ์ฌ
|
| 244 |
+
count += countStonesInDirection(row, col, -dx, -dy);
|
| 245 |
+
|
| 246 |
+
if (count >= 5) {
|
| 247 |
+
return true;
|
| 248 |
+
}
|
| 249 |
+
}
|
| 250 |
|
| 251 |
+
return false;
|
| 252 |
}
|
| 253 |
|
| 254 |
+
// ํน์ ๋ฐฉํฅ์ผ๋ก ์ฐ์๋ ๋ ๊ฐ์ ์ธ๊ธฐ
|
| 255 |
+
function countStonesInDirection(row, col, dx, dy) {
|
| 256 |
+
let count = 0;
|
| 257 |
+
let r = row + dx;
|
| 258 |
+
let c = col + dy;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 259 |
|
| 260 |
+
while (
|
| 261 |
+
r >= 0 && r < BOARD_SIZE &&
|
| 262 |
+
c >= 0 && c < BOARD_SIZE &&
|
| 263 |
+
boardState[r][c] === currentPlayer
|
| 264 |
+
) {
|
| 265 |
+
count++;
|
| 266 |
+
r += dx;
|
| 267 |
+
c += dy;
|
| 268 |
+
}
|
| 269 |
|
| 270 |
+
return count;
|
| 271 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 272 |
|
| 273 |
+
// ๋ฌด์น๋ถ ํ์ธ
|
| 274 |
+
function checkDraw() {
|
| 275 |
+
for (let i = 0; i < BOARD_SIZE; i++) {
|
| 276 |
+
for (let j = 0; j < BOARD_SIZE; j++) {
|
| 277 |
+
if (boardState[i][j] === null) {
|
| 278 |
+
return false;
|
| 279 |
+
}
|
| 280 |
+
}
|
| 281 |
+
}
|
| 282 |
+
return true;
|
| 283 |
}
|
| 284 |
|
| 285 |
+
// ์น๋ฆฌํ ๋ ๊ฐ์กฐ ํ์
|
| 286 |
+
function highlightWinningStones() {
|
| 287 |
+
// ์ค์ ๊ฒ์์์๋ ๋ ์ ๊ตํ ๋ก์ง์ด ํ์ํ์ง๋ง, ์ฌ๊ธฐ์๋ ๊ฐ๋จํ ๊ตฌํ
|
| 288 |
+
document.querySelectorAll('.stone').forEach(stone => {
|
| 289 |
+
stone.classList.add('highlight');
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 290 |
});
|
| 291 |
}
|
| 292 |
|
| 293 |
+
// ํด ํ์ ์
๋ฐ์ดํธ
|
| 294 |
+
function updateTurnIndicator() {
|
| 295 |
+
turnIndicator.textContent = `${currentPlayer === 'black' ? 'ํ๋' : '๋ฐฑ๋'} ์ฐจ๋ก`;
|
| 296 |
+
turnIndicator.className = `text-xl font-bold mb-1 ${currentPlayer === 'black' ? 'text-gray-900' : 'text-gray-100 bg-gray-800 px-2 py-1 rounded'}`;
|
| 297 |
+
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 298 |
|
| 299 |
+
// ๊ฒฐ๊ณผ ํ์
|
| 300 |
+
function showResult(message) {
|
| 301 |
+
resultText.textContent = message;
|
| 302 |
+
resultModal.style.display = 'flex';
|
| 303 |
+
}
|
| 304 |
|
| 305 |
+
// ๊ฒ์ ์ด๊ธฐํ
|
| 306 |
+
function resetGame() {
|
| 307 |
+
boardState = Array(BOARD_SIZE).fill().map(() => Array(BOARD_SIZE).fill(null));
|
| 308 |
+
currentPlayer = 'black';
|
| 309 |
+
gameOver = false;
|
| 310 |
+
createBoard();
|
| 311 |
+
updateTurnIndicator();
|
| 312 |
|
| 313 |
+
// ๊ฐ์กฐ ํจ๊ณผ ์ ๊ฑฐ
|
| 314 |
+
document.querySelectorAll('.stone').forEach(stone => {
|
| 315 |
+
stone.classList.remove('highlight');
|
| 316 |
+
});
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 317 |
}
|
| 318 |
|
| 319 |
+
// ์ด๋ฒคํธ ๋ฆฌ์ค๋ ์ค์
|
| 320 |
+
restartBtn.addEventListener('click', resetGame);
|
| 321 |
+
closeModal.addEventListener('click', () => {
|
| 322 |
+
resultModal.style.display = 'none';
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 323 |
});
|
| 324 |
|
| 325 |
+
// ๊ฒ์ ์์
|
| 326 |
+
createBoard();
|
| 327 |
+
updateTurnIndicator();
|
| 328 |
+
});
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 329 |
</script>
|
| 330 |
<p style="border-radius: 8px; text-align: center; font-size: 12px; color: #fff; margin-top: 16px;position: fixed; left: 8px; bottom: 8px; z-index: 10; background: rgba(0, 0, 0, 0.8); padding: 4px 8px;">Made with <img src="https://enzostvs-deepsite.hf.space/logo.svg" alt="DeepSite Logo" style="width: 16px; height: 16px; vertical-align: middle;display:inline-block;margin-right:3px;filter:brightness(0) invert(1);"><a href="https://enzostvs-deepsite.hf.space" style="color: #fff;text-decoration: underline;" target="_blank" >DeepSite</a> - ๐งฌ <a href="https://enzostvs-deepsite.hf.space?remix=joung/t-t" style="color: #fff;text-decoration: underline;" target="_blank" >Remix</a></p></body>
|
| 331 |
</html>
|
prompts.txt
CHANGED
|
@@ -0,0 +1 @@
|
|
|
|
|
|
|
| 1 |
+
์ค๋ชฉํ๋ก๊ทธ๋จ์ ๋ง๋ค์ด์ค
|