-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
101 lines (83 loc) · 2.81 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
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>Pier</title>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.2.1/jquery.min.js"></script>
<style>
#container {
position: relative;
max-width: 100px;
max-height: 100px;
border: 1px solid black;
display: none
}
#spotify {
position: relative;
}
#img {
cursor: pointer;
/*max-width: 100%;
max-height: 100%;*/
height: -webkit-fill-available;
}
#container2 {
background-repeat: no-repeat;
background-size: contain;
position: relative;
max-width: 70%;
max-height: 70%;
width: 70%;
height: 70%;
border: 1px solid black;
top: 15%;
margin: auto;
}
body {
margin: 0px;
}
</style>
<script>
var img = ['1.png', '2.png', '1.jpg', '3.png'];
$(document).ready(function() {
var num = 0;
$('#img').on('click', function() {
$(this).attr('src', img[num])
num++;
if (num == 4) num = 0;
});
var num2 = 0;
$('#container2').on('click', function() {
$(this).css('background-image', 'url(' + img[num2] + ')');
num2++;
if (num2 == 4) num2 = 0;
});
//------------------------------------------------RESIZE
var windowWidth = $(window).innerWidth();
var windowHeight = $(window).innerHeight();
$('body').css('width', windowWidth);
$('body').css('height', windowHeight);
$(window).on('resize', function() {
console.log('RESIZE WINDOW');
var OldwindowWidth = windowWidth;
var OldwindowHeight = windowHeight;
windowWidth = $(window).innerWidth();
windowHeight = $(window).innerHeight();
console.log('width:', windowWidth, 'height', windowHeight);
console.log('OLDwidth:', OldwindowWidth, 'OLDheight', OldwindowHeight);
$('body').css('width', windowWidth);
$('body').css('height', windowHeight);
});
});
</script>
</head>
<body>
<iframe src="https://open.spotify.com/embed/user/21pizt3vxnh7w5hylsktuaawi/playlist/0tWi3asASL07tAM57JP6jc" width="300" height="80" frameborder="0" allowtransparency="true" id="spotify"></iframe>
<div id="container">
<img src="1.jpg" id="img">
</div>
<div id="container2" style="background-image: url(1.jpg);">
</div>
<div id="list"></div>
</body>
</html>