-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathapp.js
More file actions
45 lines (29 loc) · 1.75 KB
/
Copy pathapp.js
File metadata and controls
45 lines (29 loc) · 1.75 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
let bigWindow = document.getElementById('bigWindow')
let bigResizeButton = document.getElementById('bigResizeButton')
let bigCloseButton = document.getElementById('bigCloseButton')
let mediumWindow = document.getElementById('mediumWindow')
let mediumResizeButton = document.getElementById('mediumResizeButton')
let mediumCloseButton = document.getElementById('mediumCloseButton')
let smallWindow = document.getElementById('smallWindow')
let smallResizeButton = document.getElementById('smallResizeButton')
let smallCloseButton = document.getElementById('smallCloseButton')
function closeBigWindow() {bigWindow.style.display = 'none'}
function closeMediumWindow() {mediumWindow.style.display = 'none'}
function closeSmallWindow() {smallWindow.style.display = 'none'}
bigCloseButton.addEventListener("click", closeBigWindow)
mediumCloseButton.addEventListener("click", closeMediumWindow)
smallCloseButton.addEventListener("click", closeSmallWindow)
allWindows = document.querySelectorAll('.window')
// RESIZING
const maxWindowSize = 'left:2vh;bottom:2vh; width: 97vw; height: 75vh; transition: 300ms ease-in-out, color 300ms ease-in-out;'
function resizeSmallWindow () {smallWindow.style = maxWindowSize}
function resizeMediumWindow () {mediumWindow.style = maxWindowSize}
function resizeBigWindow () {bigWindow.style = maxWindowSize}
bigResizeButton.addEventListener("click", resizeBigWindow)
mediumResizeButton.addEventListener("click", resizeMediumWindow)
smallResizeButton.addEventListener("click", resizeSmallWindow)
// BOUCLE QUI DONNE UNE BORDURE ROUGE A TOUTES LES FENETRES
// for (var i = 0; i < allWindows.length; i++) {
// var currentWindow = allWindows[i];
// currentWindow.style.border = 'red 10px solid';
// }