Add My Library for reusable assets (clip art, templates)

- Save layer or selection to personal library
- Browse library with category grouping and thumbnails
- Insert assets as new layers (double-click or Insert button)
- Delete unwanted assets
- Export library to JSON for backup
- Import library from JSON backup
- Assets stored in browser IndexedDB (persistent)
- Categories: General, Shapes, Borders, Icons, Templates, etc.
This commit is contained in:
Claude
2026-01-27 13:15:58 +00:00
parent 4d4947df13
commit 8087d6967a
3 changed files with 618 additions and 0 deletions
+76
View File
@@ -563,6 +563,82 @@ IMPORTANT: any new icon should also must be added on /service-worker.js + its ve
color: var(--text-color);
cursor:pointer;
}
/* My Library browser */
.library-browser{
max-height: 400px;
overflow-y: auto;
padding: 10px;
}
.library-category{
margin-bottom: 20px;
}
.library-category h3{
margin: 0 0 10px 0;
padding-bottom: 5px;
border-bottom: 1px solid var(--border-color);
color: var(--text-color);
font-size: 14px;
}
.library-items{
display: flex;
flex-wrap: wrap;
gap: 10px;
}
.library-item{
width: 120px;
padding: 8px;
background: var(--area-background-color);
border: 1px solid var(--border-color);
border-radius: 4px;
cursor: pointer;
transition: 0.2s;
}
.library-item:hover{
border-color: var(--background-color-active);
transform: scale(1.02);
}
.library-item img{
width: 100%;
height: 80px;
object-fit: contain;
background: repeating-conic-gradient(#808080 0% 25%, #666 0% 50%) 50% / 10px 10px;
border-radius: 2px;
}
.library-item-name{
margin-top: 5px;
font-size: 11px;
color: var(--text-color);
text-align: center;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
}
.library-item-actions{
display: flex;
gap: 5px;
margin-top: 5px;
}
.library-item-actions button{
flex: 1;
padding: 3px 5px;
font-size: 10px;
cursor: pointer;
border: 1px solid var(--border-color);
border-radius: 3px;
background: var(--section-background-color);
color: var(--text-color);
}
.library-item-actions .insert-btn{
background: var(--background-color-active);
color: var(--text-color-active);
}
.library-item-actions .delete-btn:hover{
background: #dc3545;
color: #fff;
}
.library-dialog .dialog_content{
min-width: 500px;
}
.sidebar_right .label{
display: inline-block;
}