Refactor Header and Preview components: update tag handling styles, rename dropdown class, and clean up unused modal styles.

This commit is contained in:
sHa
2025-05-01 14:28:01 +03:00
parent 4a2230223c
commit 27ae28be63
2 changed files with 11 additions and 104 deletions

View File

@@ -42,7 +42,6 @@
{#if getTagObj(tagText)} {#if getTagObj(tagText)}
<button <button
class="selected-tag" class="selected-tag"
style={getTagObj(tagText).color ? `background: ${getTagObj(tagText).color}; color: #fff;` : ''}
aria-label={`Remove tag: ${getTagObj(tagText).text}`} aria-label={`Remove tag: ${getTagObj(tagText).text}`}
on:click={() => removeTag(getTagObj(tagText).text)} on:click={() => removeTag(getTagObj(tagText).text)}
> >
@@ -56,11 +55,10 @@
+ Tag{selectedTags.length ? '' : 's'} + Tag{selectedTags.length ? '' : 's'}
</button> </button>
{#if tagDropdownOpen} {#if tagDropdownOpen}
<div class="dropdown-list"> <div class="dropdown-menu">
{#each allTags.filter(t => !selectedTags.includes(t.text)) as tagObj} {#each allTags.filter(t => !selectedTags.includes(t.text)) as tagObj}
<button <button
class="dropdown-tag" class="dropdown-item"
style={tagObj.color ? `background: ${tagObj.color}; color: #fff;` : ''}
on:click={() => addTag(tagObj.text)} on:click={() => addTag(tagObj.text)}
aria-label={`Add tag: ${tagObj.text}`} aria-label={`Add tag: ${tagObj.text}`}
>{tagObj.text}</button> >{tagObj.text}</button>

View File

@@ -125,54 +125,17 @@ $: getLogoThemeColor = logo => getDefaultLogoColor(logo.colors, theme);
</div> </div>
<style> <style>
:global(.modal-backdrop) { /* Only component-specific styles that don't exist in global.css */
position: fixed; .preview-container {
top: 0; min-height: 200px;
left: 0; max-height: 60vh;
right: 0; max-width: 100%;
bottom: 0; padding: 2rem;
background-color: rgba(0, 0, 0, 0.7); overflow: auto;
display: flex;
align-items: center;
justify-content: center;
z-index: 1000;
} }
:global(.modal-content) { .preview-container img {
background: var(--color-card); max-height: 60vh;
color: var(--color-text);
border-radius: 8px;
padding: 1rem;
max-width: 500px;
width: 90%;
box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
border: 1px solid var(--color-border);
transition: background 0.2s, color 0.2s;
}
.modal-header {
display: flex;
justify-content: space-between;
align-items: center;
margin-bottom: 1rem;
}
.modal-header h2 {
margin: 0;
font-size: 1.5rem;
}
.close-btn {
background: none;
border: none;
font-size: 1.5rem;
cursor: pointer;
color: var(--color-text);
transition: color 0.2s;
}
.close-btn:hover {
color: var(--color-accent, #4f8cff);
} }
.modal-body img { .modal-body img {
@@ -180,63 +143,9 @@ $: getLogoThemeColor = logo => getDefaultLogoColor(logo.colors, theme);
margin-bottom: 1rem; margin-bottom: 1rem;
} }
.preview-container {
display: flex;
justify-content: center;
align-items: center;
background-color: var(--color-card);
border-radius: 4px;
padding: 2rem;
min-height: 200px;
max-height: 60vh;
max-width: 100%;
transition: background 0.2s, color 0.2s;
overflow: auto;
}
.preview-container img {
max-width: 100%;
max-height: 60vh;
object-fit: contain;
}
.logo-details {
padding: 1rem;
background-color: var(--color-card);
color: var(--text-color);
border-radius: 4px;
transition: background 0.2s, color 0.2s;
}
.logo-details p {
margin-bottom: 0.5rem;
}
.logo-tags { .logo-tags {
margin-top: 1rem;
display: flex; display: flex;
flex-wrap: wrap; flex-wrap: wrap;
gap: 0.5rem; gap: 0.5rem;
} }
.color-switcher-preview {
display: flex;
align-items: center;
}
.color-circle.color-reset {
background: none !important;
}
.color-circle {
width: 24px;
height: 24px;
border-radius: 50%;
display: inline-flex;
align-items: center;
justify-content: center;
margin-right: 4px;
cursor: pointer;
box-sizing: border-box;
}
</style> </style>