jquery实现随机拼图小游戏代码
代码语言:html
所属分类:游戏
代码描述:jquery实现随机拼图小游戏代码
下面为部分代码预览,完整代码请点击下载或在bfwstudio webide中打开
<!DOCTYPE html>
<html lang="en" >
<head>
<meta charset="UTF-8">
<style>
@import url("https://fonts.googleapis.com/css2?family=Creepster&family=Poppins:wght@600&display=swap");
body, html {
height: 100%;
}
body {
display: flex;
justify-content: center;
align-items: center;
flex-direction: column;
gap: 20px;
background: #222;
background: radial-gradient(#000, #333);
font-family: "Creepster", sans-serif;
}
#grid {
width: 400px;
min-height: 400px;
background: #1a1a1a;
box-shadow: inset 0 0 10px #000, 0 0 10px #000;
position: relative;
overflow: hidden;
border-radius: 6px;
}
#grid div {
width: 80px;
height: 80px;
background-image: url("//repo.bfw.wiki/bfwrepo/image/60d41f5173b0d.png");
background-repeat: no-repeat;
background-size: 400px auto;
position: absolute;
transition: top 0.2s ease-in-out, left 0.2s ease-in-out, opacity 0.5s ease-in-out 0.2s;
cursor: pointer;
}
#grid.alt div {
background-image: url("//repo.bfw.wiki/bfwrepo/image/60d41f5173b0d.png");
}
#grid div:nth-child(1) {
top: 0px;
left: 0px;
background-position: 0px 0px;
}
#grid div:nth-child(2) {
top: 0px;
left: 80px;
background-position: -80px 0px;
}
#grid div:nth-child(3) {
top: 0px;
left: 160px;
background-position: -160px 0px;
}
#grid div:nth-child(4) {
top: 0px;
left: 240px;
background-position: -240px 0px;
}
#grid div:nth-child(5) {
top: 0px;
left: 320px;
background-position: -320px 0px;
}
#grid div:nt.........完整代码请登录后点击上方下载按钮下载查看
















网友评论0