-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtemplate_lazyphoto.html
137 lines (134 loc) · 4.12 KB
/
template_lazyphoto.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
<!DOCTYPE html>
<!-- PICtoJS path-->
<html lang='zh-CN'>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta http-equiv="Content-Language" content="zh-CN" />
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width,height=device-height, initial-scale=1,maximum-scale=4" />
<script src="jquery.js" type="text/javascript"></script>
<title>lazyphoto</title>
<style>
body{{background:#000;padding:0;margin:0;width: 100%;height: 100%;}}
body:fullscreen{{background:#000;padding:0;margin:0;width: 100%;height: 100%;}}
body:-webkit-full-screen{{background:#000;padding:0;margin:0;width: 100%;height: 100%;}}
img{{width:100%;height:auto;}}
#panel{{position:relative;}}
#control{{display:block;position:fixed;top:0;left:0;/*background-color:#000;opacity:0.4*/}}
#info{{color:#000;text-shadow:0px 0px 2px #EEE;position:fixed;top:0;left:0;z-index:10;width:100%}}
</style>
</head>
<body>
<div class="wraper">
<div id="panel"><div id="info"></div><a id="control"></a></div>
<div id="canvas"></div>
</div>
</body>
<script type="text/javascript">
nowAt=0;
if(window.location.hash.match(/^#\d+$/)){{
nowAt=parseInt(window.location.hash.replace('#',''));
}}
function launchFullscreen(element) {{
if(element.requestFullscreen) {{
element.requestFullscreen();
}} else if(element.mozRequestFullScreen) {{
element.mozRequestFullScreen();
}} else if(element.msRequestFullscreen){{
element.msRequestFullscreen();
}} else if(element.webkitRequestFullscreen) {{
element.webkitRequestFullScreen();
}}
}}
document.body.onload=function(){{launchFullscreen(document.documentElement);}};
(function(){{
var allpic={PICtoJS};
var folder="{path}";
var canvas=document.getElementById('canvas');
var temp_element=new Image();
canvas.appendChild(temp_element);
var control=document.getElementById('control');
var info=document.getElementById('info');
control.style.width=screen.width+"px";
control.style.height=screen.height+"px";
var go=function(n){{
if(n>=allpic.length){{
n=0;
}}else if(n<0){{
n=allpic.length-1;
}}
var temp_element_=new Image();
temp_element_.src=allpic[n];
var temp_preload=new Image();
var temp_preload1=new Image();
var temp_preload2=new Image();
var temp_preload3=new Image();
temp_preload.src=allpic[n+1];
temp_preload3.src=allpic[n-1];
temp_preload1.src=allpic[n-10];
temp_preload2.src=allpic[n+10];
var loading=setTimeout(function(){{info.innerHTML=" Loading..."}},100);
temp_element_.onload=function(){{
clearTimeout(loading);
scroll(0,0);
temp_element.src=allpic[n];
var dat=new Date();
info.innerHTML=" <a href='?'><</a> <a onclick='launchFullscreen(document.documentElement);' style='float:right;'> "+dat.getHours()+":"+dat.getMinutes()+" [Full screen] </a> "+folder.substr(0,30)+" "+(nowAt+1)+"/"+allpic.length+" <a onclick='window.location.reload(true);'>[Refresh]</a>";
}}
nowAt=n;
window.location="#"+n;
}}
go(nowAt);
var goNext=function(){{
go(nowAt+=1);
}}
var goPrev=function(){{
go(nowAt-=1);
}}
var goNext10=function(){{
//alert(nowAt+10+","+allpic.length);
if(nowAt+10<allpic.length){{
go(nowAt+=10);
}}
}}
var goPrev10=function(){{
if(nowAt-10>=0){{
go(nowAt-=10);
}}
}}
var TimeFn = null;
var Time=0;
var aclick=function(event){{
var a=new Date();
/*clearTimeout(TimeFn);
if(a.getTime()-Time<400){{//dblclick
var e = event || window.event;
if(e.screenX<0.5*screen.width){{
goPrev10();
}}else{{
goNext10();
}}
}}else{{
TimeFn = setTimeout(function(){{*/
var e = event || window.event;
if(e.screenX<0.5*screen.width){{
if(e.screenY<0.2*screen.height){{
goPrev10();
}}else{{
goPrev();
}}
}}else{{
if(e.screenY<0.2*screen.height){{
goNext10();
}}else{{
goNext();
}}
}}/*
}},400);
}}*/
Time=a.getTime();
}}
control.onmousedown=aclick;
}})()
</script>
</html>