Files
navigation-app/frontend/styles.css

360 lines
6.3 KiB
CSS
Raw Permalink Normal View History

2025-03-26 00:42:53 +08:00
:root {
--primary-color: #3498db;
--secondary-color: #2ecc71;
--danger-color: #e74c3c;
2025-03-26 02:48:52 +08:00
--warning-color: #f39c12;
2025-03-26 00:42:53 +08:00
--text-color: #333;
--bg-color: #f5f5f5;
--card-color: #fff;
--border-color: #ddd;
--shadow-color: rgba(0, 0, 0, 0.1);
}
[data-theme="dark"] {
--primary-color: #2980b9;
--secondary-color: #27ae60;
--danger-color: #c0392b;
2025-03-26 02:48:52 +08:00
--warning-color: #d35400;
2025-03-26 00:42:53 +08:00
--text-color: #f5f5f5;
--bg-color: #121212;
--card-color: #1e1e1e;
--border-color: #333;
--shadow-color: rgba(0, 0, 0, 0.3);
}
* {
margin: 0;
padding: 0;
box-sizing: border-box;
font-family: 'Arial', sans-serif;
transition: background-color 0.3s, color 0.3s;
}
body {
background-color: var(--bg-color);
color: var(--text-color);
line-height: 1.6;
}
.container {
max-width: 1400px;
margin: 0 auto;
padding: 20px;
}
header {
display: flex;
justify-content: space-between;
align-items: center;
margin-bottom: 30px;
padding-bottom: 20px;
border-bottom: 1px solid var(--border-color);
flex-wrap: wrap;
}
.header-left, .header-right {
display: flex;
align-items: center;
2025-03-26 02:48:52 +08:00
gap: 15px;
flex-wrap: wrap;
2025-03-26 00:42:53 +08:00
}
h1 {
font-size: 2rem;
color: var(--primary-color);
2025-03-26 02:48:52 +08:00
display: flex;
align-items: center;
gap: 10px;
2025-03-26 00:42:53 +08:00
}
.search-box {
position: relative;
min-width: 250px;
}
.search-box input {
width: 100%;
padding: 8px 15px 8px 35px;
border: 1px solid var(--border-color);
border-radius: 20px;
background-color: var(--card-color);
color: var(--text-color);
}
.search-box i {
position: absolute;
left: 12px;
top: 50%;
transform: translateY(-50%);
color: var(--text-color);
opacity: 0.7;
}
2025-03-26 02:48:52 +08:00
button {
2025-03-26 00:42:53 +08:00
padding: 8px 16px;
background-color: var(--primary-color);
color: white;
border: none;
border-radius: 4px;
cursor: pointer;
display: flex;
align-items: center;
gap: 5px;
2025-03-26 02:48:52 +08:00
font-size: 0.9rem;
2025-03-26 00:42:53 +08:00
}
2025-03-26 02:48:52 +08:00
button:hover {
2025-03-26 00:42:53 +08:00
opacity: 0.9;
}
2025-03-26 02:48:52 +08:00
button i {
2025-03-26 00:42:53 +08:00
font-size: 0.9rem;
}
2025-03-26 02:48:52 +08:00
#loginBtn, #logoutBtn {
background-color: var(--secondary-color);
}
#logoutBtn {
background-color: var(--warning-color);
}
.loading, .error {
text-align: center;
padding: 20px;
color: var(--primary-color);
}
.error {
color: var(--danger-color);
2025-03-26 00:42:53 +08:00
}
.categories {
display: flex;
flex-direction: column;
gap: 30px;
}
.category {
background-color: var(--card-color);
border-radius: 8px;
padding: 20px;
box-shadow: 0 2px 5px var(--shadow-color);
}
.category h2 {
margin-bottom: 15px;
color: var(--primary-color);
padding-bottom: 10px;
border-bottom: 1px solid var(--border-color);
display: flex;
align-items: center;
gap: 10px;
}
.sites {
display: grid;
grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
gap: 15px;
}
.site {
display: flex;
flex-direction: column;
align-items: center;
text-decoration: none;
color: var(--text-color);
2025-03-26 02:48:52 +08:00
transition: all 0.2s;
2025-03-26 00:42:53 +08:00
position: relative;
padding: 10px;
border-radius: 8px;
background-color: var(--bg-color);
}
.site:hover {
transform: translateY(-5px);
box-shadow: 0 5px 15px var(--shadow-color);
}
.site-icon {
width: 40px;
height: 40px;
margin-bottom: 8px;
border-radius: 50%;
object-fit: cover;
background-color: var(--border-color);
display: flex;
align-items: center;
justify-content: center;
font-size: 18px;
color: var(--primary-color);
}
2025-03-26 02:48:52 +08:00
.site-icon img {
width: 100%;
height: 100%;
border-radius: 50%;
object-fit: cover;
}
2025-03-26 00:42:53 +08:00
.site-name {
text-align: center;
font-size: 0.9rem;
word-break: break-word;
width: 100%;
}
.delete-btn {
position: absolute;
top: -8px;
right: -8px;
background-color: var(--danger-color);
color: white;
border: none;
border-radius: 50%;
width: 20px;
height: 20px;
font-size: 12px;
cursor: pointer;
display: none;
2025-03-26 02:48:52 +08:00
align-items: center;
justify-content: center;
2025-03-26 00:42:53 +08:00
}
.site:hover .delete-btn {
display: flex;
2025-03-26 02:48:52 +08:00
}
/* 拖拽相关样式 */
.site[draggable="true"] {
cursor: grab;
}
.site[draggable="true"]:active {
cursor: grabbing;
}
.site.dragging {
opacity: 0.5;
background-color: var(--primary-color);
2025-03-26 00:42:53 +08:00
}
/* 模态框样式 */
.modal {
display: none;
position: fixed;
z-index: 100;
left: 0;
top: 0;
width: 100%;
height: 100%;
background-color: rgba(0, 0, 0, 0.5);
}
.modal-content {
background-color: var(--card-color);
margin: 10% auto;
padding: 25px;
border-radius: 8px;
width: 90%;
max-width: 500px;
box-shadow: 0 4px 8px var(--shadow-color);
position: relative;
max-height: 80vh;
overflow-y: auto;
}
.modal h2 {
margin-bottom: 20px;
color: var(--primary-color);
display: flex;
align-items: center;
gap: 10px;
}
.close {
position: absolute;
top: 15px;
right: 20px;
font-size: 28px;
font-weight: bold;
color: var(--text-color);
cursor: pointer;
opacity: 0.7;
}
.close:hover {
opacity: 1;
}
.form-group {
margin-bottom: 15px;
}
.form-group label {
display: block;
margin-bottom: 5px;
font-weight: bold;
display: flex;
align-items: center;
gap: 8px;
}
2025-03-26 02:48:52 +08:00
.form-group input {
2025-03-26 00:42:53 +08:00
width: 100%;
padding: 10px;
border: 1px solid var(--border-color);
border-radius: 4px;
background-color: var(--bg-color);
color: var(--text-color);
}
form button {
background-color: var(--secondary-color);
color: white;
border: none;
padding: 10px 20px;
border-radius: 4px;
cursor: pointer;
font-size: 16px;
width: 100%;
display: flex;
align-items: center;
justify-content: center;
gap: 8px;
}
form button:hover {
opacity: 0.9;
}
2025-03-26 02:23:17 +08:00
@media (max-width: 768px) {
header {
flex-direction: column;
align-items: stretch;
gap: 15px;
}
.header-left, .header-right {
flex-direction: column;
align-items: stretch;
gap: 15px;
}
.search-box {
width: 100%;
}
2025-03-26 02:48:52 +08:00
.header-right button {
width: 100%;
2025-03-26 02:23:17 +08:00
justify-content: center;
}
.sites {
grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
}
2025-03-26 02:48:52 +08:00
.modal-content {
margin: 20% auto;
2025-03-26 02:23:17 +08:00
}
}