js记忆卡片游戏
代码语言:html
所属分类:游戏
下面为部分代码预览,完整代码请点击下载或在bfwstudio webide中打开
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width,initial-scale=1,maximum-scale=1">
<link rel='stylesheet' href='http://repo.bfw.wiki/bfwrepo/css/luda-default.min.css'>
<style>
html,
body{
height: 100%;
}
.memory-card-game{
position: relative;
display: flex;
flex-wrap: wrap;
height: 100%;
background: #383838;
}
.timeline{
position: absolute;
z-index: 1;
left: 0;
top: 0;
width: 100%;
height: 0.8rem;
pointer-events: none;
}
.timeline > div{
height: 100%;
background: #d12626;
opacity: 0.9;
box-shadow: 0 1px 5px rgba(0, 0, 0, 0.3);
transform: translate3d(-100%, 0, 0);
transition: transform 0.2s ease;
}
.card{
position: relative;
flex: 0 0 25%;
overflow: hidden;
background: #fa73a0;
border: solid 2px #383838;
cursor: pointer;
}
.card::before{
content: '';
position: absolute;
left: 0;
top: 0;
width: 101%;
height: 101%;
background: #383838;
opacity: 0;
transform: translate3d(0, 0, 0);
transition: opacity 0.3s ease;
}
.card.active::before,
.card.hidden::before{
opacity: 1;
}
.card img{
position: absolute;
left: 0;
right: 0;
top: 0;
bottom: 0;
display: block;
max-width: 100%;
max-height: 100%;
padding: 0.5rem;
margin: auto;
transition: opacity, transform 0.3s ease;
}
.card.active i.........完整代码请登录后点击上方下载按钮下载查看
















网友评论0