1
00:00:02,210 --> 00:00:03,420
Now, again,

2
00:00:03,420 --> 00:00:06,860
over all those previous course sections,

3
00:00:06,860 --> 00:00:09,170
we learned a lot of new things.

4
00:00:09,170 --> 00:00:11,980
We learned a lot about JavaScript.

5
00:00:11,980 --> 00:00:16,980
And therefore, it is now time for another milestone project.

6
00:00:17,830 --> 00:00:21,300
We are going to build the game, Tic, Tac, Toe.

7
00:00:21,300 --> 00:00:24,560
We're going to build a website that runs that game

8
00:00:24,560 --> 00:00:25,720
to be precise.

9
00:00:25,720 --> 00:00:28,250
And for that, we are going to use

10
00:00:28,250 --> 00:00:31,900
what we learned about JavaScript, but not just.

11
00:00:31,900 --> 00:00:35,220
We are also going to write all the HTML

12
00:00:35,220 --> 00:00:39,150
and CSS code for this game.

13
00:00:39,150 --> 00:00:41,970
And as you can see already in the background,

14
00:00:41,970 --> 00:00:45,874
for this game, we are going to make sure that we got,

15
00:00:45,874 --> 00:00:48,060
of course, two players,

16
00:00:48,060 --> 00:00:51,070
because we need two players for that game.

17
00:00:51,070 --> 00:00:52,730
And for those players,

18
00:00:52,730 --> 00:00:55,270
we will be able to assign names

19
00:00:55,270 --> 00:01:00,270
by opening an overlay with an input field for the name.

20
00:01:00,410 --> 00:01:03,570
We can cancel that and close the overlay

21
00:01:03,570 --> 00:01:08,070
without saving the name or we do save the name.

22
00:01:08,070 --> 00:01:10,840
We will have some validation

23
00:01:10,840 --> 00:01:15,840
where we show some error styles and some error message,

24
00:01:15,890 --> 00:01:18,490
if the name is not valid,

25
00:01:18,490 --> 00:01:21,350
if we don't enter a name, to be precise.

26
00:01:21,350 --> 00:01:24,750
And that will all be driven by a JavaScript.

27
00:01:24,750 --> 00:01:28,010
The opening and closing of this overlay here,

28
00:01:28,010 --> 00:01:30,610
but also the form validation

29
00:01:30,610 --> 00:01:33,370
and handling the correct form data.

30
00:01:33,370 --> 00:01:35,580
It's not sent to any server.

31
00:01:35,580 --> 00:01:39,250
Instead, everything here is handled with client-side,

32
00:01:39,250 --> 00:01:42,300
with browser-side JavaScript.

33
00:01:42,300 --> 00:01:44,420
And once we get those names, of course,

34
00:01:44,420 --> 00:01:47,440
the most important part of the site

35
00:01:47,440 --> 00:01:49,890
will be the game itself.

36
00:01:49,890 --> 00:01:53,610
And here we have automatically switching turns

37
00:01:53,610 --> 00:01:55,350
between these two players.

38
00:01:55,350 --> 00:01:58,240
And then we can, well, click on the field

39
00:01:58,240 --> 00:02:00,590
where we want to place our symbol.

40
00:02:00,590 --> 00:02:03,620
Once we did that, it switches to the other player.

41
00:02:03,620 --> 00:02:07,310
And then we either end the game with a draw,

42
00:02:07,310 --> 00:02:11,080
if no player manages to get three in a row,

43
00:02:11,080 --> 00:02:12,920
or if one of the two players

44
00:02:12,920 --> 00:02:15,780
manages to get three in a row, of course,

45
00:02:15,780 --> 00:02:18,513
that player wins and we can then start a new game,

46
00:02:18,513 --> 00:02:20,483
thereafter if you want to.

47
00:02:21,770 --> 00:02:25,880
Now as I said before, all the logic for this game

48
00:02:25,880 --> 00:02:28,660
and for updating what we see on the page,

49
00:02:28,660 --> 00:02:32,210
for evaluating whether we have a winner or not,

50
00:02:32,210 --> 00:02:35,230
all of that will be driven by JavaScript.

51
00:02:35,230 --> 00:02:37,750
And therefore in this course section,

52
00:02:37,750 --> 00:02:40,910
we are going to apply all these things

53
00:02:40,910 --> 00:02:42,602
we learned about JavaScript

54
00:02:42,602 --> 00:02:47,602
in conjunction with what we already know about HTML and CSS.

55
00:02:48,550 --> 00:02:51,840
But the focus definitely is on Java script.

56
00:02:51,840 --> 00:02:55,730
Now as with all those milestone projects,

57
00:02:55,730 --> 00:03:00,100
this section here is generally optional,

58
00:03:00,100 --> 00:03:02,930
as its main goal and its main focus

59
00:03:02,930 --> 00:03:05,800
is that we just apply what we already know,

60
00:03:05,800 --> 00:03:07,630
that we practice what we learned,

61
00:03:07,630 --> 00:03:11,120
and that you see all those concepts in the context

62
00:03:11,120 --> 00:03:13,583
of a more realistic project.

63
00:03:14,470 --> 00:03:18,870
But there also is some new content in this section,

64
00:03:18,870 --> 00:03:21,890
some concepts, which simply make more sense

65
00:03:21,890 --> 00:03:25,570
to be introduced in such a real project.

66
00:03:25,570 --> 00:03:29,710
And to be precise, there are two main new concepts

67
00:03:29,710 --> 00:03:31,490
we are going to dive in.

68
00:03:31,490 --> 00:03:34,420
One of them will be handling the form submission

69
00:03:34,420 --> 00:03:36,780
with JavaScript.

70
00:03:36,780 --> 00:03:41,287
So preventing that default of sending an HTTP request

71
00:03:41,287 --> 00:03:44,220
to a backend, which we don't have yet,

72
00:03:44,220 --> 00:03:46,080
that will be one thing.

73
00:03:46,080 --> 00:03:47,880
And in conjunction with that,

74
00:03:47,880 --> 00:03:50,530
we are also going to learn about a different way

75
00:03:50,530 --> 00:03:53,490
of creating JavaScript objects.

76
00:03:53,490 --> 00:03:58,170
And the other main concept or JavaScript feature

77
00:03:58,170 --> 00:04:00,560
we are going to dive in, which is new,

78
00:04:00,560 --> 00:04:03,340
will be that we use a certain attribute

79
00:04:03,340 --> 00:04:06,980
that we can add to all HTML elements

80
00:04:06,980 --> 00:04:10,670
that will help us with managing and storing data,

81
00:04:10,670 --> 00:04:14,863
which we need in JavaScript, in our HTML code.

82
00:04:15,950 --> 00:04:18,410
Now if you want to jump to those lectures,

83
00:04:18,410 --> 00:04:21,630
attached, you'll find links to these specific lectures

84
00:04:21,630 --> 00:04:24,690
so that you can still skip the rest of this module

85
00:04:24,690 --> 00:04:27,270
if you are not interested in it right now.

86
00:04:27,270 --> 00:04:30,160
But of course, as always, my strong recommendation

87
00:04:30,160 --> 00:04:33,950
is that you do go through these milestone projects.

88
00:04:33,950 --> 00:04:36,540
And this project here is no exception,

89
00:04:36,540 --> 00:04:39,390
since it is a great chance to practice

90
00:04:39,390 --> 00:04:40,820
all the things you learned,

91
00:04:40,820 --> 00:04:45,193
and to again, see multiple important concepts come together.

