Skip to content

Commit 58970af

Browse files
committed
feat(defaultTheme): add item list icon
1 parent cf357b1 commit 58970af

File tree

2 files changed

+100
-7
lines changed

2 files changed

+100
-7
lines changed

src/tpl/defaultTheme/frontend/index.css

Lines changed: 92 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -417,11 +417,81 @@ html.dragging::before {
417417
padding-right: 2.2em;
418418
}
419419

420+
.item-list .detail {
421+
gap: 1em;
422+
}
423+
420424
.item-list .field {
421-
margin: 0 0 0 1em;
422425
flex-shrink: 0;
423426
}
424427

428+
/* icon */
429+
.item-list .icon {
430+
position: relative;
431+
width: 1em;
432+
height: 1em;
433+
color: #999;
434+
border: 1px currentColor solid;
435+
}
436+
437+
.item-list .icon::before {
438+
content: '';
439+
border: inherit;
440+
}
441+
442+
/* icon - parent */
443+
.item-list .parent .icon {
444+
border-top-color: transparent;
445+
border-right-color: transparent;
446+
border-bottom-left-radius: 0.3em;
447+
}
448+
449+
.item-list .parent .icon::before {
450+
position: absolute;
451+
left: -0.32em;
452+
top: -2px;
453+
width: 0;
454+
height: 0;
455+
border-width: 0 0.3em 0.6em;
456+
border-left-color: transparent;
457+
border-right-color: transparent;
458+
}
459+
460+
/* icon - dir */
461+
.item-list .dir .icon,
462+
.item-list .dir .icon::before {
463+
background-image: linear-gradient(to bottom, #ffd, #fec);
464+
}
465+
466+
.item-list .dir .icon::before {
467+
position: absolute;
468+
left: 0;
469+
bottom: 0;
470+
width: 1em;
471+
margin: 0 0 -1px -1px;
472+
height: 0.6em;
473+
transform: skewX(-30deg);
474+
transform-origin: left bottom;
475+
}
476+
477+
/* icon - file */
478+
.item-list .file .icon {
479+
border-top-right-radius: 0.4em;
480+
background-image: linear-gradient(to bottom, #fff, #f1f1f1);
481+
display: flex;
482+
align-items: center;
483+
justify-content: center;
484+
}
485+
486+
.item-list .file .icon::before {
487+
width: 0.7em;
488+
height: 0.25em;
489+
border-width: 1px 0;
490+
border-style: dotted;
491+
}
492+
493+
/* icon end */
494+
425495
.item-list .name {
426496
flex-grow: 1;
427497
flex-shrink: 1;
@@ -438,6 +508,10 @@ html.dragging::before {
438508
color: #666;
439509
}
440510

511+
.item-list .size:empty {
512+
display: none;
513+
}
514+
441515
.item-list .time {
442516
color: #999;
443517
text-align: right;
@@ -564,6 +638,23 @@ html.dragging::before {
564638
border-bottom-color: #222;
565639
}
566640

641+
.item-list .icon {
642+
color: #444;
643+
}
644+
645+
.item-list .parent .icon {
646+
color: #999
647+
}
648+
649+
.item-list .dir .icon,
650+
.item-list .dir .icon::before {
651+
background-image: linear-gradient(to bottom, #c96, #a74)
652+
}
653+
654+
.item-list .file .icon {
655+
background-image: linear-gradient(to bottom, #ccc, #bbb)
656+
}
657+
567658
.item-list .size {
568659
color: #999;
569660
}

src/tpl/defaultTheme/frontend/index.html

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -111,18 +111,20 @@ <h3>{{.Trans.UploadLabel}}</h3>
111111
</li>
112112
<li class="parent">
113113
<a href="{{if .IsRoot}}./{{else}}../{{end}}{{$contextQueryString}}" class="detail">
114-
<span class="field name" translate="no">../</span>
115-
<span class="field size"></span>
116-
<span class="field time"></span>
114+
<span class="icon" aria-hidden="true"></span>
115+
<span class="field name" translate="no">../</span>
116+
<span class="field size"></span>
117+
<span class="field time"></span>
117118
</a>
118119
</li>
119120
{{end}}
120121
{{range .SubItemsHtml}}
121122
<li class="{{.Type}}">
122123
<a href="{{.Url}}" class="detail">
123-
<span class="field name" translate="no">{{.DisplayName}}</span>
124-
<span class="field size">{{.DisplaySize}}</span>
125-
<span class="field time">{{.DisplayTime}}</span>
124+
<span class="icon" aria-hidden="true"></span>
125+
<span class="field name" translate="no">{{.DisplayName}}</span>
126+
<span class="field size">{{.DisplaySize}}</span>
127+
<span class="field time">{{.DisplayTime}}</span>
126128
</a>
127129
{{if and (not $isSimple) .DeleteUrl}}<form class="delete" method="post" action="{{$SubItemPrefix}}?delete" onsubmit="return confirmDelete(event)"><input type="hidden" name="name" value="{{.DeleteUrl}}"/><input type="hidden" name="contextquerystring" value="{{$contextQueryString}}"/><button type="submit">x</button></form>{{end}}
128130
</li>

0 commit comments

Comments
 (0)