added 搜索功能
This commit is contained in:
1 parent
dff9da6143
commit
0b4990c5d2
7 files changed
+803
-2
No files matched your search
@@ -3269,6 +3269,393 @@ html[data-theme="light"] .atk-loading-spinner svg circle {
|
||||
|
||||
.artalk.hidden { display: none; }
|
||||
|
||||
/* Search Modal Styles */
|
||||
.search-modal {
|
||||
display: none; /* Hidden by default */
|
||||
position: fixed;
|
||||
z-index: 1000;
|
||||
left: 0;
|
||||
top: 0;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
overflow: auto;
|
||||
background-color: rgba(0, 0, 0, 0.4); /* Black w/ opacity */
|
||||
backdrop-filter: blur(5px);
|
||||
-webkit-backdrop-filter: blur(5px);
|
||||
opacity: 0;
|
||||
transition: opacity 0.3s ease;
|
||||
}
|
||||
|
||||
.search-modal.show {
|
||||
display: flex;
|
||||
opacity: 1;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
}
|
||||
|
||||
.search-modal-content {
|
||||
background-color: #fefefe;
|
||||
margin: auto;
|
||||
padding: 20px;
|
||||
border: 1px solid #888;
|
||||
width: 80%;
|
||||
max-width: 600px;
|
||||
border-radius: 12px;
|
||||
box-shadow: 0 4px 20px rgba(0,0,0,0.1);
|
||||
transform: translateY(-20px);
|
||||
transition: transform 0.3s ease;
|
||||
}
|
||||
|
||||
.search-modal.show .search-modal-content {
|
||||
transform: translateY(0);
|
||||
}
|
||||
|
||||
.search-header {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
margin-bottom: 20px;
|
||||
border-bottom: 1px solid #eee;
|
||||
padding-bottom: 10px;
|
||||
}
|
||||
|
||||
.search-header h3 {
|
||||
margin: 0;
|
||||
font-size: 1.2rem;
|
||||
color: #333;
|
||||
}
|
||||
|
||||
.close-search {
|
||||
color: #aaa;
|
||||
font-size: 28px;
|
||||
font-weight: bold;
|
||||
cursor: pointer;
|
||||
line-height: 1;
|
||||
}
|
||||
|
||||
.close-search:hover,
|
||||
.close-search:focus {
|
||||
color: black;
|
||||
text-decoration: none;
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
.search-input-wrapper {
|
||||
display: flex;
|
||||
margin-bottom: 20px;
|
||||
border: 1px solid #ddd;
|
||||
border-radius: 8px;
|
||||
padding: 5px 10px;
|
||||
background: #f9f9f9;
|
||||
}
|
||||
|
||||
.search-input-wrapper input {
|
||||
flex: 1;
|
||||
border: none;
|
||||
background: transparent;
|
||||
padding: 10px;
|
||||
font-size: 16px;
|
||||
outline: none;
|
||||
}
|
||||
|
||||
.search-input-wrapper button {
|
||||
background: none;
|
||||
border: none;
|
||||
cursor: pointer;
|
||||
color: #666;
|
||||
padding: 0 10px;
|
||||
}
|
||||
|
||||
.search-results {
|
||||
max-height: 400px;
|
||||
overflow-y: auto;
|
||||
}
|
||||
|
||||
.search-result-item {
|
||||
padding: 15px;
|
||||
border-bottom: 1px solid #f0f0f0;
|
||||
transition: background-color 0.2s;
|
||||
}
|
||||
|
||||
.search-result-item:last-child {
|
||||
border-bottom: none;
|
||||
}
|
||||
|
||||
.search-result-item:hover {
|
||||
background-color: #f5f5f5;
|
||||
}
|
||||
|
||||
.search-result-title {
|
||||
font-size: 16px;
|
||||
font-weight: 600;
|
||||
margin-bottom: 5px;
|
||||
display: block;
|
||||
color: #333;
|
||||
text-decoration: none;
|
||||
}
|
||||
|
||||
.search-result-title:hover {
|
||||
color: var(--text-highlight-color);
|
||||
}
|
||||
|
||||
.search-result-date {
|
||||
font-size: 12px;
|
||||
color: #999;
|
||||
margin-bottom: 5px;
|
||||
display: block;
|
||||
}
|
||||
|
||||
.search-result-summary {
|
||||
font-size: 14px;
|
||||
color: #666;
|
||||
line-height: 1.5;
|
||||
display: -webkit-box;
|
||||
-webkit-line-clamp: 2;
|
||||
-webkit-box-orient: vertical;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
.search-tip {
|
||||
text-align: center;
|
||||
color: #999;
|
||||
padding: 20px;
|
||||
}
|
||||
|
||||
/* Dark Mode Adaptation */
|
||||
[data-theme="dark"] .search-modal-content {
|
||||
background-color: #2d2d2d;
|
||||
border-color: #444;
|
||||
color: #e0e0e0;
|
||||
}
|
||||
|
||||
[data-theme="dark"] .search-header {
|
||||
border-bottom-color: #444;
|
||||
}
|
||||
|
||||
[data-theme="dark"] .search-header h3 {
|
||||
color: #e0e0e0;
|
||||
}
|
||||
|
||||
[data-theme="dark"] .close-search {
|
||||
color: #888;
|
||||
}
|
||||
|
||||
[data-theme="dark"] .close-search:hover {
|
||||
color: #fff;
|
||||
}
|
||||
|
||||
[data-theme="dark"] .search-input-wrapper {
|
||||
background: #333;
|
||||
border-color: #555;
|
||||
}
|
||||
|
||||
[data-theme="dark"] .search-input-wrapper input {
|
||||
color: #e0e0e0;
|
||||
}
|
||||
|
||||
[data-theme="dark"] .search-input-wrapper button {
|
||||
color: #aaa;
|
||||
}
|
||||
|
||||
[data-theme="dark"] .search-result-item {
|
||||
border-bottom-color: #444;
|
||||
}
|
||||
|
||||
[data-theme="dark"] .search-result-item:hover {
|
||||
background-color: #383838;
|
||||
}
|
||||
|
||||
[data-theme="dark"] .search-result-title {
|
||||
color: #e0e0e0;
|
||||
}
|
||||
|
||||
[data-theme="dark"] .search-result-summary {
|
||||
color: #aaa;
|
||||
}
|
||||
|
||||
/* Inline Search Styles */
|
||||
.searchable-header-container {
|
||||
position: relative;
|
||||
margin-top: 15px;
|
||||
height: 13px;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.section-header.normal-mode {
|
||||
cursor: pointer;
|
||||
transition: opacity 0.3s ease;
|
||||
margin: 0;
|
||||
user-select: none;
|
||||
line-height: 1;
|
||||
}
|
||||
|
||||
.section-header.normal-mode:hover {
|
||||
opacity: 0.7;
|
||||
}
|
||||
|
||||
.search-hint {
|
||||
font-size: 12px;
|
||||
font-weight: normal;
|
||||
color: #999;
|
||||
margin-left: 10px;
|
||||
opacity: 0; /* Hidden by default */
|
||||
transform: translateX(-5px);
|
||||
transition: all 0.3s ease;
|
||||
display: inline-block;
|
||||
vertical-align: middle;
|
||||
}
|
||||
|
||||
.section-header.normal-mode:hover .search-hint {
|
||||
opacity: 1;
|
||||
transform: translateX(0);
|
||||
}
|
||||
|
||||
/* Mobile: always show hint to ensure discoverability */
|
||||
@media (max-width: 768px) {
|
||||
.search-hint {
|
||||
opacity: 0.6;
|
||||
transform: translateX(0);
|
||||
}
|
||||
}
|
||||
|
||||
.search-mode {
|
||||
width: 100%;
|
||||
animation: fadeIn 0.3s ease;
|
||||
}
|
||||
|
||||
.search-input-group {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
background: transparent;
|
||||
border-bottom: 1px solid #e5e7eb;
|
||||
padding: 0 5px;
|
||||
width: 100%;
|
||||
max-width: 300px;
|
||||
transition: all 0.3s ease;
|
||||
}
|
||||
|
||||
.search-input-group:focus-within {
|
||||
background: transparent;
|
||||
border-bottom-color: var(--text-highlight-color);
|
||||
box-shadow: none;
|
||||
}
|
||||
|
||||
.search-input-group input {
|
||||
border: none;
|
||||
background: transparent;
|
||||
flex: 1;
|
||||
padding: 5px 10px;
|
||||
font-size: 14px;
|
||||
outline: none;
|
||||
color: #333;
|
||||
}
|
||||
|
||||
.search-input-group .search-icon {
|
||||
color: #999;
|
||||
font-size: 16px;
|
||||
}
|
||||
|
||||
.search-input-group .close-icon {
|
||||
color: #999;
|
||||
cursor: pointer;
|
||||
font-size: 16px;
|
||||
padding: 5px;
|
||||
}
|
||||
|
||||
.search-input-group .close-icon:hover {
|
||||
color: #333;
|
||||
}
|
||||
|
||||
.search-dropdown {
|
||||
position: absolute;
|
||||
top: 100%;
|
||||
left: 0;
|
||||
width: 100%;
|
||||
max-width: 300px;
|
||||
background: #fff;
|
||||
border-radius: 4px;
|
||||
box-shadow: 0 4px 12px rgba(0,0,0,0.1);
|
||||
z-index: 100;
|
||||
max-height: 300px;
|
||||
overflow-y: auto;
|
||||
display: none;
|
||||
margin-top: 5px;
|
||||
border: 1px solid #eee;
|
||||
}
|
||||
|
||||
.search-dropdown .search-result-item {
|
||||
padding: 10px 15px;
|
||||
font-size: 14px;
|
||||
display: block; /* Ensure it behaves like a block */
|
||||
text-decoration: none; /* Remove underline */
|
||||
color: inherit; /* Inherit text color */
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
.search-dropdown .search-result-item:hover {
|
||||
background-color: #f5f5f5;
|
||||
text-decoration: none;
|
||||
}
|
||||
|
||||
.search-dropdown .search-result-title {
|
||||
font-size: 15px;
|
||||
font-weight: 600;
|
||||
display: block; /* Ensure title is block to break line */
|
||||
color: #333;
|
||||
}
|
||||
|
||||
.search-dropdown .search-result-summary {
|
||||
font-size: 12px;
|
||||
-webkit-line-clamp: 1;
|
||||
}
|
||||
|
||||
/* Dark Mode for Inline Search */
|
||||
[data-theme="dark"] .search-input-group {
|
||||
background: transparent;
|
||||
border-bottom-color: #444;
|
||||
}
|
||||
|
||||
[data-theme="dark"] .search-input-group:focus-within {
|
||||
background: transparent;
|
||||
border-bottom-color: var(--text-highlight-color);
|
||||
}
|
||||
|
||||
[data-theme="dark"] .search-input-group input {
|
||||
color: #e0e0e0;
|
||||
}
|
||||
|
||||
[data-theme="dark"] .search-input-group .search-icon,
|
||||
[data-theme="dark"] .search-input-group .close-icon {
|
||||
color: #888;
|
||||
}
|
||||
|
||||
[data-theme="dark"] .search-input-group .close-icon:hover {
|
||||
color: #fff;
|
||||
}
|
||||
|
||||
[data-theme="dark"] .search-dropdown {
|
||||
background: #2d2d2d;
|
||||
border-color: #444;
|
||||
}
|
||||
|
||||
[data-theme="dark"] .search-dropdown .search-result-item {
|
||||
color: #e0e0e0;
|
||||
}
|
||||
|
||||
[data-theme="dark"] .search-dropdown .search-result-item:hover {
|
||||
background-color: #383838;
|
||||
}
|
||||
|
||||
[data-theme="dark"] .search-dropdown .search-result-title {
|
||||
color: #e0e0e0;
|
||||
}
|
||||
|
||||
@keyframes fadeIn {
|
||||
from { opacity: 0; transform: translateX(-10px); }
|
||||
to { opacity: 1; transform: translateX(0); }
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
Reference in new issue
Block a user