three实现三维3d消消乐游戏代码
代码语言:html
所属分类:游戏
代码描述:three实现三维3d消消乐游戏代码
下面为部分代码预览,完整代码请点击下载或在bfwstudio webide中打开
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=no">
<script type="text/javascript" src="//repo.bfw.wiki/bfwrepo/js/three.139.js"></script>
<script type="text/javascript" src="//repo.bfw.wiki/bfwrepo/js/tween.umd.js"></script>
<style>
/* --- CSS Variables and Basic Reset --- */
:root {
--primary-color: #4CAF50;
--secondary-color: #007bff;
--danger-color: #f44336;
--background-color: #000033;
--light-text: #ffffff;
--dark-text: #333333;
--overlay-bg: rgba(0, 0, 0, 0.85);
--win-overlay-bg: rgba(20, 100, 20, 0.9);
}
body {
margin: 0;
overflow: hidden;
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
background-color: var(--background-color);
color: var(--light-text);
position: fixed;
width: 100%;
height: 100%;
}
/* --- Screen Management --- */
.screen {
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
display: none;
flex-direction: column;
align-items: center;
justify-content: center;
padding: 20px;
box-sizing: border-box;
background-color: var(--background-color);
transition: opacity 0.5s ease;
opacity: 0;
}
.screen.active {
display: flex;
opacity: 1;
}
/* --- Splash Screen Styling --- */
#splash-screen {
background: radial-gradient(circle at center, #6b46c1 0%, #3b82f6 25%, #6b46c1 50%, #3b82f6 75%, #6b46c1 100%);
background-size: 100% 100%;
position: relative;
overflow: hidden;
}
#splash-screen::before {
content: '';
position: absolute;
top: 50%;
left: 50%;
width: 200%;
height: 200%;
background: conic-gradient(
from 0deg,
#6b46c1 0deg 22.5deg,
#3b82f6 22.5deg 45deg,
#6b46c1 45deg 67.5deg,
#3b82f6 67.5deg 90deg,
#6b46c1 90deg 112.5deg,
#3b82f6 112.5deg 135deg,
#6b46c1 135deg 157.5deg,
#3b82f6 157.5deg 180deg,
#6b46c1 180deg 202.5deg,
#3b82f6 202.5deg 225deg,
#6b46c1 225deg 247.5deg,
#3b82f6 247.5deg 270deg,
#6b46c1 270deg 292.5deg,
#3b82f6 292.5deg 315deg,
#6b46c1 315deg 337.5deg,
#3b82f6 337.5deg 360deg
);
transform: translate(-50%, -50%);
z-index: 1;
animation: rotate 20s linear infinite;
}
@keyframes rotate {
from { transform: translate(-50%, -50%) rotate(0deg); }
to { transform: translate(-50%, -50%) rotate(360deg); }
}
/* 3D Canvas for splash screen */
#splash-3d-container {
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
z-index: 2;
pointer-events: none;
}
.splash-content {
position: relative;
z-index: 10;
text-align: center;
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
width: 100%;
max-width: 500px;
}
.title-container {
text-align: center;
margin-bottom: 40px;
position: relative;
z-index: 10;
width: 100%;
}
.splash-title {
font-size: clamp(2.5rem, 10vw, 4.5rem);
font-weight: 900;
color: #ffffff;
text-shadow:
4px 4px 0px #000000,
-4px -4px 0px #000000,
4px -4px 0px #000000,
-4px 4px 0px #000000,
6px 6px 10px rgba(0, 0, 0, 0.8);
letter-spacing: 0.05em;
margin: 0;
line-height: 0.9;
}
.splash-subtitle {
font-size: clamp(1rem, 4vw, 1.5rem);
color: #ffffff;
margin-top: 10px;
margin-bottom: 0;
text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.8);
font-weight: 600;
}
.menu-container {
width: 100%;
max-width: 380px;
display: flex;
flex-direction: column;
align-items: center;
gap: 15px;
position: relative;
z-index: 10;
margin: 0 auto;
}
.btn {
padding: 18px 24px;
border-radius: 15px;
border: 4px solid #000000;
color: #ffffff;
cursor: pointer;
font-size: 1.4rem;
font-weight: 900;
text-transform: uppercase;
transition: transform 0.2s ease, background-color 0.3s ease, border-color 0.3s ease;
text-shadow: 2px 2px 0px #000000;
letter-spacing: 0.1em;
position: relative;
overflow: hidden;
pointer-events: all;
width: 100%;
max-width: 280px;
text-align: center;
}
.btn:hover {
transform: translateY(-3px) scale(1.05);
}
.btn:active {
transform: scale(0.96) translateY(0);
}
.btn-primary {
background: linear-gradient(135deg, #fbbf24 0%, #f59e0b 100%);
border-color: #000000;
box-shadow: 0 6px 0 #92400e, 0 8px 15px rgba(0, 0, 0, 0.3);
}
.btn-primary:hover {
box-shadow: 0 8px 0 #92400e, 0 12px 20px rgba(0, 0, 0, 0.4);
}
.btn-secondary {
background: linear-gradient(135deg, #3b82f6 0%, #1d4ed8 100%);
border-color: #000000;
box-shadow: 0 6px 0 #1e3a8a, 0 8px 15px rgba(0, 0, 0, 0.3);
}
.btn-secondary:hover {
box-shadow: 0 8px 0 #1e3a8a, 0 12px 20px rgba(0, 0, 0, 0.4);
}
.btn-danger {
background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
border-color: #000000;
box-shadow: 0 6px 0 #991b1b, 0 8px 15px rgba(0, 0, 0, 0.3);
}
.btn-danger:hover {
box-shadow: 0 8px 0 #991b1b, 0 12px 20px rgba(0, 0, 0, 0.4);
}
/* Floating CSS Shapes (smaller and fewer to complement 3D shapes) */
.floating-shapes {
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
.........完整代码请登录后点击上方下载按钮下载查看
















网友评论0