修改界面为左右布局、修改聊天框样式、添加部分动效
This commit is contained in:
1 parent
0ff8fc158f
commit
df0830a2ad
9 files changed
+279
-68
No files matched your search
+33
-22
@@ -1,32 +1,43 @@
|
||||
/* 基本样式重置 */
|
||||
body, html {
|
||||
body {
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
font-family: Arial, sans-serif; /* 默认字体 */
|
||||
background-color:#f4f4f4;
|
||||
}
|
||||
|
||||
/*主内容区test*/
|
||||
.container {
|
||||
width: 60%;
|
||||
margin: 4% auto 0;
|
||||
background-color: #f0f0f0;
|
||||
padding: 2% 5%;
|
||||
border-radius: 10px
|
||||
font-family: "Arial", sans-serif;
|
||||
}
|
||||
|
||||
ul {
|
||||
padding-left: 20px;
|
||||
.main-layout {
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
height: calc(100vh - 100px);
|
||||
padding-bottom: 100px;
|
||||
}
|
||||
|
||||
ul li {
|
||||
line-height: 2.3
|
||||
}
|
||||
.left-panel, .right-panel {
|
||||
width: 50%;
|
||||
display: flex;
|
||||
justify-content: center; /* 水平居中 */
|
||||
align-items: center; /* 垂直居中 */
|
||||
flex-direction: column; /* 内容垂直排列 */
|
||||
padding: 20px;
|
||||
box-sizing: border-box;
|
||||
height: 100%;
|
||||
}
|
||||
|
||||
a {
|
||||
color: #20a53a
|
||||
.logo {
|
||||
margin-top: 40px;
|
||||
font-size: 32px;
|
||||
}
|
||||
|
||||
.intro a {
|
||||
display: block;
|
||||
margin: 5px 0;
|
||||
}
|
||||
|
||||
.logo {
|
||||
font-family: 'Pacifico', cursive;
|
||||
}
|
||||
}
|
||||
|
||||
/* 默认隐藏 */
|
||||
.mobile-toggle {
|
||||
display: none;
|
||||
margin: 10px;
|
||||
text-align: center;
|
||||
}
|
||||
+71
-14
@@ -1,27 +1,84 @@
|
||||
/* 简单样式,仅用于展示 */
|
||||
#chatContainer {
|
||||
border: 1px solid #ccc;
|
||||
.chat-container {
|
||||
position: fixed;
|
||||
bottom: 50px;
|
||||
left: 0;
|
||||
width: 100%;
|
||||
background: #fff;
|
||||
padding: 10px;
|
||||
height: 50px;
|
||||
box-shadow: 0 -2px 5px #fff;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.chat-box {
|
||||
width: 90%;
|
||||
max-height: 50vh;
|
||||
overflow-y: auto;
|
||||
background: #f5f5f5;
|
||||
margin-bottom: 10px;
|
||||
padding: 10px;
|
||||
border-radius: 8px;
|
||||
position: relative;
|
||||
z-index: 10;
|
||||
}
|
||||
|
||||
.message {
|
||||
margin: 5px 0;
|
||||
padding: 5px;
|
||||
.chat-box.show {
|
||||
animation: slideUp 0.3s ease-out forwards;
|
||||
}
|
||||
|
||||
.user {
|
||||
color: blue;
|
||||
text-align: right;
|
||||
.chat-box.hide {
|
||||
animation: slideDown 0.3s ease-in forwards;
|
||||
}
|
||||
|
||||
.bot {
|
||||
color: green;
|
||||
text-align: left;
|
||||
|
||||
.input-row {
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
width: 90%;
|
||||
gap: 10px;
|
||||
}
|
||||
|
||||
#userInput {
|
||||
width: 93%;
|
||||
flex: 1;
|
||||
padding: 10px;
|
||||
font-size: 16px;
|
||||
border: 1px solid #ccc;
|
||||
border-radius: 6px;
|
||||
}
|
||||
|
||||
button {
|
||||
padding: 10px 16px;
|
||||
font-size: 16px;
|
||||
border: none;
|
||||
background-color: #007BFF;
|
||||
color: white;
|
||||
border-radius: 6px;
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
button:hover {
|
||||
background-color: #0056b3;
|
||||
}
|
||||
|
||||
@keyframes slideUp {
|
||||
from {
|
||||
transform: translateY(100%);
|
||||
opacity: 0;
|
||||
}
|
||||
to {
|
||||
transform: translateY(0);
|
||||
opacity: 1;
|
||||
}
|
||||
}
|
||||
|
||||
@keyframes slideDown {
|
||||
from {
|
||||
transform: translateY(0);
|
||||
opacity: 1;
|
||||
}
|
||||
to {
|
||||
transform: translateY(100%);
|
||||
opacity: 0;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,37 @@
|
||||
@media screen and (max-width: 768px) {
|
||||
.main-layout {
|
||||
flex-direction: column;
|
||||
}
|
||||
|
||||
.left-panel, .right-panel {
|
||||
width: 100%;
|
||||
display: none;
|
||||
}
|
||||
|
||||
.chat-container {
|
||||
bottom: 0;
|
||||
}
|
||||
|
||||
footer {
|
||||
padding-bottom: 60px;
|
||||
}
|
||||
|
||||
.mobile-toggle {
|
||||
display: block;
|
||||
}
|
||||
|
||||
.mobile-toggle button {
|
||||
margin: 0 5px;
|
||||
padding: 8px 16px;
|
||||
font-size: 14px;
|
||||
border: none;
|
||||
background-color: #007BFF;
|
||||
color: white;
|
||||
border-radius: 4px;
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
.mobile-toggle button:hover {
|
||||
background-color: #0056b3;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
.datetime {
|
||||
text-align: center;
|
||||
margin-bottom: 20px;
|
||||
}
|
||||
|
||||
.time {
|
||||
font-size: 36px;
|
||||
font-weight: bold;
|
||||
color: #333;
|
||||
}
|
||||
|
||||
.date {
|
||||
font-size: 16px;
|
||||
color: #666;
|
||||
margin-top: 5px;
|
||||
}
|
||||
Reference in new issue
Block a user