css+js实现石头剪刀布猜拳游戏代码
代码语言:html
所属分类:游戏
代码描述:css+js实现石头剪刀布猜拳游戏代码
下面为部分代码预览,完整代码请点击下载或在bfwstudio webide中打开
<!DOCTYPE html> <html lang="en" > <head> <meta charset="UTF-8"> <style> @charset "UTF-8"; /** Rock Paper Scissors Lizard Spock Game author: @chrisbautista website: https://www.codespud.com */ @import url("https://fonts.googleapis.com/css2?family=Fredoka+One&family=Source+Serif+Pro:ital@1&display=swap"); .visually-hidden { position: absolute; top: -9999px; left: -9999px; display: none; } body { font-family: serif; font-family: "Source Serif Pro", serif; background-color: #f1f2f3; } h1 { font-family: "Fredoka One", cursive; font-size: 2.3vw; margin-left: 2rem; text-align: left; background: -webkit-linear-gradient(red, green); background: linear-gradient(red, green); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; text-fill-color: transparent; margin-block-end: 0; } @media screen and (max-width: 1200px) { h1 { font-size: 3vw; } } @media screen and (max-width: 900px) { h1 { font-size: 4vw; } } @media screen and (max-width: 600px) { h1 { font-size: 6vw; } } .cs-game { display: flex; justify-content: center; padding: 1rem 2rem; flex-direction: column; } .cs-game-board { border-top: 4px solid #333; } .cs-win-lose, .cs-computer, .cs-player, .cs-score { font-size: 2rem; padding: 1.5rem 0; } .cs-score { display: flex; justify-content: space-between; } .cs-win-lose, .cs-computer, .cs-player { display: flex; align-items: center; justify-content: center; min-width: 70%; border-bottom: 4px solid #333; } .cs-player div { display: inline-flex; justify-content: center; flex-wrap: wrap; } .win { background-color: rgba(187, 241, 187, 0.5); } .lose { background-color: rgba(214, 187, 187, 0.5); } .tie { background-color: #ccc; } .hidden { display: none; } .cs-game-number { padding: 4px; display: inline-block; width: 60px; text-align: center; font-size: 1.2rem; font-weight: bold; margin: 0 auto; position: absolute; top: 3px; left: 3px; color: #333; } .cs-win-lose { border: 3px solid #333; flex-direction: column; padding: 2rem; } .cs-win-lose p { padding-top: 0; margin: 0 0 20px; font-size: 3rem; } .cs-win-lose .cs-play-btn { cursor: pointer; border: 2px solid #333; border-radius: 0.8rem; padding: 0.8rem 1.2rem; box-shadow: 2px 4px 8px 0 rgba(0, 0, 0, 0.2); background-color: #ffc83d; font-weight: bold; font-family: "Fredoka One", cursive; font-size: 1.2rem; letter-spacing: 3px; transition: all 0.2s; margin-top.........完整代码请登录后点击上方下载按钮下载查看
网友评论0