201 lines
3.9 KiB
HTML
201 lines
3.9 KiB
HTML
<!DOCTYPE html>
|
|
<html lang="zh">
|
|
|
|
<head>
|
|
<meta charset="UTF-8">
|
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
<title>IM 列表</title>
|
|
<link rel="stylesheet" href="style.css">
|
|
<style>
|
|
/* 全局设置 */
|
|
* {
|
|
margin: 0;
|
|
padding: 0;
|
|
box-sizing: border-box;
|
|
}
|
|
|
|
body {
|
|
font-family: Arial, sans-serif;
|
|
background-color: #f7f7f7;
|
|
color: #333;
|
|
}
|
|
|
|
/* 顶部栏 */
|
|
header {
|
|
background-color: #fff;
|
|
padding: 15px 20px;
|
|
box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
|
|
position: sticky;
|
|
top: 0;
|
|
z-index: 10;
|
|
}
|
|
|
|
.header-content {
|
|
display: flex;
|
|
justify-content: space-between;
|
|
align-items: center;
|
|
}
|
|
|
|
h1 {
|
|
font-size: 24px;
|
|
color: #4a90e2;
|
|
}
|
|
|
|
.search-bar {
|
|
padding: 8px 12px;
|
|
width: 200px;
|
|
border-radius: 20px;
|
|
border: 1px solid #ddd;
|
|
font-size: 14px;
|
|
outline: none;
|
|
}
|
|
|
|
/* 联系人列表 */
|
|
.contact-list {
|
|
margin-top: 20px;
|
|
}
|
|
|
|
.contact-item {
|
|
display: flex;
|
|
justify-content: space-between;
|
|
align-items: center;
|
|
background-color: #fff;
|
|
margin: 10px 20px;
|
|
padding: 12px;
|
|
border-radius: 8px;
|
|
box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
|
|
transition: all 0.3s ease;
|
|
}
|
|
|
|
.contact-item:hover {
|
|
background-color: #f1f1f1;
|
|
box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
|
|
}
|
|
|
|
/* 头像 */
|
|
.avatar img {
|
|
width: 40px;
|
|
height: 40px;
|
|
border-radius: 50%;
|
|
}
|
|
|
|
/* 联系人信息 */
|
|
.contact-info {
|
|
flex: 1;
|
|
margin-left: 12px;
|
|
}
|
|
|
|
.contact-name {
|
|
font-weight: bold;
|
|
font-size: 16px;
|
|
color: #333;
|
|
}
|
|
|
|
.last-message {
|
|
font-size: 14px;
|
|
color: #666;
|
|
margin-top: 5px;
|
|
}
|
|
|
|
/* 时间和未读消息数 */
|
|
.meta-info {
|
|
display: flex;
|
|
flex-direction: column;
|
|
align-items: flex-end;
|
|
justify-content: center;
|
|
}
|
|
|
|
.message-time {
|
|
font-size: 12px;
|
|
color: #999;
|
|
}
|
|
|
|
.unread-count {
|
|
background-color: #f03e3e;
|
|
color: #fff;
|
|
padding: 4px 8px;
|
|
border-radius: 12px;
|
|
font-size: 12px;
|
|
margin-top: 5px;
|
|
}
|
|
|
|
/* 底部创建聊天按钮 */
|
|
.create-chat {
|
|
position: fixed;
|
|
right: 20px;
|
|
bottom: 20px;
|
|
}
|
|
|
|
.create-chat button {
|
|
background-color: #4a90e2;
|
|
color: #fff;
|
|
padding: 15px 25px;
|
|
border-radius: 50%;
|
|
font-size: 18px;
|
|
border: none;
|
|
box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
|
|
cursor: pointer;
|
|
transition: background-color 0.3s ease;
|
|
}
|
|
|
|
.create-chat button:hover {
|
|
background-color: #357ab7;
|
|
}
|
|
|
|
.create-chat button:active {
|
|
background-color: #2f6790;
|
|
}
|
|
|
|
</style>
|
|
</head>
|
|
|
|
<body>
|
|
<!-- 顶部栏 -->
|
|
<header>
|
|
<div class="header-content">
|
|
<h1>IM 列表</h1>
|
|
<input type="text" placeholder="搜索联系人或群组" class="search-bar">
|
|
</div>
|
|
</header>
|
|
|
|
<!-- 联系人列表 -->
|
|
<div class="contact-list">
|
|
<div class="contact-item">
|
|
<div class="avatar">
|
|
<img src="https://via.placeholder.com/40" alt="头像">
|
|
</div>
|
|
<div class="contact-info">
|
|
<p class="contact-name">张三</p>
|
|
<p class="last-message">你好,最近怎么样?</p>
|
|
</div>
|
|
<div class="meta-info">
|
|
<p class="message-time">2分钟前</p>
|
|
<div class="unread-count">3</div>
|
|
</div>
|
|
</div>
|
|
|
|
<div class="contact-item">
|
|
<div class="avatar">
|
|
<img src="https://via.placeholder.com/40" alt="头像">
|
|
</div>
|
|
<div class="contact-info">
|
|
<p class="contact-name">李四</p>
|
|
<p class="last-message">好的,明天见!</p>
|
|
</div>
|
|
<div class="meta-info">
|
|
<p class="message-time">昨天</p>
|
|
<div class="unread-count">0</div>
|
|
</div>
|
|
</div>
|
|
|
|
<!-- 更多联系人项可以在此复制 -->
|
|
</div>
|
|
|
|
<!-- 底部按钮 -->
|
|
<div class="create-chat">
|
|
<button>新建对话</button>
|
|
</div>
|
|
|
|
</body>
|
|
|
|
</html> |