js+css实现英文单词拼写游戏代码

代码语言:html

所属分类:游戏

代码描述:js+css实现英文单词拼写游戏代码

代码标签: js css 英文 单词 拼写 游戏 代码

下面为部分代码预览,完整代码请点击下载或在bfwstudio webide中打开

<!DOCTYPE html>
<html lang="zh-CN">
    <head>
        <meta charset="UTF-8">
        <meta name="viewport" content="width=device-width, initial-scale=1.0">
         <link type="text/css" rel="stylesheet" href="//repo.bfw.wiki/bfwrepo/css/all.6.4.0.css">
   <style>
    * {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Comic Sans MS','Arial Rounded MT Bold','Arial',sans-serif
}

body {
    background: linear-gradient(135deg,#f5f7fa 0,#c3cfe2 100%);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px
}

.game-container {
    width: 100%;
    max-width: 1200px;
    background-color: rgba(255,255,255,0.95);
    border-radius: 24px;
    box-shadow: 0 15px 30px rgba(0,0,0,0.1);
    overflow: hidden;
    border: 8px solid #ffccd5;
    position: relative
}

.game-header {
    background: linear-gradient(to right,#a6c0fe 0,#f68084 100%);
    color: white;
    padding: 20px 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 5px solid #ffb6c1
}

.game-title {
    font-size: 2.5rem;
    font-weight: bold;
    text-shadow: 3px 3px 0 #ff9eaa;
    letter-spacing: 1px;
    display: flex;
    align-items: center
}

.game-title i {
    margin-right: 15px;
    font-size: 2.8rem
}

.stats {
    display: flex;
    gap: 25px
}

.stat-box {
    background-color: rgba(255,255,255,0.9);
    color: #ff6b8b;
    padding: 12px 20px;
    border-radius: 16px;
    text-align: center;
    min-width: 140px;
    box-shadow: 0 5px 10px rgba(0,0,0,0.1);
    border: 3px solid #ffccd5
}

.stat-label {
    font-size: 1rem;
    margin-bottom: 5px;
    color: #5a7d9a
}

.stat-value {
    font-size: 2rem;
    font-weight: bold
}

.game-content {
    display: flex;
    padding: 30px;
    gap: 30px;
    min-height: 500px
}

.left-column {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 20px
}

.meaning-container, .letters-container {
    background-color: #f0f9ff;
    border-radius: 20px;
    padding: 25px;
    border: 5px solid #a6c0fe;
    box-shadow: inset 0 0 15px rgba(166,192,254,0.3)
}

.column-title {
    font-size: 1.8rem;
    color: #5a7d9a;
    text-align: center;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 3px dashed #ffb6c1;
    display: flex;
    justify-content: center;
    align-items: center
}

.column-title i {
    margin-right: 10px;
    color: #ff6b8b
}

.word-meaning {
    font-size: 2.2rem;
    font-weight: bold;
    text-align: center;
    margin: 15px 0;
    color: #ff6b8b;
    min-height: 60px
}

.word-length {
    font-size: 1.4rem;
    text-align: center;
    color: #5a7d9a;
    margin-top: 10px
}

.letters-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(60px, 1fr));
    gap: 15px;
    margin-top: 10px
}

.letter-card {
    background-color: white;
    padding: 15px;
    border-radius: 16px;
    font-size: 1.6rem;
    font-weight: bold;
    text-align: center;
    cursor: pointer;
    transition: all .3s ease;
    box-shadow: 0 5px 10px rgba(0,0,0,0.1);
    user-select: none;
    border: 3px solid #a6c0fe;
    height: 70px;
    display: flex;
    justify-content: center;
    align-items: center
}

.letter-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 15px rgba(0,0,0,0.2)
}

.letter-card.used {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
    box-shadow: none
}

.right-column {
    flex: 1;
    display: flex;
    flex-direction: column
}

.answer-container {
    background-color: #fff0f3;
    border-radius: 20px;
    padding: 25px;
    border: 5px solid #ffb6c1;
    box-shadow: inset 0 0 15px rgba(255,107,139,0.3);
    flex: 1;
    display: flex;
    flex-direction: column
}

.answer-slots {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin: 25px 0;
    min-height: 80px
}

.answer-slot {
    width: 70px;
    height: 70px;
    border: 3px dashed #ff6b8b;
    border-radius: 12px;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 2rem;
    font-weight: bold;
    color: #5a7d9a;
    background-color: rgba(255,255,255,0.7)
}

.answer-slot.filled {
    border-style: solid;
    background-color: white;
    box-shadow: 0 4px 8px rgba(0,0,0,0.1)
}

.game-controls {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 20px;
    width: 100%
}

.hint-container {
    display: flex;
    align-items: center;
    gap: 15px
}

.hint-btn {
    background: linear-gradient(to bottom,#ffd700,#ff9900);
    color: white;
    border: 0;
    padding: 12px 20px;
    border-radius: 50px;
    font-size: 1.1rem;
    font-weight: bold;
    cursor: pointer;
    transition: all .3s ease;
    box-shadow: 0 6px 0 #cc7a00;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px
}

.hint-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 9p.........完整代码请登录后点击上方下载按钮下载查看

网友评论0