diff --git a/Makefile b/Makefile index 73f42aa..74b1850 100644 --- a/Makefile +++ b/Makefile @@ -4,7 +4,7 @@ build: go build pi: - env GOOS=linux GOARCH=arm GOARM=5 go build -o nas-pi + env GOOS=linux GOARCH=arm GOARM=5 go build -o nas-arm small: go build -ldflags="-s -w" diff --git a/README.md b/README.md index 85d9af4..22a113b 100644 --- a/README.md +++ b/README.md @@ -61,4 +61,8 @@ you can find a full configuration file under `assets/config_examples/providers.y ### custom provider custom file providers can be implemented by adding a new go file to the `files` module. it should -implement the `FileProviderInterface` interface. \ No newline at end of file +implement the `FileProviderInterface` interface. + +## icons + +SVG Icons provided by Paweł Kuna: https://github.com/tabler/tabler-icons (see assets/web/icons/README.md) \ No newline at end of file diff --git a/assets/web/css/styles.css b/assets/web/css/styles.css index 248d995..c78dc12 100644 --- a/assets/web/css/styles.css +++ b/assets/web/css/styles.css @@ -42,7 +42,7 @@ body, h1 a { } .list a { - padding: 1.5vh; + padding: 1vh; font-size: 24px; font-weight: bold; text-decoration: none; @@ -50,6 +50,15 @@ body, h1 a { transition: background-color 0.5s; -ms-word-wrap: anywhere; word-wrap: anywhere; + margin: 5px 0; + position: relative; + border-radius: 5px; +} + +.list a img { + left: 1vw; + top: 1vh; + position: absolute; } .list a.file { @@ -62,7 +71,7 @@ body, h1 a { .grid-lg a:visited, .grid-lg a, .list a:visited, .list a { - color: white; + color: var(--white); } .grid-lg a:hover, .list a.directory:hover { @@ -77,7 +86,7 @@ body, h1 a { } @media (prefers-color-scheme: dark) { - body { background-color: black; } + body, h1 a { background-color: black; } .grid-lg a { color: black; } @@ -124,17 +133,17 @@ input[type="file"] + label { padding: 10px; font-size: 1.25em; font-weight: 700; - color: var(--desktop-width); - background-color: var(--yellow); display: inline-block; border: 2px solid var(--orange); - border-radius: 5px 5px 0 0; - border-bottom: none; + border-radius: 5px; + transition: background-color 0.5s, color 0.5s; } input[type="file"]:focus + label, input[type="file"] + label:hover { - background-color: var(--platinum); + background-color: var(--orange); + color: var(--white); + transition: background-color 0.5s, color 0.5s; } progress { diff --git a/assets/web/icons/README.md b/assets/web/icons/README.md new file mode 100644 index 0000000..79c38ee --- /dev/null +++ b/assets/web/icons/README.md @@ -0,0 +1,23 @@ +SVG Icons provided by Paweł Kuna: https://github.com/tabler/tabler-icons under the MIT License + +MIT License + +Copyright (c) 2020 Paweł Kuna + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. \ No newline at end of file diff --git a/assets/web/icons/file.svg b/assets/web/icons/file.svg new file mode 100644 index 0000000..0b26472 --- /dev/null +++ b/assets/web/icons/file.svg @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/assets/web/icons/folder.svg b/assets/web/icons/folder.svg new file mode 100644 index 0000000..8013a71 --- /dev/null +++ b/assets/web/icons/folder.svg @@ -0,0 +1,4 @@ + + + + \ No newline at end of file diff --git a/assets/web/javascript/app.js b/assets/web/javascript/app.js index 47740a9..2045fc7 100644 --- a/assets/web/javascript/app.js +++ b/assets/web/javascript/app.js @@ -27,7 +27,7 @@ function getFileListing(provider, path = "") {
${files.map(file => ` - ${file.Name}${file.IsDirectory ? '/' : ''} + ${file.IsDirectory ? '' : ''}${file.Name} ` ).join('')} diff --git a/router/router.go b/router/router.go index b1a312a..eb83a0d 100644 --- a/router/router.go +++ b/router/router.go @@ -43,6 +43,7 @@ func Init() *mux.Router { // "Static" paths r.PathPrefix("/javascript/").Handler(http.StripPrefix("/javascript/", http.FileServer(http.Dir("assets/web/javascript")))) r.PathPrefix("/css/").Handler(http.StripPrefix("/css/", http.FileServer(http.Dir("assets/web/css")))) + r.PathPrefix("/icons/").Handler(http.StripPrefix("/icons/", http.FileServer(http.Dir("assets/web/icons")))) // Paths that require specific handlers r.Handle("/", Handle(