forked from ClaraDevelope/gamesHub
-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.js
33 lines (33 loc) · 1.15 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
26
27
28
29
30
31
32
33
import { createHeader } from './public/src/components/header/header'
import { memory } from './public/src/pages/memory/memory'
import { tresEnRaya } from './public/src/pages/tresEnRaya/tresEnRaya'
import { trivial } from './public/src/pages/trivial/trivial'
import { wellcome } from './public/src/pages/wellcome/wellcome'
import { GAMES, QUIZ } from './public/src/utils/data'
import './style.css'
createHeader(GAMES)
wellcome()
const title = document.querySelector('#title')
title.addEventListener('click', () => {
const app = document.querySelector('#app')
app.innerHTML = ''
wellcome()
})
const gameButton = document.querySelector('.game-btn')
gameButton.addEventListener('click', () => {
const app = document.querySelector('#app')
app.innerHTML = ''
memory(GAMES[0].id)
})
const secondButtongame = document.querySelector('#TresEnRaya')
secondButtongame.addEventListener('click', () => {
const app = document.querySelector('#app')
app.innerHTML = ''
tresEnRaya()
})
const thirdButtongame = document.querySelector('#Trivial')
thirdButtongame.addEventListener('click', () => {
const app = document.querySelector('#app')
app.innerHTML = ''
trivial(QUIZ)
})