-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathscript.js
58 lines (48 loc) · 2.24 KB
/
script.js
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
window.onload = function() {
var gridContainer = document.querySelector('.container');
var logo = document.querySelector('.logo');
var topleft = document.querySelector('.topleft');
var topright = document.querySelector('.topright');
var bottomleft = document.querySelector('.bottomleft');
var bottomright = document.querySelector('.bottomright');
logo.addEventListener('mouseover', function() {
gridContainer.style.gridTemplateColumns = '1fr 2fr 1fr';
gridContainer.style.gridTemplateRows = '1fr 2fr 1fr';
});
logo.addEventListener('mouseout', function() {
gridContainer.style.gridTemplateColumns = '2fr 1fr 2fr';
gridContainer.style.gridTemplateRows = '1.5fr 1fr 1.5fr';
});
topleft.addEventListener('mouseover', function() {
gridContainer.style.gridTemplateColumns = '5fr 1fr 2fr';
gridContainer.style.gridTemplateRows = '2fr 1fr 1.5fr';
});
topleft.addEventListener('mouseout', function() {
gridContainer.style.gridTemplateColumns = '2fr 1fr 2fr';
gridContainer.style.gridTemplateRows = '1.5fr 1fr 1.5fr';
});
topright.addEventListener('mouseover', function() {
gridContainer.style.gridTemplateColumns = '2fr 1fr 5fr';
gridContainer.style.gridTemplateRows = '2fr 1fr 1.5fr';
});
topright.addEventListener('mouseout', function() {
gridContainer.style.gridTemplateColumns = '2fr 1fr 2fr';
gridContainer.style.gridTemplateRows = '1.5fr 1fr 1.5fr';
});
bottomleft.addEventListener('mouseover', function() {
gridContainer.style.gridTemplateColumns = '5fr 1fr 2fr';
gridContainer.style.gridTemplateRows = '1.5fr 1fr 2fr';
});
bottomleft.addEventListener('mouseout', function() {
gridContainer.style.gridTemplateColumns = '2fr 1fr 2fr';
gridContainer.style.gridTemplateRows = '1.5fr 1fr 1.5fr';
});
bottomright.addEventListener('mouseover', function() {
gridContainer.style.gridTemplateColumns = '2fr 1fr 5fr';
gridContainer.style.gridTemplateRows = '1.5fr 1fr 2fr';
});
bottomright.addEventListener('mouseout', function() {
gridContainer.style.gridTemplateColumns = '2fr 1fr 2fr';
gridContainer.style.gridTemplateRows = '1.5fr 1fr 1.5fr';
});
};