Repository navigation
Expand file tree
/
Copy pathscript.js
More file actions
111 lines (99 loc) · 2.8 KB
/
Copy pathscript.js
File metadata and controls
111 lines (99 loc) · 2.8 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
$(document).ready(start);
var count = 0;
function start(){
postInfo();
setupPanel('div.shadow.outside:nth-child(1)');
setupPanel('div.shadow.outside:nth-child(2)');
setupPanel('div.shadow.outside:nth-child(3)');
setupPanel('div.shadow.outside:nth-child(4)');
setupRotation('.outside');
setupRotation('.circle');
rotate();
footerFix();
}
function footerFix(){
$(window).resize(function() {
if ($(window).height() < 725) {
$('footer').css('display','none');
} else {
$('footer').css('display','block');
}
})
}
function postInfo() {
setTimeout(function(){
$('.bio-box').css('visibility','visible')
$('.bio-box .name').css('opacity','1');
}, 3000);
setTimeout(function(){
$('.short-bio').css('opacity','1');
$('.contact').css('opacity','1');
$('.box').css('opacity','1');
}, 5000);
}
function setupPanel(target){
$(target).on('mousedown',function() {
$(this).removeClass('shadow');
})
$(target).on('mouseup',function() {
$(this).addClass('shadow');
})
}
function setupRotation(target){
$(target).on('mousedown',function() {
$('div.rotate').addClass('turn');
})
$(target).on('mouseup',function() {
$('div.rotate').removeClass('turn');
})
}
function rotate(){
$('div.outside').on('click', function(event){
if(event.target.id == "one" && event.target.attributes[1].value == "true" || event.target.id == "three" && event.target.attributes[1].value == "true") {
$id = $('#' + event.target.id);
$id.attr('indicator','false');
count++;
return;
}
else if(event.target.id == "two" && event.target.attributes[1].value == "true" || event.target.id == "four" && event.target.attributes[1].value == "true") {
$id = $('#' + event.target.id);
$id.attr('indicator','false');
count++;
return;
}
return;
});
$('div.circle').on('click', function(event){
if(event.target.offsetParent.id == "five" && count === 4) {
$id = $('#' + event.target.offsetParent.id);
$id.attr('indicator','false');
azizLight();
reset();
return;
}
});
}
function azizLight(){
$('.container').css('display','none');
$('body').append(`<div class="aziz" style="width:100%;height:0;
padding-bottom: 46%;position:relative;"><iframe src="
https://giphy.com/embed/uIGHPjEfdc0Ni" width="100%"
height="100%" style="position:absolute;top:0;" frameBorder="0"
class="giphy-embed" allowFullScreen></iframe></div><div class="
close"><i class="fa fa-times gradient" aria-hidden="true"></i></div>`);
reset();
return;
}
function reset(){
$('i.fa.fa-times').one('click',function(){
count = 0;
$('.container').css('display','block');
$('div.aziz').remove();
$('div.close').remove();
$('#one').attr('indicator','true');
$('#two').attr('indicator','true');
$('#three').attr('indicator','true');
$('#four').attr('indicator','true');
$('#five').attr('indicator','true');
});
}