Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improved download page #41

Open
wants to merge 7 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
43 changes: 38 additions & 5 deletions index.html
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<!doctype html>
<!doctype html>
<html lang="en-us">
<head>
<meta charset="utf-8">
Expand Down Expand Up @@ -141,7 +141,7 @@
}


audio.preview, video.preview, .downloadexplain, #downloadprogress, #previewimg {
audio.preview, video.preview, .downloadarea, #downloadprogress, #previewimg {
position: relative;
top: 50%;
text-align: center;
Expand All @@ -150,9 +150,13 @@
margin: 0 auto;
}

.downloadexplain {
.downloadarea {
color: #fff;
font-size: 30px;
}

.linebrBefore:before {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What's the purpose of this class? Could this be solved using padding or margin instead?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It should have been solved that way. I have corrected it to use margin instead now.

content:"\a\a";
white-space: pre;
}

body {
Expand Down Expand Up @@ -305,6 +309,26 @@
margin-left: 5px;
}

.bigbtn {
text-decoration: none;
display: inline-block;
margin: 0;
-webkit-box-align: start;
font: inherit;
-webkit-transition: background-color 400ms ease-out;
-moz-transition: background-color 400ms ease-out;
-o-transition: background-color 400ms ease-out;
-ms-transition: background-color 400ms ease-out;
transition: background-color 400ms ease-out;
background-color: #1d1f21;
color: white;
height: 200px;
width: 200px;
font-size: 32px;
border: 2px solid white;
font-weight: bold;
cursor: pointer;
}

#downloadprogress {
color: white;
Expand All @@ -316,6 +340,15 @@
transition: all 100ms ease-in;
}

.bigbtn:hover {
-webkit-transition: background-color 200ms ease-in;
-moz-transition: background-color 200ms ease-in;
-o-transition: background-color 200ms ease-in;
-ms-transition: background-color 200ms ease-in;
transition: background-color 200ms ease-in;
background-color: #313538;
}

#linenos, #create_linenos {
color: #7d7d7d;
position: absolute;
Expand Down Expand Up @@ -378,4 +411,4 @@ <h2>
<a href="#" id="contact" target="_blank">Contact</a>
</div>
</body>
</html>
</html>
6 changes: 5 additions & 1 deletion static/js/download.js
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,11 @@ upload.modules.addmodule({
} else if (association == 'audio') {
$('<audio>').addClass('preview').prop('controls', true).prop('autoplay', true).appendTo(this._.detailsarea).prop('src', url)
} else {
$('<div>').addClass('preview').addClass('downloadexplain').text("Click the Download link in the bottom-left to download this file.").appendTo(this._.detailsarea)
var dlarea = $('<div>').addClass('preview').addClass('downloadarea').appendTo(this._.detailsarea)
$('<h1>').text(data.header.name).appendTo(dlarea)
$('<p>').text('No preview available').appendTo(dlarea)
var bigdlbtn = $('<a>').addClass('bigbtn').prop('href', url).appendTo(dlarea)
$('<a>').addClass('linebrBefore').text('Download').appendTo(bigdlbtn)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this adding an <a> tag inside another <a> tag?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It was adding an <a> tag inside an <a> tag. My mistake sorry - i have corrected it now.

}
this._.filename.show()
this._.btns.show()
Expand Down