From 4ada6a738f8f9db245e8cf984096ca99e1c1f418 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=B5=B5=E9=91=AB?= <7176466@qq.com> Date: Sun, 21 Aug 2022 00:41:48 +0800 Subject: [PATCH] =?UTF-8?q?=E6=95=B4=E7=90=86=E4=B8=80=E4=B8=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- public/style.css | 65 ++++++++++++++++++------------------------------ 1 file changed, 24 insertions(+), 41 deletions(-) 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; +}