整理一下

This commit is contained in:
赵鑫 2022-08-21 00:41:48 +08:00
parent deb700e3b4
commit 4ada6a738f

View File

@ -21,45 +21,22 @@ body {
#game,
#player1,
#player2 {
position: relative;
display: flex;
gap: 10px;
}
kbd {
padding: 4px 8px;
border: 1px solid #777;
border-radius: 0.25rem;
}
.score,
.shape {
min-width: 200px;
height: 200px;
display: flex;
justify-content: center;
align-items: center;
}
.shape {
border: 1px solid #777;
border-radius: 1rem;
}
#player1,
#player2 {
position: relative;
}
.name {
font-size: 2rem;
font-weight: 600;
position: absolute;
top: 0px;
}
#player1 .name {
left: 0px;
}
#player2 .name {
left: auto;
right: 0px;
}
@ -68,24 +45,30 @@ kbd {
padding: 0 1rem;
}
#player1 .shape,
#player2 .shape {
.score,
.shape {
min-width: 200px;
height: 200px;
display: flex;
align-items: center;
justify-content: center;
}
.shape {
border-radius: 1rem;
border: 1px solid #777;
background-repeat: no-repeat;
background-size: 200px 200px;
}
.rock {
background: url(rock.png);
}
.paper {
background: url(paper.png);
}
.scissors {
background: url(scissors.png);
transition: background-image 1s; /* 为什么没有作用? */
}
#player2 .shape {
transform: scaleX(-1);
}
kbd {
padding: 4px 8px;
border-radius: 0.25rem;
border: 1px solid #777;
background-color: #eee;
}