-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.html
More file actions
115 lines (111 loc) · 2.64 KB
/
index.html
File metadata and controls
115 lines (111 loc) · 2.64 KB
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
<html>
<head>
<title>Emo Sipos</title>
<meta name="description" content="contemporary artist portfolio">
<meta http-equiv="content-type" content="text/html;charset=UTF-8">
<style>
body {
padding: 0px;
margin: 0px;
min-height: 100%;
min-width: 100%;
background-position: center center;
background-repeat: no-repeat;
background-size: contain;
background-color: black;
height: 100%;
width: 100%;
min-height: 100%;
min-width: 100%;
}
.behance {
position: fixed;
bottom: 0;
width: 100%;
height: 36px;
display: flex;
display: -webkit-box;
display: -moz-box;
display: -ms-flexbox;
display: -webkit-flex;
align-content: center;
-webkit-align-content: center;
justify-content: flex-end;
-webkit-justify-content: flex-end;
align-items: center;
-webkit-align-items: center;
margin: 0;
padding: 0;
background-color: rgba(95, 95, 95, 0.60);
}
.behance span {
color: white;
font-size: 20px;
font-family: Arial, sans-serif;
font-style: normal;
font-weight: 400;
margin-bottom: -1px;
}
.behance img {
color: white;
height: 18px;
margin-left: 5px;
margin-right: 6px;
}
</style>
<script type="text/javascript">
var urlPattern = "img/enclosed-in-time-{INDEX}.jpg";
var max = 4;
var min = 0;
var idx;
var nextIdx = function() {
if (idx === max) {
return min;
} else {
return idx + 1;
}
}
var prevIdx = function() {
if (idx === min) {
return max;
} else {
return idx - 1;
}
}
var setUrl = function(currIdx) {
idx = currIdx;
var url = urlPattern.replace("{INDEX}", currIdx);
document.body.style.backgroundImage = "url(" + url + ")";
}
var go = function (fwd) {
var currIdx = null;
if (fwd) {
currIdx = nextIdx();
} else {
currIdx = prevIdx();
}
setUrl(currIdx);
}
var checkKey = function (e) {
e = e || window.event;
if (e.keyCode == '37') {
go(false)
}
else if (e.keyCode == '39') {
go(true)
}
}
document.onkeydown = checkKey;
</script>
</head>
</head>
<body>
<div class="behance" onclick="window.open('https://www.behance.net/ement', '_blank')">
<span>Emő Sipos on</span>
<img src="img/behance-logo-white.png" />
</div>
</body>
<script type="text/javascript">
setUrl(Math.floor(Math.random() * (max - min + 1)) + min);
</script>
</html>