js+css布局实现类似安居客房产中介平台app的可交互跳转ui原型效果代码
代码语言:html
所属分类:布局界面
代码描述:js+css布局实现类似安居客房产中介平台app的可交互跳转ui原型效果代码
代码标签: js css 布局 类似 安居客 房产 中介 平台 app 交互 跳转 ui 原型图
下面为部分代码预览,完整代码请点击下载或在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>安居客 - 房产中介App</title> <style> :root { --primary-color: #00AE66; --primary-light: #e6f7f0; --accent-color: #FF5A5F; --bg-color: #f7f8fa; --text-primary: #1a1a1a; --text-secondary: #8a8a8a; --border-color: #ebedf0; --card-bg: #ffffff; } * { 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(--card-bg); border-bottom: 1px solid var(--border-color); 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; } .page-header svg { width: 24px; height: 24px; } /* --- 内容区域 --- */ .content { flex-grow: 1; overflow-y: auto; } #home-page .content { padding: 15px; } #listings-page .content, #favorites-page .content, #agent-page .content { padding: 0 15px; } #detail-page .content { padding-bottom: 70px; } /* --- 首页 --- */ .search-bar { display: flex; align-items: center; background-color: var(--card-bg); padding: 8px 15px; border-radius: 20px; margin-bottom: 20px; } .search-bar svg { color: var(--text-secondary); margin-right: 8px; } .search-bar span { color: var(--text-secondary); } .nav-categories { display: flex; justify-content: space-around; text-align: center; margin-bottom: 25px; } .nav-cat-item { cursor: pointer; } .nav-cat-item div { width: 50px; height: 50px; border-radius: 50%; display: flex; align-items: center; justify-content: center; margin: 0 auto 8px; } .nav-cat-item:nth-child(1) div { background-color: #2b83f8; } .nav-cat-item:nth-child(2) div { background-color: #36c57d; } .nav-cat-item:nth-child(3) div { background-color: #f7a012; } .nav-cat-item svg { width: 28px; height: 28px; color: white; } .section-title { font-size: 18px; font-weight: bold; margin-bottom: 15px; } /* --- 房源列表项 --- */ .listing-item { display: flex; padding: 15px 0; background-color: var(--card-bg); margin-bottom: 10px; border-radius: 8px; padding: 15px; cursor: pointer; } .listing-item img { width: 120px; height: 90px; object-fit: cover; border-radius: 4px; margin-right: 15px; } .listing-info { flex: 1; display: flex; flex-direction: column; justify-content: space-between; } .listing-info h3 { font-size: 16px; font-weight: 500; line-height: 1.4; } .listing-location { font-size: 13px; color: var(--text-secondary); margin: 4px 0; } .listing-tags { display: flex; flex-wrap: wrap; gap: 5px; } .tag { background-color: var(--primary-light); color: var(--primary-color); padding: 2px 6px; font-size: 11px; border-radius: 3px; } .listing-price { font-size: 18px; font-weight: bold; color: var(--accent-color); } .listing-price span { font-size: 13px; font-weight: normal; } .no-data { text-align: center; padding: 50px; color: var(--text-secondary); } /* --- 列表页筛选栏 --- */ .filter-bar { display: flex; justify-content: space-around; background: var(--card-bg); padding: 10px 0; border-bottom: 1px solid var(--border-color); } .filter-item { color: var(--text-secondary); } /* --- 详情页 --- */ #detail-main-image { width: 100%; height: 250px; object-fit: cover; } .detail-section { background-color: var(--card-bg); padding: 15px; margin-bottom: 10px; } #detail-title { font-size: 22px; font-weight: bold; line-height: 1.4; margin-bottom: 10px; } .detail-price-area { display: flex; justify-content: space-between; align-items: baseline; } .detail-price-area .price { font-size: 26px; font-weight: bold; color: var(--accent-color); } .detail-price-area .price span { font-size: 16px; } .detail-specs { display: grid; grid-template-columns: repeat(3, 1fr); gap: 15px; text-align: center; padding: 15px 0; } .spec-item .value { font-size: 18px; font-weight: bold; } .spec-item .label { font-size: 13px; color: var(--text-secondary); margin-top: 5px; } .detail-description p { line-height: 1.8; } .agent-card { display: flex; align-items: center; padding: 15px; background: var(--primary-light); border-radius: 8px; cursor: pointer; } .agent-card img { width: 50px; height: 50px; border-radius: 50%; m.........完整代码请登录后点击上方下载按钮下载查看
网友评论0