創意名字生成器

by wuchengyang

HTML

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>創意名字生成器</title>
    <style>
        body {
            font-family: Arial, sans-serif;
            display: flex;
            flex-direction: column;
            align-items: center;
            justify-content: center;
            margin: 0;
            padding: 20px;
            background-color: #f9f9f9;
        }
        .generator-container {
            display: flex;
            flex-direction: row; /* 橫向排列 */
            align-items: center;
            justify-content: center;
            gap: 20px;
            background: #ffffff;
            padding: 20px;
            border: 2px solid #ddd;
            border-radius: 10px;
            box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
        }
        .output-box {
            font-size: 20px;
            font-weight: bold;
            color: #333;
        }
        .button {
            padding: 10px 20px;
            font-size: 16px;
            background-color: #007bff;
            color: white;
            border: none;
            border-radius: 5px;
            cursor: pointer;
        }
        .button:hover {
            background-color: #0056b3;
        }
    </style>
</head>
<body>
    <h1>創意名字生成器</h1>
    <div class="generator-container">
        <button class="button" onclick="generateName()">生成名字</button>
        <div class="output-box" id="nameDisplay">點擊按鈕生成名字</div>
    </div>

    <script>
        const names = [
            "家豪", "志明", "美玉", "俊傑", "麗華", 
            "雅婷", "建國", "秀英", "志成", "玉玲", 
            "麗珍", "志宏", "淑芬", "文華", "春花",
            "國榮", "秀珍", "文傑", "佩玲", "明志",
            "建華", "志勇", "美玲", "秀梅", "俊宏",
            "淑娟", "惠美", "佳玲", "家瑋", "志豪",
            "淑華", "佩芬", "俊傑", "志偉", "美惠",
            "玉芬", "雅文", "俊成", "明玉", "家偉",
            "志凱", "淑惠", "文豪", "俊華", "玉婷",
            "志遠", "秀琴", "建成", "麗芬", "志雄"
        ];

   ...