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: #FF6B6B;
--secondary-color: #4ECDC4;
--text-color: #333;
--bg-color: #f4f4f9;
--light-gray: #e0e0e0;
--white: #fff;
--dark-gray: #555;
}
* {
box-sizing: border-box;
margin: 0;
padding: 0;
}
body {
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
background-color: var(--bg-color);
color: var(--text-color);
overscroll-behavior-y: contain; /* 防止在移动设备上过度滚动 */
}
.page {
display: none;
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100vh;
overflow-y: auto;
background-color: var(--bg-color);
flex-direction: column;
}
.page.active {
display: flex;
}
.main-content {
flex-grow: 1;
padding-bottom: 70px; /* 为底部导航栏留出空间 */
}
/* --- 登录/注册页样式 --- */
.auth-container {
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
height: 100%;
padding: 20px;
}
.auth-container h1 {
font-size: 2.5em;
color: var(--primary-color);
margin-bottom: 40px;
}
.form-group {
margin-bottom: 20px;
width: 100%;
max-width: 320px;
}
.form-group input {
width: 100%;
padding: 15px;
border: 1px solid var(--light-gray);
border-radius: 8px;
font-size: 1em;
}
.btn {
width: 100%;
max-width: 320px;
padding: 15px;
border: none;
border-radius: 8px;
background-color: var(--primary-color);
color: var(--white);
font-size: 1.1em;
font-weight: bold;
cursor: pointer;
transition: background-color 0.3s;
}
.btn:hover {
background-color: #e55a5a;
}
.auth-link {
margin-top: 20px;
color: var(--secondary-color);
text-decoration: none;
font-weight: bold;
}
/* --- 底部导航栏 --- */
.bottom-nav {
position: fixed;
bottom: 0;
left: 0;
width: 100%;
height: 60px;
background-color: var(--white);
border-top: 1px solid var(--light-gray);
display: flex;
justify-content: space-around;
align-items: center;
z-index: 1000;
}
.nav-item {
display: flex;
flex-direction: column;
align-items: center;
cursor: pointer;
color: var(--dark-gray);
position: relative;
}
.nav-item.active {
color: var(--primary-color);
}
.nav-item svg {
width: 24px;
height: 24px;
margin-bottom: 2px;
}
.nav-item span {
font-size: 0.75em;
}
/* --- 发现页样式 --- */
.discover-container {
display: flex;
flex-direction: column;
align-items: center;
padding: 20px;
height: 100%;
}
.card-stack {
position: relative;
width: 100%;
max-width: 350px;
height: 70vh;
max-height: 500px;
flex-grow: 1;
}
.user-card {
position: absolute;
width: 100%;
height: 100%;
background-color: var(--white);
border-radius: 15px;
box-shadow: 0 4px 15px rgba(0,0,0,0.1);
overflow: hidden;
display: flex;
flex-direction: column;
user-select: none;
cursor: pointer;
}
.user-card img {
width: 100%;
height: 100%;
object-fit: cover;
}
.card-info {
position: absolute;
bottom: 0;
left: 0;
width: 100%;
padding: 20px;
background: linear-gradient(to top, rgba(0,0,0,0.8), transparent);
color: var(--white);
}
.card-info h2 {
font-size: 1.8em;
margin-bottom: 5px;
}
.card-info p {
font-size: 1.1em;
}
.........完整代码请登录后点击上方下载按钮下载查看
















网友评论0