开发记录 11

编写添加老人信息的html界面:

<!DOCTYPE html>
<html lang="zh-CN">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>老人信息登记系统</title>
    <style>
        * {
            margin: 0;
            padding: 0;
            box-sizing: border-box;
        }

        body {
            font-family: '微软雅黑', 'Helvetica Neue', sans-serif;
            background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
            min-height: 100vh;
            padding: 2rem;
        }

        .form-container {
            max-width: 800px;
            margin: 2rem auto;
            padding: 2.5rem;
            background: rgba(255,255,255,0.95);
            border-radius: 20px;
            box-shadow: 0 10px 40px rgba(0,0,0,0.08);
        }

        h2 {
            text-align: center;
            color: #2c3e50;
            font-size: 2.2rem;
            margin-bottom: 2rem;
            position: relative;
            padding-bottom: 1rem;
        }

        h2::after {
            content: '';
            display: block;
            width: 60px;
            height: 3px;
            background: #3498db;
            margin: 0.5rem auto;
            border-radius: 2px;
        }

        .form-grid {
            display: grid;
            grid-template-columns: repeat(2, 1fr);
            gap: 1.5rem;
        }

        .form-group {
            position: relative;
            margin-bottom: 1.2rem;
        }

        .form-group label {
            display: block;
            margin-bottom: 0.5rem;
            color: #4a5568;
            font-weight: 500;
            font-size: 0.95rem;
        }

        .form-group input {
            width: 100%;
            padding: 0.8rem 1rem;
            border: 2px solid #e2e8f0;
            border-radius: 8px;
            font-size: 1rem;
            transition: all 0.3s ease;
            background: #f8fafc;
        }

        .form-group input:focus {
            outline: none;
            border-color: #3498db;
            background: white;
            box-shadow: 0 0 0 3px rgba(52,152,219,0.1);
        }

        .form-group input::placeholder {
            color: #a0aec0;
        }

        .button-group {
            grid-column: 1 / -1;
            text-align: center;
            margin-top: 2rem;
        }

        #add_btn {
            background: linear-gradient(145deg, #3498db, #2980b9);
            color: white;
            padding: 1rem 2.5rem;
            border: none;
            border-radius: 10px;
            font-size: 1.1rem;
            cursor: pointer;
            transition: all 0.3s ease;
            box-shadow: 0 4px 6px rgba(52,152,219,0.1);
        }

        #add_btn:hover {
            transform: translateY(-2px);
            box-shadow: 0 7px 14px rgba(52,152,219,0.2);
        }

        #add_btn:active {
            transform: translateY(1px);
        }

        @media (max-width: 768px) {
            .form-grid {
                grid-template-columns: 1fr;
            }

            .form-container {
                margin: 1rem;
                padding: 1.5rem;
            }

            h2 {
                font-size: 1.8rem;
            }
        }

        /* 输入图标装饰 */
        .form-group::before {
            content: "▶";
            position: absolute;
            left: -1.2rem;
            top: 50%;
            transform: translateY(-50%);
            color: #3498db;
            opacity: 0.6;
            font-size: 0.8rem;
        }
    </style>
    <!-- 引入字体图标 -->
    <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.0.0/css/all.min.css">
</head>

<body>
<div class="form-container">
    <h2>老人健康信息登记</h2>
    <form id="add-form" action="/2018/addOlderServlet" method="post">
        <div class="form-grid">
            <div class="form-group">
                <label for="name"><i class="fas fa-user"></i> 姓名</label>
                <input type="text" id="name" name="name" placeholder="请输入姓名">
            </div>
            <div class="form-group">
                <label for="age"><i class="fas fa-birthday-cake"></i> 年龄</label>
                <input type="text" id="age" name="age" placeholder="请输入年龄">
            </div>
            <div class="form-group">
                <label for="height"><i class="fas fa-text-height"></i> 身高(cm)</label>
                <input type="text" id="height" name="height" placeholder="请输入身高">
            </div>
            <div class="form-group">
                <label for="weight"><i class="fas fa-weight"></i> 体重(kg)</label>
                <input type="text" id="weight" name="weight" placeholder="请输入体重">
            </div>
            <div class="form-group">
                <label for="see"><i class="fas fa-eye"></i> 视力</label>
                <input type="text" id="see" name="see" placeholder="示例:5">
            </div>
            <div class="form-group">
                <label for="hear"><i class="fas fa-deaf"></i> 听力</label>
                <input type="text" id="hear" name="hear" placeholder="请输入听力状况">
            </div>
            <div class="form-group">
                <label for="vc"><i class="fas fa-heartbeat"></i> 血压(mmHg)</label>
                <input type="text" id="vc" name="vc" placeholder="示例:120/80">
            </div>
            <div class="form-group">
                <label for="sleep"><i class="fas fa-bed"></i> 睡眠质量</label>
                <input type="text" id="sleep" name="sleep" placeholder="请输入睡眠质量评分">
            </div>
            <div class="form-group">
                <label for="memory"><i class="fas fa-brain"></i> 记忆力</label>
                <input type="text" id="memory" name="memory" placeholder="请输入记忆力评估">
            </div>
            <div class="form-group">
                <label for="nutritional"><i class="fas fa-apple-alt"></i> 营养状况</label>
                <input type="text" id="nutritional" name="nutritional" placeholder="请输入营养评估">
            </div>
        </div>

        <div class="button-group">
            <input type="submit" id="add_btn" value="提交健康档案">
        </div>
    </form>
</div>
</body>

</html>
posted @ 2025-02-20 18:18  一如初见233  阅读(9)  评论(0)    收藏  举报