1
- // Import our custom CSS
2
- import '../scss/styles.scss'
3
1
import { createModal , createGameModal } from './createModal.js'
4
2
import { insert , insertModal } from './insert.js'
5
3
import { startGame } from './pong/pong.js'
6
4
7
- // Import all of Bootstrap's JS
8
- import * as bootstrap from 'bootstrap'
9
-
10
5
insert ( '.headerContainer' , 'headerSVG.html' ) ;
11
- insertModal ( '.tournament' , 'tournamentModal.html' , 'tournament' , 'Tournament' ) ;
6
+ // insertModal('.tournament', 'tournamentModal.html', 'tournament', 'Tournament');
12
7
13
8
const gameModal = createGameModal ( ) ;
14
9
// Select the button that should open the game modal
@@ -36,8 +31,44 @@ document.getElementById('pongModal').addEventListener('shown.bs.modal', function
36
31
setTimeout ( startGame ( ) , 0 ) ;
37
32
} ) ;
38
33
39
- createModal ( 'signUp' , 'Sign Up' , `
40
- <form id="signUpForm">
34
+ createModal ( 'tournament' , 'Tournament' , `
35
+ <form id="playerForm" class="form">
36
+ <p class="font">Select number of players:</p>
37
+ <div class="row justify-content-center">
38
+ <div class="col-md-3">
39
+ <div class="form-check">
40
+ <input class="form-check-input" type="radio" name="playerCount" id="2vs2" value="2">
41
+ <label class="form-check-label font" for="2vs2">2</label>
42
+ </div>
43
+ </div>
44
+ <div class="col-md-3">
45
+ <div class="form-check">
46
+ <input class="form-check-input" type="radio" name="playerCount" id="4vs4" value="4">
47
+ <label class="form-check-label font" for="4vs4">4</label>
48
+ </div>
49
+ </div>
50
+ <div class="col-md-3">
51
+ <div class="form-check">
52
+ <input class="form-check-input" type="radio" name="playerCount" id="6vs6" value="6">
53
+ <label class="form-check-label font" for="6vs6">6</label>
54
+ </div>
55
+ </div>
56
+ <div class="col-md-3">
57
+ <div class="form-check">
58
+ <input class="form-check-input" type="radio" name="playerCount" id="8vs8" value="8">
59
+ <label class="form-check-label font" for="8vs8">8</label>
60
+ </div>
61
+ </div>
62
+ </div>
63
+ <div id="playerAliasInputs" style="display: none;">
64
+ <!-- Player alias inputs will be dynamically added here -->
65
+ </div>
66
+ <button type="submit" class="submit">Play</button>
67
+ </form>` )
68
+ import './modals/tournament.js' ;
69
+
70
+ createModal ( 'signUp' , 'Sign up' , `
71
+ <form id="signUpForm" class="form">
41
72
<div class="form-group">
42
73
<label class="labelFont" for="signUpEmail">Email</label>
43
74
<input type="email" class="form-control" id="signUpEmail" placeholder="Enter email"
@@ -64,7 +95,7 @@ import './modals/signup.js';
64
95
65
96
import './modals/profile.js' ;
66
97
createModal ( 'login' , 'Log in' , `
67
- <form id="loginForm" class="text-center ">
98
+ <form id="loginForm" class="form ">
68
99
<div class="form-group">
69
100
<label class="labelFont" for="loginUsername">Username</label>
70
101
<input type="text" class="form-control" id="loginUsername" placeholder="Enter username" required>
@@ -82,16 +113,16 @@ createModal('login', 'Log in', `
82
113
</p>` ) ;
83
114
import './modals/signup.js' ;
84
115
85
- createModal ( 'logout' , `
116
+ createModal ( 'logout' , 'Log out' , `
86
117
<div class="modal-body">
87
118
<p class="ErrorMessage">Are you sure you want to log out?</p>
88
119
</div>
89
- <div class="submitContainer ">
120
+ <div class="modal-footer ">
90
121
<button type="button" class="submit" data-bs-dismiss="modal">Cancel</button>
91
122
<button type="button" class="submit" onclick="confirmLogout()">Yes, Log out</button>
92
123
</div>` ) ;
93
124
import './modals/login.js' ;
94
125
95
126
insertModal ( '.about' , 'aboutModal.html' , 'about' , 'About' ) ;
96
127
97
- createModal ( 'Profile' , '<div id="userProfile"></div>' )
128
+ createModal ( 'Profile' , 'Profile' , ' <div id="userProfile"></div>')
0 commit comments