mirror of
https://github.com/linux-odyssey/linux-odyssey.git
synced 2026-11-05 19:20:12 +08:00
Style: Add file/folder icon in file tree (#149)
This commit is contained in:
3 files changed
+57
-47
No files matched your search
@@ -20,7 +20,21 @@ function nodeClass() {
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<a href="#" :class="nodeClass()">{{ node.discovered ? node.name : '???' }}</a>
|
||||
<a href="#" :class="nodeClass()">
|
||||
<font-awesome-icon
|
||||
v-if="node.type === 'folder'"
|
||||
:icon="['far', 'folder']"
|
||||
class="text-text-primary size-8"
|
||||
/>
|
||||
<font-awesome-icon
|
||||
v-else
|
||||
:icon="['far', 'file']"
|
||||
class="text-text-primary size-8"
|
||||
/>
|
||||
<br />
|
||||
{{ node.discovered ? node.name : '???' }}
|
||||
{{ node.name === '' && node.discovered ? '/' : '' }}
|
||||
</a>
|
||||
<ul :class="nodeClass()" v-if="node.children && node.children.length > 0">
|
||||
<li :class="nodeClass()" v-for="child in node.children" :key="child.path">
|
||||
<FileNode :node="child" :pwd="pwd" />
|
||||
|
||||
@@ -48,14 +48,14 @@ const sessionStore = useSession()
|
||||
position: absolute;
|
||||
top: 0;
|
||||
right: 50%;
|
||||
border-top: 1px solid #00ff00;
|
||||
border-top: 2px solid #00ff00;
|
||||
width: 50%;
|
||||
height: 20px;
|
||||
}
|
||||
.tree li::after {
|
||||
right: auto;
|
||||
left: 50%;
|
||||
border-left: 1px solid #00ff00;
|
||||
border-left: 2px solid #00ff00;
|
||||
}
|
||||
|
||||
.tree li:only-child::after,
|
||||
@@ -73,7 +73,7 @@ const sessionStore = useSession()
|
||||
}
|
||||
|
||||
.tree li:last-child::before {
|
||||
border-right: 1px solid #00ff00;
|
||||
border-right: 2px solid #00ff00;
|
||||
border-radius: 0 5px 0 0;
|
||||
-webkit-border-radius: 0 5px 0 0;
|
||||
-moz-border-radius: 0 5px 0 0;
|
||||
@@ -89,7 +89,7 @@ const sessionStore = useSession()
|
||||
position: absolute;
|
||||
top: 0;
|
||||
left: 50%;
|
||||
border-left: 1px solid #00ff00;
|
||||
border-left: 2px solid #00ff00;
|
||||
width: 0;
|
||||
height: 20px;
|
||||
}
|
||||
@@ -100,7 +100,7 @@ const sessionStore = useSession()
|
||||
text-decoration: none;
|
||||
color: #ffffff;
|
||||
font-family: arial, verdana, tahoma;
|
||||
font-size: 11px;
|
||||
font-size: 12px;
|
||||
display: inline-block;
|
||||
|
||||
border-radius: 5px;
|
||||
@@ -112,18 +112,10 @@ const sessionStore = useSession()
|
||||
-moz-transition: all 0.5s;
|
||||
}
|
||||
|
||||
a.discovered {
|
||||
background: #526b4e;
|
||||
color: #000;
|
||||
border: 1px solid #94a0b4;
|
||||
}
|
||||
|
||||
ul.discovered,
|
||||
li.discovered {
|
||||
border-color: #94a0b4;
|
||||
}
|
||||
|
||||
a.pwd {
|
||||
box-shadow: 0 0 40px rgba(255, 255, 0, 20);
|
||||
.tree li a.pwd {
|
||||
border: 3px solid #00ff00;
|
||||
background: #008080;
|
||||
font-weight: bold;
|
||||
font-size: 13px;
|
||||
}
|
||||
</style>
|
||||
+32
-28
@@ -3,28 +3,30 @@ import { library } from '@fortawesome/fontawesome-svg-core'
|
||||
|
||||
/* import specific icons */
|
||||
import {
|
||||
faBars,
|
||||
faArrowLeft,
|
||||
faList,
|
||||
faGear,
|
||||
faTriangleExclamation,
|
||||
faExpand,
|
||||
faTerminal,
|
||||
faArrowRotateLeft,
|
||||
faArrowRightFromBracket,
|
||||
faArrowRight,
|
||||
faArrowRightFromBracket,
|
||||
faArrowRotateLeft,
|
||||
faBars,
|
||||
faBug,
|
||||
faCircleExclamation,
|
||||
faMap,
|
||||
faTrophy,
|
||||
faFileInvoice,
|
||||
faEnvelope,
|
||||
faExpand,
|
||||
faFileInvoice,
|
||||
faGear,
|
||||
faList,
|
||||
faMap,
|
||||
faPlay,
|
||||
faTerminal,
|
||||
faTriangleExclamation,
|
||||
faTrophy,
|
||||
} from '@fortawesome/free-solid-svg-icons'
|
||||
import {
|
||||
faLightbulb,
|
||||
faCircleQuestion,
|
||||
faCircleRight,
|
||||
faFile,
|
||||
faFolder,
|
||||
faLightbulb,
|
||||
} from '@fortawesome/free-regular-svg-icons'
|
||||
import {
|
||||
faFacebook,
|
||||
@@ -34,27 +36,29 @@ import {
|
||||
|
||||
/* add icons to the library */
|
||||
library.add(
|
||||
faBars,
|
||||
faArrowLeft,
|
||||
faList,
|
||||
faGear,
|
||||
faTriangleExclamation,
|
||||
faExpand,
|
||||
faTerminal,
|
||||
faArrowRotateLeft,
|
||||
faArrowRightFromBracket,
|
||||
faArrowRight,
|
||||
faArrowRightFromBracket,
|
||||
faArrowRotateLeft,
|
||||
faBars,
|
||||
faBug,
|
||||
faMap,
|
||||
faTrophy,
|
||||
faCircleExclamation,
|
||||
faLightbulb,
|
||||
faEnvelope,
|
||||
faExpand,
|
||||
faFileInvoice,
|
||||
faGear,
|
||||
faList,
|
||||
faMap,
|
||||
faPlay,
|
||||
faTerminal,
|
||||
faTriangleExclamation,
|
||||
faTrophy,
|
||||
faCircleQuestion,
|
||||
faCircleRight,
|
||||
faGithub,
|
||||
faGoogle,
|
||||
faFileInvoice,
|
||||
faFile,
|
||||
faFolder,
|
||||
faLightbulb,
|
||||
faFacebook,
|
||||
faEnvelope,
|
||||
faPlay
|
||||
faGithub,
|
||||
faGoogle
|
||||
)
|
||||
Reference in new issue
Block a user