-
Notifications
You must be signed in to change notification settings - Fork 0
/
index2.html
126 lines (114 loc) · 2.68 KB
/
index2.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
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>Untitled Document</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: absolute;
left: 0;
top: 0;
z-index:2;
}
#nav{
position: absolute;
top: 0;
right: 0;
<-index:1;
width: 100px;
height: 100px;
background: red;
text-align:right;
}
#img{
cursor: pointer;
/*max-width: 100%;
max-height: 100%;*/
height: -webkit-fill-available;
}
#flex{
padding: 0;
position: absolute;
margin: 0;
list-style: none;
display: flex;
align-items: center;
justify-content: center;
width: 100%;
height: 100%;
z-index:1;
}
#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="nav">
<img src="nome.png">
<div id="categories">
01
</div>
</div>
<div id="container">
<img src="1.jpg" id="img">
</div>
<div id="flex"><div id="container2" style="background-image: url(1.jpg);"></div>
</div>
<div id="list"></div>
</body>
</html>