forked from dkaraush/Dropbox-Player-for-Alexa
-
Notifications
You must be signed in to change notification settings - Fork 0
/
redirect_page.html
164 lines (162 loc) · 4 KB
/
redirect_page.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
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<link href="https://fonts.googleapis.com/css?family=Roboto:300,400,700" rel="stylesheet">
<title>Dropbox Music Player</title>
<meta name="viewport" content="width=device-width, initial-scale=1">
<style type="text/css">
html, head, body {
background: #F5F5F5;
margin: 0;
padding: 0;
}
#main {
background: white;
box-shadow: 0 2px 4px rgba(0,0,0,0.2);
border-radius: 2px;
padding: 1em;
padding-top: 11em;
display: block;
width: 95%;
box-sizing: border-box;
max-width: 800px;
color: black;
font-family: 'Roboto';
margin: 1em auto;
position: relative;
overflow: hidden;
}
#header {
position: absolute;
top: 0;
right: 0;
left: 0;
height: 10em;
background-image: url(../assets/redirect_bg.jpg);
background-size: cover;
background-position: center;
color: white;
}
#header div {
position: absolute;
top: 0;
left: 0;
right: 0;
bottom: 0;
background-color: rgba(0,0,0,0.4);
}
#header h1 {
position: absolute;
left: 0.5em;
bottom: 0.5em;
right: 0.5em;
vertical-align: bottom;
line-height: 100%;
font-weight: 300;
}
h1, p {
margin: 0;
}
p {
margin-bottom: 0.1em;
font-weight: normal;
}
.button {
font-size: 1em;
padding: 0.5em 1em;
background: #03A9F4;
display: inline-block;
border-radius: 2px;
color: white;
box-shadow: 0 2px 4px rgba(0,0,0,0.1);
cursor: pointer;
text-decoration: none;
transition: all 0.2s ease-in-out;
overflow: hidden;
position: relative;
}
.eff {
background: rgba(255,255,255,0.4);
}
.button:hover {
background: #039BE5;
}
ul, li {
margin: 0.5em 0;
}
</style>
</head>
<body>
<div id="main">
<div id="header">
<div></div>
<h1>Dropbox linking</h1>
</div>
<p>You will be redirected to Dropbox authentication form to link your account.</p>
<br>
<div href="{URL}" class="button">SIGN IN</div>
</div>
<script type="text/javascript">
document.querySelectorAll("*[href]").forEach(function (div) {
div.addEventListener("click", function () {
setTimeout(function () {
var href = null;
for (var i = 0; i < div.attributes.length; ++i)
if (div.attributes[i].name == "href")
href = div.attributes[i].nodeValue;
window.open(href, "_self");
}, 500);
})
})
</script>
<!-- ripple button effect -->
<script type="text/javascript">
function init(div) {
div.style.userSelect="none";
div.style.webkitUserSelect="none";
div.style.mozUserSelect="none";
div.style.msUserSelect="none";
div.addEventListener("mousedown", function (e) {
if (e.button != 0) return;
var x=e.layerX, y=e.layerY, w=div.clientWidth, h=div.clientHeight;
var D1 = Math.sqrt(x*x + y*y);
var D2 = Math.sqrt((w-x)*(w-x) + y*y);
var D3 = Math.sqrt((w-x)*(w-x) + (h-y)*(h-y));
var D4 = Math.sqrt(x*x + (h-y)*(h-y));
var mD = Math.max(D1, D2, D3, D4);
var clickEff = document.createElement("div");
clickEff.style.position = "absolute";
clickEff.style.opacity = 1;
clickEff.className = "eff";
clickEff.style.borderRadius = "50%";
clickEff.style.transition = "all .5s ease-in-out";
clickEff.style.top = e.layerY+"px";
clickEff.style.left = e.layerX+"px";
clickEff.style.width = "0px";
clickEff.style.height = "0px";
clickEff.style.padding = "0px";
clickEff.style.margin = "0px";
clickEff.style.zIndex = 5;
div.appendChild(clickEff);
setTimeout(function () {
clickEff.style.width=clickEff.style.height=mD*2+"px";
clickEff.style.left=e.layerX-(mD)+"px";
clickEff.style.top=e.layerY-(mD)+"px";
}, 5);
});
function mouseup(e) {
div.querySelectorAll(".eff").forEach(function (clickEff) {
clickEff.style.opacity = 0;
setTimeout(function () {
clickEff.remove();
},500);
});
}
div.addEventListener("mouseup", mouseup);
div.addEventListener("mouseover", mouseup);
}
init(document.querySelector(".button"));
</script>
</body>
</html>