diff --git a/public/style.css b/public/style.css index 731c761..7b39755 100644 --- a/public/style.css +++ b/public/style.css @@ -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; +}