CommunityAPP_UI/emergency-alert.html

112 lines
3.0 KiB
HTML
Raw Normal View History

2025-04-25 15:59:56 +08:00
<!DOCTYPE html>
<html lang="zh-Hant">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0"/>
<title>警急通報</title>
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.3/dist/css/bootstrap.min.css" rel="stylesheet" />
<style>
body {
background-color: #f7f8fa;
font-family: 'Noto Sans TC', sans-serif;
}
header {
background-color: #9eaf9f;
color: #fff;
padding: 16px;
font-size: 20px;
font-weight: bold;
text-align: center;
position: relative;
}
.back-button {
position: absolute;
top: 12px;
left: 16px;
cursor: pointer;
}
.back-button img {
width: 24px;
height: 24px;
filter: brightness(0) invert(1);
}
.alert-container {
background-color: #fff;
margin: 20px;
padding: 30px 20px;
border-radius: 12px;
box-shadow: 0 1px 3px rgba(0,0,0,0.1);
text-align: center;
}
.illustration {
width: 140px;
margin-bottom: 20px;
}
.alert-btn {
background-color: #dc3545;
border: none;
}
.alert-btn:hover {
background-color: #c82333;
}
.status-message {
margin-top: 20px;
font-size: 18px;
font-weight: bold;
}
.sent { color: green; }
.fail { color: red; }
</style>
</head>
<body>
<header>
<div class="back-button">
<img src="https://img.icons8.com/ios-filled/50/ffffff/left.png" onclick="history.back()" />
</div>
警急通報
</header>
<div class="alert-container">
<!-- 更換圖示來源(穩定連結) -->
<img src="https://cdn-icons-png.flaticon.com/512/564/564619.png" alt="警報圖示" class="illustration">
<p class="mb-3">若遇緊急情況,請選擇災害類型後立即通報。</p>
<div class="mb-4 text-start">
<label for="disasterType" class="form-label fw-bold">災害類型</label>
<select id="disasterType" class="form-select">
<option value="">請選擇...</option>
<option value="火災">🔥 火災</option>
<option value="地震">🌏 地震</option>
<option value="水災">💧 水災</option>
<option value="可疑人物">🕵️‍♂️ 可疑人物</option>
<option value="公共設施故障">⚠️ 公共設施故障</option>
<option value="其他">❓ 其他</option>
</select>
</div>
<button class="btn btn-danger btn-lg w-100 alert-btn" onclick="sendAlert()">🚨 立即通報</button>
<div id="statusMessage" class="status-message"></div>
</div>
<script>
function sendAlert() {
const status = document.getElementById('statusMessage');
const type = document.getElementById('disasterType').value;
if (!type) {
status.innerHTML = '<span class="fail">⚠️ 請先選擇災害類型。</span>';
return;
}
// 模擬送出
setTimeout(() => {
status.innerHTML = `<span class="sent">✅ 已通報「${type}」,請等待支援!</span>`;
}, 800);
}
</script>
</body>
</html>