-
Notifications
You must be signed in to change notification settings - Fork 17
/
index.html
99 lines (81 loc) · 3.92 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
<!doctype html>
<html class="no-js" lang="">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<title>DEPreload.js jQuery Image Preloader - Demo</title>
<meta name="description" content="">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="icon" href="demo/favicon.png">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/normalize/3.0.2/normalize.min.css">
<link rel="stylesheet" href="demo/main.css">
<link href="//fonts.googleapis.com/css?family=Source+Sans+Pro:300" rel="stylesheet">
<link href="//fonts.googleapis.com/css?family=Open+Sans:600" rel="stylesheet">
</head>
<body>
<div id="depreload" style="background-image:url('demo/bgr.jpg');" class="table">
<div class="table-cell wrapper">
<div class="circle">
<canvas class="line" width="560px" height="560px"></canvas>
<img src="demo/logo.png" class="logo" alt="logo" />
</div>
<p class="perc"></p>
<p class="loading">Loading</p>
</div>
</div>
<div class="gallery">
<img src="demo/stock/image1.jpg">
<img src="demo/stock/image2.jpg">
<img src="demo/stock/image3.jpg">
<img src="demo/stock/image4.jpg">
<img src="demo/stock/image5.jpg">
<img src="demo/stock/image6.jpg">
<img src="demo/stock/image7.jpg">
</div>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<script src="jquery.DEPreLoad.js"></script>
<script>
$(document).ready(function() {
setTimeout(function(){
$("#depreload .wrapper").animate({ opacity: 1 });
}, 400);
setTimeout(function(){
$("#depreload .logo").animate({ opacity: 1 });
}, 800);
var canvas = $("#depreload .line")[0],
context = canvas.getContext("2d");
context.beginPath();
context.arc(280, 280, 260, Math.PI * 1.5, Math.PI * 1.6);
context.strokeStyle = '#fff';
context.lineWidth = 5;
context.stroke();
var loader = $("body").DEPreLoad({
OnStep: function(percent) {
console.log(percent + '%');
$("#depreload .line").animate({ opacity: 1 });
$("#depreload .perc").text(percent + "%");
if (percent > 5) {
context.clearRect(0, 0, canvas.width, canvas.height);
context.beginPath();
context.arc(280, 280, 260, Math.PI * 1.5, Math.PI * (1.5 + percent / 50), false);
context.stroke();
}
},
OnComplete: function() {
console.log('Everything loaded!');
$("#depreload .perc").text("done");
$("#depreload .loading").animate({ opacity: 0 });
}
});
});
</script>
<script>
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
})(window,document,'script','https://www.google-analytics.com/analytics.js','ga');
ga('create', 'UA-56029753-5', 'auto');
ga('send', 'pageview');
</script>
</body>
</html>