js+css实现儿童贴纸拖拽装饰小屋房间代码
代码语言:html
所属分类:拖放
代码描述:js+css实现儿童贴纸拖拽装饰小屋房间代码
代码标签: js css 儿童 贴纸 拖拽 装饰 小屋 房间 代码
下面为部分代码预览,完整代码请点击下载或在bfwstudio webide中打开
<!DOCTYPE html>
<html lang="zh">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>🏠 装饰我的小房间 - 儿童拼图游戏</title>
<style>
* {
margin: 0;
padding: 0;
box-sizing: border-box;
}
body {
font-family: 'Comic Sans MS', cursive, sans-serif;
background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
min-height: 100vh;
overflow-x: hidden;
}
.game-container {
max-width: 1200px;
margin: 0 auto;
padding: 20px;
}
.game-title {
text-align: center;
color: white;
font-size: 2.5em;
text-shadow: 3px 3px 6px rgba(0,0,0,0.3);
margin-bottom: 20px;
animation: bounce 2s infinite;
}
@keyframes bounce {
0%, 100% { transform: translateY(0); }
50% { transform: translateY(-10px); }
}
.game-area {
display: flex;
gap: 20px;
flex-wrap: wrap;
justify-content: center;
}
/* 房间区域 */
.room-container {
background: white;
border-radius: 20px;
padding: 15px;
box-shadow: 0 10px 40px rgba(0,0,0,0.3);
}
.room {
width: 600px;
height: 450px;
background: linear-gradient(180deg, #87CEEB 0%, #87CEEB 60%, #8B4513 60%, #8B4513 100%);
border-radius: 15px;
position: relative;
overflow: hidden;
border: 5px solid #DEB887;
}
/* 房间装饰 */
.room::before {
content: '';
position: absolute;
top: 60%;
left: 0;
right: 0;
bottom: 0;
background: repeating-linear-gradient(
90deg,
#DEB887 0px,
#DEB887 50px,
#D2691E 50px,
#D2691E 52px
);
}
.wall-decoration {
position: absolute;
top: 0;
left: 0;
right: 0;
height: 60%;
background: linear-gradient(180deg, #FFE4B5 0%, #FFDAB9 100%);
}
/* 窗户 */
.window {
position: absolute;
top: 10%;
left: 50%;
transform: translateX(-50%);
width: 120px;
height: 100px;
background: linear-gradient(180deg, #87CEEB 0%, #ADD8E6 100%);
border: 8px solid #8B4513;
border-radius: 10px 10px 0 0;
z-index: 1;
}
.window::before {
content: '';
position: absolute;
top: 0;
left: 50%;
transform: translateX(-50%);
width: 4px;
height: 100%;
background: #8B4513;
}
.window::after {
content: '';
position: absolute;
top: 50%;
left: 0;
width: 100%;
height: 4px;
background: #8B4513;
}
/* 物品面板 */
.items-panel {
background: white;
border-radius: 20px;
padding: 20px;
box-shadow: 0 10px 40px rgba(0,0,0,0.3);
max-width: 300px;
}
.panel-title {
text-align: center;
color: #764ba2;
font-size: 1.5em;
margin-bottom: 15px;
border-bottom: 3px dashed #667eea;
padding-bottom: 10px;
}
.category-tabs {
.........完整代码请登录后点击上方下载按钮下载查看
















网友评论0