-
Notifications
You must be signed in to change notification settings - Fork 4
/
demo.html
256 lines (234 loc) · 10.1 KB
/
demo.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
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
<!DOCTYPE html>
<html>
<head>
<title>cndk.beforeafter.js</title>
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<!-- for demo page only -->
<link href="https://stackpath.bootstrapcdn.com/bootstrap/4.4.1/css/bootstrap.min.css" rel="stylesheet">
<script src="https://code.jquery.com/jquery-3.4.1.min.js"></script>
<script src="https://stackpath.bootstrapcdn.com/bootstrap/4.4.1/js/bootstrap.min.js"></script>
<!-- cndk.beforeafter.js -->
<link href="cndk.beforeafter.css" rel="stylesheet">
<script src="cndk.beforeafter.js"></script>
<script>
$(document).ready(function () {
$(".beforeafterdefault").cndkbeforeafter();
$(".beforeafterdrag").cndkbeforeafter(
{
mode: "drag",
beforeTextPosition: "top-left"
}
);
$(".beforeafterhidetext").cndkbeforeafter(
{
showText: false
}
);
$(".beforeafterimageseperator").cndkbeforeafter(
{
seperatorColor: "#ffffff",
seperatorWidth: "10px",
}
);
$(".beforeafterautoslide").cndkbeforeafter(
{
autoSliding: true
}
);
$(".beforeafterthemedark").cndkbeforeafter(
{
mode: "drag",
theme: "dark"
}
);
});
</script>
</head>
<body>
<header>
<div class="navbar navbar-dark bg-dark shadow-sm">
<div class="container d-flex justify-content-between">
<a href="#" class="navbar-brand d-flex align-items-center">
<svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" aria-hidden="true" class="mr-2" viewBox="0 0 24 24" focusable="false"><path d="M23 19a2 2 0 0 1-2 2H3a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h4l2-3h6l2 3h4a2 2 0 0 1 2 2z"/><circle cx="12" cy="13" r="4"/></svg>
<strong>cndk.beforeafter.js</strong>
</a>
</div>
</div>
</header>
<main role="main">
<section class="jumbotron text-center">
<div class="container">
<h1>cndk.beforeafter.js</h1>
<p class="lead text-muted">
Before-After Plugin for jQuery
</p>
<p>
<a href="https://github.com/ilkerccom/cndkbeforeafter" class="btn btn-primary my-2">Explore on GitHub</a>
</p>
</div>
</section>
<div class="album py-5 bg-light">
<div class="container">
<div class="row" style="margin-top: 50px;">
<div class="col-md-12">
<h1 class="display-4">Default Settings</h1>
<p>Default settings</p>
<code >
mode: "hover", <b>[hover,drag]</b><br>
showText: true,<br>
beforeText: "BEFORE",<br>
beforeTextPosition: "bottom-left" <b>[top-left,top-right,bottom-left,bottom-right]</b><br>
afterText: "AFTER",<br>
afterTextPosition: "bottom-right" <b>[top-left,top-right,bottom-left,bottom-right]</b><br>
seperatorWidth: "4px",<br>
seperatorOpacity: "0.8",<br>
theme: "dark" <b>[dark,light]</b><br>
autoSliding: false,<br>
autoSlidingStopOnHover: true,<br>
hoverEffect: true,<br>
enterAnimation: false
</code>
</div>
</div>
<div class="row" style="margin-top: 50px;">
<div class="col-md-12">
<h1 class="display-4">Default</h1>
<p>With default settings.</p>
<code >
$(".beforeafterdefault").cndkbeforeafter();
</code>
<div class="card" style="margin-top: 50px;">
<div class="beforeafterdefault">
<div data-type="data-type-image">
<div data-type="before"><img src="images/a1.jpg"></div>
<div data-type="after"><img src="images/a2.jpg"></div>
</div>
</div>
</div>
</div>
</div>
<div class="row" style="margin-top: 50px;">
<div class="col-md-12">
<h1 class="display-4">Mode : drag</h1>
<p>With default settings.</p>
<code >
$(".beforeafterdrag").cndkbeforeafter(
{
mode: "drag", beforeTextPosition: "top-left"
}
);
</code>
<div class="card" style="margin-top: 50px;">
<div class="beforeafterdrag">
<div data-type="data-type-image">
<div data-type="before"><img src="images/a1.jpg"></div>
<div data-type="after"><img src="images/a2.jpg"></div>
</div>
</div>
</div>
</div>
</div>
<div class="row" style="margin-top: 50px;">
<div class="col-md-12">
<h1 class="display-4">Theme : dark</h1>
<p>With default settings.</p>
<code >
$(".beforeafterdrag").cndkbeforeafter(
{
theme: "dark"
}
);
</code>
<div class="card" style="margin-top: 50px;">
<div class="beforeafterthemedark">
<div data-type="data-type-image">
<div data-type="before"><img src="images/a1.jpg"></div>
<div data-type="after"><img src="images/a2.jpg"></div>
</div>
</div>
</div>
</div>
</div>
<div class="row" style="margin-top: 50px;">
<div class="col-md-12">
<h1 class="display-4">Seperator Style</h1>
<p>With default settings.</p>
<code >
$(".beforeafterdrag").cndkbeforeafter( { seperatorWidth: "15px"} );
</code>
<div class="card" style="margin-top: 50px;">
<div class="beforeafterimageseperator">
<div data-type="data-type-image">
<div data-type="before"><img src="images/a1.jpg"></div>
<div data-type="after"><img src="images/a2.jpg"></div>
</div>
</div>
</div>
</div>
</div>
<div class="row" style="margin-top: 50px;">
<div class="col-md-12">
<h1 class="display-4">Hide Text</h1>
<p>With default settings.</p>
<code>
$(".beforeafterdrag").cndkbeforeafter( { showText: false } );
</code>
<div class="card" style="margin-top: 50px;">
<div class="beforeafterhidetext">
<div data-type="data-type-image">
<div data-type="before"><img src="images/a1.jpg"></div>
<div data-type="after"><img src="images/a2.jpg"></div>
</div>
</div>
</div>
</div>
</div>
<div class="row" style="margin-top: 50px;">
<div class="col-md-12">
<h1 class="display-4">Animate Sliding</h1>
<p>With default settings.</p>
<code>
$(".beforeafterdrag").cndkbeforeafter( { autoSliding: true } );
</code>
<div class="card" style="margin-top: 50px;">
<div class="beforeafterautoslide">
<div data-type="data-type-image">
<div data-type="before"><img src="images/a1.jpg"></div>
<div data-type="after"><img src="images/a2.jpg"></div>
</div>
</div>
</div>
</div>
</div>
<div class="row" style="margin-top: 50px;">
<div class="col-md-12">
<h1 class="display-4">Attributes</h1>
<p>With default settings.</p>
<code >
data-title="Green Screen"<br>
data-title="At Movie"
</code>
<div class="card" style="margin-top: 50px;">
<div class="beforeafterdefault">
<div data-type="data-type-image">
<div data-type="before" data-title="Green Screen"><img src="images/b1.jpg"></div>
<div data-type="after" data-title="At Movie"><img src="images/b2.jpg"></div>
</div>
</div>
<small style="padding: 10px;">Screenshot from https://www.youtube.com/watch?v=1-Vstem0SMg</small>
</div>
</div>
</div>
</div>
</div>
</main>
<footer class="text-muted">
<div class="container">
<p class="float-right">
<a href="#">Back to top</a>
</p>
<p>by Ilker Cindik</p>
</div>
</footer>
</body>
</html>