rock-paper-scissors/public/style.css
2022-08-21 00:41:48 +08:00

75 lines
1.0 KiB
CSS

* {
margin: 0px;
padding: 0px;
box-sizing: border-box;
}
body {
width: 100%;
height: 100vh;
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
user-select: none;
}
#game {
margin: 20px 0;
}
#game,
#player1,
#player2 {
position: relative;
display: flex;
gap: 10px;
}
.name {
font-size: 2rem;
font-weight: 600;
position: absolute;
}
#player1 .name {
left: 0px;
}
#player2 .name {
right: 0px;
}
.score {
font-size: 100px;
padding: 0 1rem;
}
.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;
transition: background-image 1s; /* 为什么没有作用? */
}
#player2 .shape {
transform: scaleX(-1);
}
kbd {
padding: 4px 8px;
border-radius: 0.25rem;
border: 1px solid #777;
background-color: #eee;
}