Skip to content

Commit 7f24445

Browse files
committed
feat: Scale down the folder icon when expanding, b=no-bug, c=folders
1 parent 4899234 commit 7f24445

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

src/zen/folders/ZenFolders.mjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -815,14 +815,14 @@
815815
updateFolderIcon(group, state = 'auto', play = true) {
816816
const svg = group.querySelector('svg');
817817
if (!svg) return [];
818-
819818
let animations = this.#folderAnimCache.get(group);
820819
if (!animations) {
821820
animations = svg.querySelectorAll('animate, animateTransform, animateMotion');
822821
this.#folderAnimCache.set(group, animations);
823822
}
824823

825824
const isCollapsed = group.collapsed;
825+
svg.setAttribute('state', state === 'auto' ? (isCollapsed ? 'close' : 'open') : state);
826826
const hasActive = group.hasAttribute('has-active');
827827

828828
const OPACITY = {

src/zen/folders/zen-folders.css

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -260,6 +260,8 @@ zen-folder {
260260

261261
& svg {
262262
filter: contrast(150%);
263+
transition: 0.2s scale;
264+
transform-origin: right bottom;
263265

264266
& image {
265267
fill-opacity: 0.9;
@@ -268,6 +270,10 @@ zen-folder {
268270
transform: translate(-180%, 8%);
269271
}
270272
}
273+
274+
& svg[state='open'] {
275+
scale: 0.9;
276+
}
271277
}
272278

273279
&::before {

0 commit comments

Comments
 (0)