forked from daun/dropshare
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathindex.html
executable file
·224 lines (179 loc) · 5.78 KB
/
index.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
<!--
Welcome to your very own Dropshare HTML landing page template.
Feel free to edit this file to suit your needs, BUT..
*** IMPORTANT ***
do not forget to include all required variables to display the landing page properly.
Variable | Description
##########################################################
__FILENAME__ | Name of the file shared
__PATH__ | Path to the file shared
__PREVIEW__ | Automatically generated by Dropshare if file is an image, or video, or text
__FILESIZE__ | Formatted file size of the file shared
__FILETYPE__ | Apple Uniform Type Identifier (https://developer.apple.com/library/ios/documentation/Miscellaneous/Reference/UTIRef/Articles/System-DeclaredUniformTypeIdentifiers.html)
__SHAREDATE__ | ISO formatted date of sharing
__PREVIEWURL__ | Absolute URL to preview file, required e.g. for Twitter cards or Slack previews (or custom preview implementations)
__LANDINGPAGEURL__ | Absolute URL to the landing page
Any questions? Head over to http://getdropsha.re/support and ask for help!
-->
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta name="generator" content="Dropshare http://getdropsha.re" />
<meta property="twitter:card" content="photo" />
<meta property="twitter:image" content="__PREVIEWURL__" [^] />
<meta property="twitter:title" content="__FILENAME__" />
<meta property="og:title" content="__FILENAME__" />
<meta property="og:type" content="website" />
<meta property="og:image" content="__PREVIEWURL__" />
<title>__FILENAME__</title>
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/font-awesome/4.5.0/css/font-awesome.min.css">
<style type="text/css">
* {
-webkit-box-sizing: border-box;
box-sizing: border-box;
}
@media (min-width: 980px) {
html { font-size: 17px; }
}
@media (min-width: 1560px) {
html { font-size: 19px; }
}
html, body {
margin: 0;
padding: 0;
}
body {
font-family: -apple-system, system-ui, BlinkMacSystemFont, 'SF Pro Display', 'SF Pro Icons', 'Helvetica Neue', Helvetica, Arial, sans-serif;
font-size: 1rem;
letter-spacing: .008em;
text-align: center;
background-color: rgb(247, 247, 247);
}
img,
object,
iframe {
width: 100%;
height: 100%;
}
iframe {
height: 60vh;
max-width: 1000px;
background: white;
border: none;
border-radius: 3px;
}
iframe[src$='.txt'] {
padding: 2rem;
}
img,
video {
max-width: 80vw;
max-height: 60vh;
height: auto;
width: auto;
margin: 0 auto;
border-radius: 3px;
}
.fa {
font-size: 100px;
}
a {
text-decoration: none;
color: #000;
}
.file-preview {
text-align: center;
z-index: 99;
}
.file-preview img {
-webkit-transition: transform 10s, box-shadow 10s;
transition: transform 10s, box-shadow 10s;
}
.file-preview img:hover {
-webkit-transform: scale(1.5);
transform: scale(1.5);
-webkit-box-shadow: 0 0 25px 3px rgba(0,0,0,0.15);
box-shadow: 0 0 25px 3px rgba(0,0,0,0.15);
}
.file-name {
font-size: 2.2rem;
font-weight: normal;
}
.file-download {
white-space: nowrap;
font-size: 0.9rem;
}
.file-download a {
display: inline-block;
margin-bottom: .4em;
border-radius: 3px;
background: white;
padding: .6rem;
text-transform: uppercase;
-webkit-transition: all 0.75s;
transition: all 0.75s;
color: rgb(50,50,50);
-webkit-transform: translate3d(0,0,0);
transform: translate3d(0,0,0);
}
.file-download a:hover {
-webkit-box-shadow: 3px 3px 5px 0 rgba(0,0,0,0.025), 0 0 15px 3px rgba(0,0,0,0.05);
box-shadow: 3px 3px 5px 0 rgba(0,0,0,0.025), 0 0 15px 3px rgba(0,0,0,0.05);
-webkit-transform: translate3d(0,0,0) scale(1.03);
transform: translate3d(0,0,0) scale(1.03);
}
.file-size {
color: #bbbbbb;
padding-left: .5em
}
.container {
display: -webkit-box;
display: -ms-flexbox;
display: flex;
-webkit-box-orient: vertical;
-webkit-box-direction: normal;
-ms-flex-direction: column;
flex-direction: column;
-webkit-box-pack: center;
-ms-flex-pack: center;
justify-content: center;
height: 100vh;
padding: 30px;
}
.file-preview {
-ms-flex-negative: 2;
flex-shrink: 2;
}
</style>
</head>
<body>
<div class="container">
<div class="file-preview" id="preview">__PREVIEW__</div>
<h1 class="file-name">
<a href="__PATH__">__FILENAME__</a>
</h1>
<div class="file-download">
<a href="__PATH__">Download <span class="file-size">__FILESIZE__</span></a>
</div>
</div>
<script>
// These Media Types will not be replaced by the generic icon
var preview = document.getElementById('preview'),
fileType = '__FILETYPE__',
previewTypes = ['com.compuserve.gif', 'public.plain-text', 'public.png', 'public.jpeg', 'public.svg-image'],
videoTypes = ['public.movie', 'public.video', 'com.apple.quicktime-movie', 'public.mpeg-4'],
hasPreview = previewTypes.indexOf(fileType) >= 0 || videoTypes.indexOf(fileType) >= 0,
isVideoFile = videoTypes.indexOf(fileType) >= 0;
if (isVideoFile) {
preview.innerHTML = '<video controls src="__PREVIEWURL__"></video>';
}
else if (!hasPreview) {
preview.className += ' fa fa-file-o';
preview.innerHTML = '';
}
</script>
</body>
</html>