-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.js
30 lines (23 loc) · 947 Bytes
/
main.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
import App from './app.js';
document.addEventListener('DOMContentLoaded', () => {
function close_div (e) {
// close the menu div
const _body = document.getElementById('menu');
// hide the menu
_body.style.width = "0px";
}
function open_div (e) {
// close the menu div
const _body = document.getElementById('menu');
// hide the menu
_body.style.width = "300px";
}
// needs to wait for js to be loaded and then run this to create the conway game board
const app = new App();
// attach listener to open the sidebar that has all the info
const open_btn = document.getElementById('open-btn');
open_btn.addEventListener('click', open_div);
// attach a listener on the close-btn for sidebar to close the sidebar
const close_btn = document.getElementById('close-btn');
close_btn.addEventListener('click', close_div);
});