js+css实现模仿12306火车购票app微网站ui原型图h5代码
代码语言:html
所属分类:其他
代码描述:js+css实现模仿12306火车购票app微网站ui原型图h5代码
代码标签: js css 模仿 12306 火车 购票 app 微网站 ui 原型图 h5 代码
下面为部分代码预览,完整代码请点击下载或在bfwstudio webide中打开
<!DOCTYPE html>
<html lang="zh-CN">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=no">
<title>铁路12306</title>
<style>
:root {
--primary-color: #0078D2;
--accent-color: #F7931E;
--bg-color: #f2f3f5;
--card-bg: #ffffff;
--text-primary: #333;
--text-secondary: #888;
--border-color: #ebedf0;
}
* { box-sizing: border-box; margin: 0; padding: 0; -webkit-tap-highlight-color: transparent; }
body { font-family: -apple-system, BlinkMacSystemFont, "Helvetica Neue", "PingFang SC", "Microsoft YaHei", sans-serif; background-color: var(--bg-color); color: var(--text-primary); font-size: 14px; }
.page {
position: absolute; top: 0; left: 0; width: 100%; height: 100vh;
background-color: var(--bg-color); display: none; flex-direction: column;
transform: translateX(100%); transition: transform 0.3s ease-out;
}
.page.active { display: flex; transform: translateX(0); z-index: 10; }
#app-container.active { display: flex; transform: translateX(0); z-index: 5; }
/* --- 通用头部 --- */
.page-header {
display: flex; align-items: center; justify-content: space-between;
height: 50px; padding: 0 15px; background-color: var(--primary-color);
color: white; flex-shrink: 0;
}
.page-header h2 { font-size: 18px; position: absolute; left: 50%; transform: translateX(-50%); }
.page-header .icon-btn { cursor: pointer; background: none; border: none; padding: 5px; }
.page-header svg { width: 24px; height: 24px; color: white; }
.content { flex-grow: 1; overflow-y: auto; }
/* --- 首页查询 --- */
#home-view { padding: 20px; }
.query-box { background: var(--card-bg); border-radius: 8px; padding: 20px; box-shadow: 0 2px 12px rgba(0,0,0,0.05); }
.station-line { display: flex; align-items: center; justify-content: space-between; margin-bottom: 20px; }
.station-input { font-size: 20px; font-weight: bold; width: 40%; border: none; outline: none; background: transparent; }
.swap-icon { padding: 10px; background-color: var(--bg-color); border-radius: 50%; cursor: pointer; }
.swap-icon svg { width: 20px; height: 20px; color: var(--primary-color); }
.date-line { display: flex; align-items: center; border-top: 1px solid var(--border-color); padding-top: 20px; margin-bottom: 25px; }
.date-input { width: 100%; border: none; font-size: 16px; }
.query-btn {
width: 100%; height: 45px; background-color: var(--accent-color);
border: none; border-radius: 5px; color: white; font-size: 18px; font-weight: bold;
}
/* --- 车次列表页 --- */
.query-results-header { text-align: center; padding: 10px; background: var(--card-bg); }
.train-card { background: var(--card-bg); margin: 10px; padding: 15px; border-radius: 8px; }
.train-card-top { display: flex; justify-content: space-between; align-items: center; margin-bottom: 15px; }
.train-number { font-size: 16px; font-weight: bold; }
.train-duration { color: var(--text-secondary); }
.train-card-middle { display: flex; justify-content: space-between; align-items: center; }
.station-time { display: flex; flex-direction: column; }
.time { font-size: 20px; font-weight: bold; }
.station { font-size: 16px; }
.arrow-line { color: var(--text-secondary); }
.train-card-bottom { border-top: 1px solid var(--border-colo.........完整代码请登录后点击上方下载按钮下载查看
















网友评论0