diff --git a/public/css/main.css b/public/css/main.css index 86fe76af..252a902d 100644 --- a/public/css/main.css +++ b/public/css/main.css @@ -533,17 +533,8 @@ td.tr-le { color: #E84C4C; } content: "\25BC "; } -.folder-icon { - background-image: url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEwAACxMBAJqcGAAAADBJREFUOI1jZGBg+M+AHTDiEEcBTMQowgcY8biAKECxCwYeDHwYjBowbAw4SYH+YwB6YwSnsuTkoAAAAABJRU5ErkJggg=='); - width: 16px; - height: 16px; - display: inline-block; -} -.file-icon { - background-image: url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEwAACxMBAJqcGAAAAElJREFUOI1jYGBg+I8Dw0ADAwFAyID/hAwhxgC8hhBrAE5DSDEAqyGkGoBiCAsufyEBRnySTEQYQND0/wRV4dZLuQtGDRgMBgAARxw25MUCGPQAAAAASUVORK5CYII='); - width: 16px; - height: 16px; - display: inline-block; +.tr-filelist { + --nest-level: 0; } .tr-filelist td { padding: 4px 4px; @@ -551,7 +542,9 @@ td.tr-le { color: #E84C4C; } overflow: hidden; text-overflow: ellipsis; } -.tr-filelist td:first-child span { +/* The margin that gives the tree-like effect, based on the nest-level */ +.tr-filelist td:first-child::before { + margin-left: calc(var(--nest-level) * 2rem); margin-right: 0.5rem; } /* Filesize column */ @@ -562,3 +555,18 @@ td.tr-le { color: #E84C4C; } .tr-folder { cursor: pointer; } +/* The folder or file icon */ +.tr-folder td:first-child::before { + content: " "; + background-image: url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEwAACxMBAJqcGAAAADBJREFUOI1jZGBg+M+AHTDiEEcBTMQowgcY8biAKECxCwYeDHwYjBowbAw4SYH+YwB6YwSnsuTkoAAAAABJRU5ErkJggg=='); + width: 16px; + height: 16px; + display: inline-block; +} +.tr-file td:first-child::before { + content: " "; + background-image: url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEwAACxMBAJqcGAAAAElJREFUOI1jYGBg+I8Dw0ADAwFAyID/hAwhxgC8hhBrAE5DSDEAqyGkGoBiCAsufyEBRnySTEQYQND0/wRV4dZLuQtGDRgMBgAARxw25MUCGPQAAAAASUVORK5CYII='); + width: 16px; + height: 16px; + display: inline-block; +} diff --git a/public/css/tomorrow.css b/public/css/tomorrow.css index 36c657b2..9fcb7dcc 100644 --- a/public/css/tomorrow.css +++ b/public/css/tomorrow.css @@ -60,5 +60,5 @@ td.tr-le { color: #cc6666; } margin-bottom: -.5em; } -.folder-icon { filter: invert(100%); -webkit-filter: invert(100%); } -.file-icon { filter: invert(100%); -webkit-filter: invert(100%); } +.tr-folder td:first-child::before { filter: invert(100%); -webkit-filter: invert(100%); } +.tr-file td:first-child::before { filter: invert(100%); -webkit-filter: invert(100%); } diff --git a/templates/view.html b/templates/view.html index aa0aa629..80499969 100644 --- a/templates/view.html +++ b/templates/view.html @@ -46,8 +46,8 @@

{{call $.T "files"}}

{{ if gt (len .FileList) 0 }} {{/* how do i concat lol */}} - {{ $folderFormat := `{{.FolderName}}{{ fileSize .TotalSize .Data.T }}` }} - {{ $fileFormat := `{{.Filename}}{{ fileSize .Filesize .Data.T }}` }} + {{ $folderFormat := `{{.FolderName}}{{ fileSize .TotalSize .Data.T }}` }} + {{ $fileFormat := `{{.Filename}}{{ fileSize .Filesize .Data.T }}` }}