feat: style improvements, icon-only buttons

This commit is contained in:
2025-11-15 12:07:17 +01:00
parent 2c039ff661
commit f417bebf1a
3 changed files with 159 additions and 38 deletions

View File

@@ -234,8 +234,19 @@ function createLinkCard(link) {
<div class="link-footer"> <div class="link-footer">
<span class="link-date">${formattedDate}</span> <span class="link-date">${formattedDate}</span>
<div class="link-actions"> <div class="link-actions">
<button class="archive-btn">${link.archived ? 'Unarchive' : 'Archive'}</button> <button class="archive-btn" data-tooltip="${link.archived ? 'Unarchive' : 'Archive'}">
<button class="delete-btn">Delete</button> <svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
${link.archived
? '<path d="M21 16V8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73l7 4a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16z"/><polyline points="3.27 6.96 12 12.01 20.73 6.96"/><line x1="12" y1="22.08" x2="12" y2="12"/><path d="M9 12l3 3 3-3"/>'
: '<path d="M21 16V8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73l7 4a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16z"/><polyline points="3.27 6.96 12 12.01 20.73 6.96"/><line x1="12" y1="22.08" x2="12" y2="12"/>'
}
</svg>
</button>
<button class="delete-btn" data-tooltip="Delete">
<svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
<polyline points="3 6 5 6 21 6"/><path d="M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6m3 0V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2"/><line x1="10" y1="11" x2="10" y2="17"/><line x1="14" y1="11" x2="14" y2="17"/>
</svg>
</button>
</div> </div>
</div> </div>
</div> </div>

View File

@@ -53,7 +53,7 @@
required required
autocomplete="off" autocomplete="off"
> >
<button type="submit" id="addButton" class="btn-add"> <button type="submit" id="addButton" class="btn-add" data-tooltip="Add link">
<span class="btn-text">Add</span> <span class="btn-text">Add</span>
<span class="btn-loader" style="display: none;"> <span class="btn-loader" style="display: none;">
<svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"> <svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">

View File

@@ -39,7 +39,7 @@ body {
backdrop-filter: blur(20px); backdrop-filter: blur(20px);
border-bottom: 1px solid var(--border); border-bottom: 1px solid var(--border);
box-shadow: 0 4px 24px var(--shadow); box-shadow: 0 4px 24px var(--shadow);
padding: 1rem 0; padding: 0.75rem 0;
} }
.header-container { .header-container {
@@ -165,12 +165,12 @@ body {
.container { .container {
max-width: 1200px; max-width: 1200px;
margin: 0 auto; margin: 0 auto;
padding: 2rem 1rem; padding: 1.5rem 1rem;
} }
/* Top Section - Modern Unified Design */ /* Top Section - Modern Unified Design */
.top-section { .top-section {
margin-bottom: 3rem; margin-bottom: 1.5rem;
animation: fadeIn 0.6s ease-out; animation: fadeIn 0.6s ease-out;
} }
@@ -194,12 +194,12 @@ body {
.input-wrapper { .input-wrapper {
display: flex; display: flex;
align-items: center; align-items: center;
gap: 0.75rem; gap: 0.5rem;
background: var(--surface); background: var(--surface);
padding: 0.5rem 0.75rem; padding: 0.375rem 0.625rem;
border-radius: 12px; border-radius: 10px;
border: 1px solid var(--border); border: 1px solid var(--border);
box-shadow: 0 4px 12px var(--shadow); box-shadow: 0 2px 8px var(--shadow);
transition: all 0.3s ease; transition: all 0.3s ease;
} }
@@ -238,19 +238,72 @@ body {
background: linear-gradient(135deg, var(--primary-color), var(--secondary-color)); background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
color: white; color: white;
border: none; border: none;
padding: 0.625rem 1.25rem; padding: 0.5rem;
border-radius: 10px; border-radius: 8px;
font-size: 0.9rem; font-size: 0;
font-weight: 600; font-weight: 600;
cursor: pointer; cursor: pointer;
transition: all 0.3s ease; transition: all 0.3s ease;
white-space: nowrap; white-space: nowrap;
box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3); box-shadow: 0 2px 8px rgba(99, 102, 241, 0.3);
display: flex; display: flex;
align-items: center; align-items: center;
justify-content: center; justify-content: center;
min-width: 70px; width: 36px;
height: 36px;
position: relative; position: relative;
flex-shrink: 0;
}
.btn-add .btn-text {
display: none;
}
.btn-add::after {
content: '+';
font-size: 1.5rem;
font-weight: 300;
line-height: 1;
}
.btn-add::before {
content: attr(data-tooltip);
position: absolute;
bottom: 100%;
left: 50%;
transform: translateX(-50%) translateY(-0.5rem);
background: var(--surface);
color: var(--text-primary);
padding: 0.375rem 0.625rem;
border-radius: 6px;
font-size: 0.75rem;
font-weight: 500;
white-space: nowrap;
opacity: 0;
pointer-events: none;
transition: opacity 0.2s ease, transform 0.2s ease;
border: 1px solid var(--border);
box-shadow: 0 4px 12px var(--shadow);
z-index: 1000;
}
.btn-add:hover::before,
.btn-add:focus::before {
opacity: 1;
transform: translateX(-50%) translateY(-0.25rem);
}
/* Touch support for mobile */
@media (hover: none) and (pointer: coarse) {
.btn-add:active::before {
opacity: 1;
transform: translateX(-50%) translateY(-0.25rem);
}
}
.btn-add .btn-loader {
width: 16px;
height: 16px;
} }
.btn-add:hover:not(:disabled) { .btn-add:hover:not(:disabled) {
@@ -490,38 +543,93 @@ body {
font-size: 0.85rem; font-size: 0.85rem;
} }
.archive-btn { .archive-btn,
background: rgba(139, 92, 246, 0.2); .delete-btn {
color: var(--secondary-color); background: transparent;
border: 1px solid var(--secondary-color); color: var(--text-muted);
padding: 0.5rem 1rem; border: 1px solid var(--border);
padding: 0.375rem;
border-radius: 6px; border-radius: 6px;
font-size: 0.85rem; font-size: 0;
cursor: pointer; cursor: pointer;
transition: all 0.3s ease; transition: all 0.3s ease;
white-space: nowrap; white-space: nowrap;
width: 32px;
height: 32px;
display: flex;
align-items: center;
justify-content: center;
position: relative;
flex-shrink: 0;
}
.archive-btn svg,
.delete-btn svg {
width: 16px;
height: 16px;
stroke-width: 2;
}
.archive-btn {
color: var(--secondary-color);
border-color: rgba(139, 92, 246, 0.3);
} }
.archive-btn:hover { .archive-btn:hover {
background: var(--secondary-color); background: rgba(139, 92, 246, 0.2);
color: white; border-color: var(--secondary-color);
color: var(--secondary-color);
} }
.delete-btn { .delete-btn {
background: rgba(239, 68, 68, 0.2);
color: var(--error); color: var(--error);
border: 1px solid var(--error); border-color: rgba(239, 68, 68, 0.3);
padding: 0.5rem 1rem;
border-radius: 6px;
font-size: 0.85rem;
cursor: pointer;
transition: all 0.3s ease;
white-space: nowrap;
} }
.delete-btn:hover { .delete-btn:hover {
background: var(--error); background: rgba(239, 68, 68, 0.2);
color: white; border-color: var(--error);
color: var(--error);
}
/* Tooltip for icon buttons */
.archive-btn::before,
.delete-btn::before {
content: attr(data-tooltip);
position: absolute;
bottom: 100%;
left: 50%;
transform: translateX(-50%) translateY(-0.5rem);
background: var(--surface);
color: var(--text-primary);
padding: 0.375rem 0.625rem;
border-radius: 6px;
font-size: 0.75rem;
font-weight: 500;
white-space: nowrap;
opacity: 0;
pointer-events: none;
transition: opacity 0.2s ease, transform 0.2s ease;
border: 1px solid var(--border);
box-shadow: 0 4px 12px var(--shadow);
z-index: 1000;
}
.archive-btn:hover::before,
.delete-btn:hover::before,
.archive-btn:focus::before,
.delete-btn:focus::before {
opacity: 1;
transform: translateX(-50%) translateY(-0.25rem);
}
/* Touch support for mobile - show tooltip on tap */
@media (hover: none) and (pointer: coarse) {
.archive-btn:active::before,
.delete-btn:active::before {
opacity: 1;
transform: translateX(-50%) translateY(-0.25rem);
}
} }
@keyframes fadeIn { @keyframes fadeIn {
@@ -617,17 +725,19 @@ body {
.archive-btn, .archive-btn,
.delete-btn { .delete-btn {
flex: 1; width: 36px;
min-width: 80px; height: 36px;
} }
.input-wrapper { .input-wrapper {
flex-wrap: wrap; flex-wrap: nowrap;
} }
.btn-add { .btn-add {
width: 100%; width: 36px;
padding: 0.75rem 1.25rem; height: 36px;
padding: 0.5rem;
flex-shrink: 0;
} }
.links-container { .links-container {