-
Notifications
You must be signed in to change notification settings - Fork 121
/
index.html
148 lines (129 loc) · 3.8 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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" />
<meta name="designer" content="imgix" />
<meta name="developer" content="imgix" />
<meta name="viewport" content="width=device-width,initial-scale=1,maximum-scale=1,maximum-scale=1" />
<meta http-equiv="Accept-CH" content="DPR, Width, Viewport-Width" />
<!-- If CSP style policies, ensure SHA, nonce, or unsafe-inline are enabled -->
<meta
http-equiv="Content-Security-Policy"
content="style-src 'self' 'sha256-OdI56ZW769BKGaLghLr3uZVaaWfqyRwyccMiu8gXf0w=' 'sha256-D2blx2qCCtVP48luzhEjUKKIcmHy77Ma+9/c6fv8UGM=' 'sha256-W+PadZMOYbQi3EzR/NC+KcPx3bNLCz0OtfWwp+LK9b4='"
/>
<title>Drift Playground</title>
<link rel="stylesheet" media="screen, projection" href="./dist/drift-basic.css" />
<style type="text/css">
body {
font-family: Helvetica Neue, Arial, sans;
margin-top: 2em;
background: #fafafa;
}
.wrapper {
margin: 0 auto;
width: 860px;
}
.drift-demo-trigger {
width: 40%;
float: left;
}
.detail {
position: relative;
width: 55%;
margin-left: 5%;
float: left;
}
h1 {
color: #013c4a;
margin-top: 1em;
margin-bottom: 1em;
}
p {
max-width: 32em;
margin-bottom: 1em;
color: #23637f;
line-height: 1.6em;
}
p:last-of-type {
margin-bottom: 2em;
}
a {
color: #00c0fa;
}
.ix-link {
display: block;
margin-bottom: 3em;
}
@media (max-width: 900px) {
.wrapper {
text-align: center;
width: auto;
}
.detail,
.drift-demo-trigger {
float: none;
}
.drift-demo-trigger {
max-width: 100%;
width: auto;
margin: 0 auto;
}
.detail {
margin: 0;
width: auto;
}
p {
margin: 0 auto 1em;
}
.responsive-hint {
display: none;
}
.drift-bounding-box {
display: none;
}
}
</style>
</head>
<body>
<div class="wrapper">
<img
class="drift-demo-trigger"
data-zoom="http://assets.imgix.net/unsplash/lighthouse.jpg?w=1200&ch=DPR&dpr=2"
src="http://assets.imgix.net/unsplash/lighthouse.jpg?w=400&ch=DPR&dpr=2"
/>
<div class="detail">
<section>
<h1>Drift Demo</h1>
<p>
This is a demo of Drift, a simple, lightweight, no-dependencies JavaScript "zoom on hover" tool from
<a href="http://imgix.com">imgix</a>. Move your mouse over the image (or touch it) to see it in action.
</p>
<p>
This demo uses the simple included theme, but it's very easy to extend and customize to fit your needs. You
can <a href="https://github.com/imgix/drift">learn more and download it here</a>.
</p>
<p class="responsive-hint">(Psst… try making your browser window smaller!)</p>
</section>
<a href="https://imgix.com" class="ix-link">
<img
src="https://assets.imgix.net/presskit/imgix-presskit.pdf?page=3&fm=png&w=320&dpr=2"
width="160"
height="60"
alt="imgix"
/>
</a>
</div>
</div>
<script src="dist/Drift.js"></script>
<script>
new Drift(document.querySelector(".drift-demo-trigger"), {
paneContainer: document.querySelector(".detail"),
inlinePane: 900,
inlineOffsetY: -85,
containInline: true,
hoverBoundingBox: true,
});
</script>
</body>
</html>