-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.js
25 lines (19 loc) · 1.07 KB
/
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
import MockData from './mockData.js'
import {appendMenuData, appendContentsData} from './MockDataAppender.js';
import SlideService from './SlideService.js';
import DirectionButtonManager from './DirectionButtonManager.js';
import MenuButtonManager from './MenuButtonManager.js';
window.addEventListener('DOMContentLoaded', () => {
appendMenuData(MockData.mockData_Menu);
appendContentsData(MockData.mockData_Contents);
const topElements = document.querySelector("#top");
const bottomElements = document.querySelector("#bottom");
const contentArea = document.querySelector("#content");
const slideService = new SlideService(contentArea);
const menuButtons = topElements.querySelectorAll('button');
const directionButtons = bottomElements.querySelectorAll('button');
const menuButtonManager = new MenuButtonManager(slideService, menuButtons);
const directionButtonManager = new DirectionButtonManager(slideService, directionButtons);
slideService.registerComponent(menuButtonManager);
slideService.registerComponent(directionButtonManager);
});