-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathnotes.notes
16 lines (13 loc) · 1.2 KB
/
notes.notes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
CSS Notes:
- transition: all 0.3s ease: smooth transition effect on the element after an event has been triggered
-webkit-text-stroke: 1px black : creates a black stroke around the text. Similar to a border but around the text itself
JS Logic:
RandomBox:
- Randomly select an index from the array of available tiles using math.random and math.floor
- Check if there are any avaialble tiles in the array to select. If there are, check if the player turn contains the player class and set the player sign to along with the player X icon
- If there are no available tiles, set the player sign to O and the player O icon
- Once the conditions have been checked, it runs the selectWinner function and determines if there is a winner or if it is a draw
- Disables the click events on the select tile to prevent interuption and enables the click events on the section container for the next game turn
startGameBtn:
- Gets players name from the input field and sets the players name based on the input and the active player X or OToggles the visibility of the sec content and set container
- Start game button event listener that triggers an event listener on click, to display the section content and hide the section container