加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
style.css 10.42 KB
一键复制 编辑 原始数据 按行查看 历史
陈祖豪 提交于 2024-12-09 16:37 . 上传代码
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592
:root {
--primary-color: #2b7efb;
--primary-hover: #1b6eeb;
--success-color: #07c160;
--warning-color: #ff9c19;
--danger-color: #fa5151;
--text-primary: #1f2329;
--text-secondary: #646a73;
--text-light: #8f959e;
--border-color: #e5e6eb;
--background: #f5f6f7;
--card-background: #ffffff;
--shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
}
* {
margin: 0;
padding: 0;
box-sizing: border-box;
font-family: -apple-system, BlinkMacSystemFont, 'PingFang SC', 'Helvetica Neue', sans-serif;
}
body {
background-color: var(--background);
color: var(--text-primary);
line-height: 1.5;
}
.container {
max-width: 1200px;
margin: 0 auto;
padding: 24px;
}
.page-header {
margin-bottom: 32px;
}
.page-header h1 {
font-size: 28px;
font-weight: 600;
margin-bottom: 8px;
}
.sub-title {
color: var(--text-secondary);
font-size: 14px;
}
.rooms-container {
display: grid;
grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
gap: 24px;
}
.room-card {
background: var(--card-background);
border-radius: 12px;
padding: 16px;
box-shadow: var(--shadow);
animation: cardAppear 0.5s ease backwards;
}
.room-card:nth-child(1) { animation-delay: 0.1s; }
.room-card:nth-child(2) { animation-delay: 0.2s; }
.room-card:nth-child(3) { animation-delay: 0.3s; }
.room-header {
display: flex;
justify-content: space-between;
align-items: center;
margin-bottom: 20px;
}
.room-header h2 {
font-size: 20px;
font-weight: 600;
}
.room-status {
padding: 4px 12px;
border-radius: 16px;
font-size: 13px;
animation: pulse 2s infinite;
}
.room-status.available {
background-color: rgba(7, 193, 96, 0.1);
color: var(--success-color);
}
.room-status.unavailable {
background-color: rgba(250, 81, 81, 0.1);
color: var(--danger-color);
}
.room-info {
display: grid;
grid-template-columns: 1fr 1fr;
gap: 16px;
margin-bottom: 24px;
}
.info-item {
display: flex;
flex-direction: column;
}
.info-item .label {
color: var(--text-light);
font-size: 13px;
margin-bottom: 4px;
}
.info-item .value {
font-size: 16px;
font-weight: 500;
}
.room-schedule {
max-width: 100%;
margin: 0 auto;
}
.schedule-title {
font-size: 14px;
color: var(--text-secondary);
margin-bottom: 12px;
}
.time-slots {
overflow-x: hidden;
scroll-behavior: smooth;
}
.time-slots-grid {
display: grid;
grid-template-columns: repeat(3, 1fr);
gap: 10px;
padding: 12px;
}
.time-slot {
background: var(--card-background);
border: 1px solid var(--border-color);
border-radius: 8px;
padding: 12px 8px;
text-align: center;
cursor: pointer;
transition: all 0.3s ease;
display: flex;
flex-direction: column;
align-items: center;
gap: 4px;
position: relative;
}
.time-slot.available {
background-color: rgba(76, 175, 80, 0.05);
border-color: rgba(76, 175, 80, 0.3);
}
.time-slot.available:hover {
transform: translateY(-2px);
box-shadow: 0 2px 8px rgba(76, 175, 80, 0.15);
border-color: var(--success-color);
}
.time-slot.booked {
background-color: rgba(244, 67, 54, 0.05);
border-color: rgba(244, 67, 54, 0.3);
cursor: not-allowed;
opacity: 0.8;
}
.time-slot.selected {
background-color: var(--primary-color);
border-color: var(--primary-color);
color: white;
transform: translateY(-2px);
box-shadow: 0 2px 12px rgba(43, 126, 251, 0.3);
}
.time-slot.selected .status-text {
color: rgba(255, 255, 255, 0.9);
}
.time-text {
font-size: 15px;
font-weight: 500;
color: var(--text-primary);
}
.time-slot.selected .time-text {
color: white;
}
.status-text {
font-size: 12px;
color: var(--success-color);
}
.status-text.booked {
color: var(--danger-color);
}
.book-btn {
width: 100%;
padding: 12px;
background-color: var(--primary-color);
color: white;
border: none;
border-radius: 8px;
font-size: 16px;
font-weight: 500;
cursor: pointer;
transition: background-color 0.2s ease;
position: relative;
overflow: hidden;
}
.book-btn:hover {
background-color: var(--primary-hover);
}
.book-btn::after {
content: '';
position: absolute;
top: 50%;
left: 50%;
width: 0;
height: 0;
background: rgba(255, 255, 255, 0.2);
border-radius: 50%;
transform: translate(-50%, -50%);
transition: width 0.6s ease, height 0.6s ease;
}
.book-btn:active::after {
width: 300px;
height: 300px;
}
/* 弹窗样式 */
.modal {
display: none;
position: fixed;
top: 0;
left: 0;
width: 100%;
height: 100%;
background-color: rgba(0, 0, 0, 0.5);
z-index: 1000;
}
.modal-content {
position: relative;
width: 90%;
max-width: 560px;
margin: 40px auto;
background: var(--card-background);
border-radius: 12px;
overflow: hidden;
}
.modal-header {
padding: 20px 24px;
border-bottom: 1px solid var(--border-color);
display: flex;
justify-content: space-between;
align-items: center;
}
.modal-header h3 {
font-size: 18px;
font-weight: 600;
}
.close-btn {
background: none;
border: none;
font-size: 24px;
color: var(--text-light);
cursor: pointer;
}
.modal-body {
padding: 24px;
}
.date-picker {
margin: 20px 0;
}
.date-nav {
display: flex;
justify-content: center;
align-items: center;
gap: 16px;
}
.time-picker {
display: grid;
gap: 20px;
}
.time-grid {
display: grid;
grid-template-columns: repeat(4, 1fr);
gap: 12px;
padding: 16px 0;
}
.time-period {
background: var(--background);
border-radius: 8px;
padding: 16px;
margin-bottom: 16px;
}
.time-period h4 {
color: var(--text-secondary);
margin-bottom: 12px;
font-weight: 500;
}
.modal-footer {
padding: 16px 24px;
border-top: 1px solid var(--border-color);
display: flex;
justify-content: flex-end;
gap: 12px;
}
.modal-footer button {
padding: 8px 24px;
border-radius: 6px;
font-size: 14px;
cursor: pointer;
}
.cancel-btn {
background: none;
border: 1px solid var(--border-color);
color: var(--text-secondary);
}
.confirm-btn {
background-color: var(--primary-color);
border: none;
color: white;
}
/* 响应式适配 */
@media (max-width: 768px) {
.container {
padding: 16px;
}
.modal-content {
width: 95%;
margin: 20px auto;
}
}
.toast {
position: fixed;
top: 20px;
left: 50%;
transform: translateX(-50%) translateY(-100%);
background-color: rgba(0, 0, 0, 0.8);
color: white;
padding: 12px 24px;
border-radius: 4px;
font-size: 14px;
z-index: 2000;
opacity: 0;
transition: all 0.3s ease;
}
.toast.show {
transform: translateX(-50%) translateY(0);
opacity: 1;
}
/* 加载动画 */
.loading-overlay {
position: fixed;
top: 0;
left: 0;
right: 0;
bottom: 0;
background: rgba(255, 255, 255, 0.9);
display: flex;
justify-content: center;
align-items: center;
z-index: 2000;
opacity: 0;
visibility: hidden;
transition: all 0.3s ease;
}
.loading-overlay.show {
opacity: 1;
visibility: visible;
}
.loading-spinner {
width: 40px;
height: 40px;
border: 3px solid var(--primary-color);
border-radius: 50%;
border-top-color: transparent;
animation: spin 0.8s linear infinite;
}
/* 动画关键帧 */
@keyframes spin {
to { transform: rotate(360deg); }
}
@keyframes checkmark {
from {
transform: scale(0) rotate(-45deg);
}
to {
transform: scale(1) rotate(0);
}
}
@keyframes cardAppear {
from {
opacity: 0;
transform: translateY(20px);
}
to {
opacity: 1;
transform: translateY(0);
}
}
/* 脉冲动画效果 */
@keyframes pulse {
0% { transform: scale(1); }
50% { transform: scale(1.05); }
100% { transform: scale(1); }
}
.loading-slots {
text-align: center;
padding: 20px;
color: var(--text-secondary);
font-size: 14px;
}
.error-slots {
text-align: center;
padding: 16px;
color: var(--danger-color);
background-color: rgba(244, 67, 54, 0.1);
border-radius: 8px;
cursor: pointer;
transition: background-color 0.3s ease;
}
.error-slots:hover {
background-color: rgba(244, 67, 54, 0.15);
}
/* 选中动画 */
@keyframes selectPulse {
0% {
transform: scale(1) translateY(-2px);
}
50% {
transform: scale(1.05) translateY(-2px);
}
100% {
transform: scale(1) translateY(-2px);
}
}
.time-slot.selected {
animation: selectPulse 0.3s ease;
}
/* 点击涟漪效果 */
.time-slot::after {
content: '';
position: absolute;
top: 50%;
left: 50%;
width: 100%;
height: 100%;
background: radial-gradient(circle, white 10%, transparent 10.01%);
transform: translate(-50%, -50%) scale(0);
opacity: 0;
pointer-events: none;
transition: transform 0.4s, opacity 0.8s;
}
.time-slot:active::after {
transform: translate(-50%, -50%) scale(4);
opacity: 0.3;
transition: 0s;
}
/* 响应式调整 */
@media (max-width: 768px) {
.time-slots-grid {
gap: 8px;
padding: 8px;
}
.time-slot {
padding: 10px 6px;
}
.time-text {
font-size: 14px;
}
.status-text {
font-size: 11px;
}
}
/* 响应式布局调整 */
@media (max-width: 1200px) {
.time-slots-grid {
grid-template-columns: repeat(auto-fill, minmax(85px, 1fr));
gap: 10px;
}
}
@media (max-width: 768px) {
.time-slots-grid {
grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
gap: 8px;
padding: 8px;
}
.time-slot {
padding: 8px 6px;
}
.time-text {
font-size: 14px;
}
.status-text {
font-size: 12px;
}
}
@media (max-width: 480px) {
.time-slots-grid {
grid-template-columns: repeat(3, 1fr);
gap: 6px;
padding: 6px;
}
.time-slot {
padding: 6px 4px;
}
.time-text {
font-size: 13px;
}
.status-text {
font-size: 11px;
}
}
.time-slots-container {
padding: 12px;
}
.period-title {
font-size: 14px;
color: var(--text-secondary);
margin: 12px 0 8px;
padding-left: 4px;
}
.time-slots-grid {
display: grid;
grid-template-columns: repeat(3, 1fr);
gap: 10px;
margin-bottom: 16px;
}
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化