Skip to content

Commit

Permalink
Improve UI
Browse files Browse the repository at this point in the history
  • Loading branch information
rsierra committed Apr 18, 2020
1 parent d42d6f8 commit 1280069
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 20 deletions.
8 changes: 5 additions & 3 deletions web/assets/css/app.css
Original file line number Diff line number Diff line change
Expand Up @@ -47,14 +47,16 @@ h1 a {
position: fixed;
top: 0; bottom: 0; left: 0; right: 0;
background: rgba(0, 0, 0, 0.7);
display: none;
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
}

.popup {
#qr-code .popup {
margin: 100px auto;
padding: 20px;
background: #fff;
border-radius: 5px;
width: 300px;
position: relative;
}
22 changes: 11 additions & 11 deletions web/assets/js/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,17 +9,17 @@ $(document).on('click', 'a.qr-link', function (e) {
var href = $(this).prop('href');

// set its location and do show
$("#qr-code").fadeIn();

// set qr-code content
$("#qr-code .content").empty().qrcode(
{
text: encodeURI(decodeURI(href)),
correctLevel: 1, // QRErrorCorrectLevel.L,
width: 300,
height: 300
}
);
$("#qr-code")
.fadeIn()
.find(".popup")
.empty()
.qrcode(
{
text: encodeURI(decodeURI(href)),
correctLevel: 1, // QRErrorCorrectLevel.L,
width: 300,
height: 300
});
});

// Hide QR code
Expand Down
15 changes: 9 additions & 6 deletions web/templates/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,20 @@
{{define "body"}}
{{with $data := .}}
{{if eq $data.CurrentFolder "/"}}
<h1>File list</h1>
<h1>
<i class="fa fa-home"></i>
File list
</h1>
{{else}}
<h1>
File list in <b>'{{$data.CurrentFolder}}'</b>
<a href="{{$data.ParentFolder}}"><i class="fa fa-arrow-circle-left"></i></a>
File list in <b>'{{$data.CurrentFolder}}'</b>
</h1>

{{end}}

{{if $data.Folders}}
<h3>Folders</h3>
<div class="wrapper">
{{range $folder := $data.Folders}}
<div class="box">
Expand All @@ -24,6 +28,7 @@ <h1>
{{end}}

{{if $data.Files}}
<h3>Files</h3>
<div class="wrapper">
{{range $file := $data.Files}}
<div class="box">
Expand All @@ -34,10 +39,8 @@ <h1>
{{end}}
</div>
{{end}}
<div id='qr-code'>
<div class='popup'>
<div class='content'></div>
</div>
<div id='qr-code' style='display: none;'>
<div class='popup'></div>
</div>
{{end}}
{{end}}

0 comments on commit 1280069

Please sign in to comment.