Gregniuki commited on
Commit
64c9386
·
verified ·
1 Parent(s): 0d3cc49

Update index.html

Browse files
Files changed (1) hide show
  1. index.html +94 -14
index.html CHANGED
@@ -1,21 +1,101 @@
1
  <!DOCTYPE html>
2
- <html lang="en">
3
  <head>
4
- <meta charset="UTF-8">
5
- <meta name="viewport" content="width=device-width, initial-scale=1.0">
6
- <title>Ping Pong Game</title>
7
- <link rel="stylesheet" href="styles.css">
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
8
  </head>
9
  <body>
10
- <div id="scoreboard">
11
- <span>Player: <span id="playerScore">0</span></span>
12
- <span>Bot: <span id="botScore">0</span></span>
 
 
 
 
13
  </div>
14
- <div id="gameArea">
15
- <div id="paddleLeft" class="paddle"></div>
16
- <div id="paddleRight" class="paddle"></div>
17
- <div id="ball"></div>
18
- </div>
19
- <script src="script.js"></script>
20
  </body>
21
  </html>
 
1
  <!DOCTYPE html>
2
+ <html>
3
  <head>
4
+ <title>Advanced Pong</title>
5
+ <style>
6
+ body { margin: 0; overflow: hidden; background-color: #111; cursor: none; }
7
+ #gameArea { position: relative; width: 100vw; height: 100vh; }
8
+ .paddle {
9
+ position: absolute;
10
+ width: 10px;
11
+ height: 80px; /* Base height */
12
+ background-color: white;
13
+ transition: height 0.2s ease-out; /* For power-up effect */
14
+ }
15
+ #paddleLeft { left: 5px; }
16
+ #paddleRight { right: 5px; }
17
+ #ball {
18
+ position: absolute;
19
+ width: 15px;
20
+ height: 15px;
21
+ background-color: red;
22
+ border-radius: 50%;
23
+ box-shadow: 0 0 5px red; /* Basic glow */
24
+ }
25
+ /* Ball trail effect */
26
+ #ball::after {
27
+ content: '';
28
+ position: absolute;
29
+ top: 50%;
30
+ left: 50%;
31
+ width: 100%;
32
+ height: 100%;
33
+ border-radius: 50%;
34
+ background: red;
35
+ opacity: 0.5;
36
+ transform: translate(-50%, -50%) scale(1);
37
+ filter: blur(5px);
38
+ z-index: -1;
39
+ transition: transform 0.1s linear, opacity 0.1s linear; /* Trail fade */
40
+ }
41
+ #ball.moving::after { /* Activate trail when moving */
42
+ transform: translate(-50%, -50%) scale(1.5); /* Adjust trail size */
43
+ opacity: 0; /* Fade out */
44
+ }
45
+ /* Impact flash effect */
46
+ .impact {
47
+ box-shadow: 0 0 15px 5px yellow !important;
48
+ transform: scale(1.1);
49
+ }
50
+
51
+ #scores {
52
+ position: absolute;
53
+ top: 10px;
54
+ left: 50%;
55
+ transform: translateX(-50%);
56
+ color: white;
57
+ font-size: 24px;
58
+ font-family: sans-serif;
59
+ user-select: none;
60
+ }
61
+ #powerUp {
62
+ position: absolute;
63
+ width: 20px;
64
+ height: 20px;
65
+ background-color: cyan;
66
+ border-radius: 5px;
67
+ box-shadow: 0 0 8px cyan;
68
+ display: none; /* Hidden initially */
69
+ }
70
+ #chargeIndicator {
71
+ position: absolute;
72
+ bottom: 20px;
73
+ left: 20px;
74
+ width: 50px;
75
+ height: 10px;
76
+ background-color: grey;
77
+ border: 1px solid white;
78
+ display: none; /* Hidden initially */
79
+ }
80
+ #chargeIndicatorFill {
81
+ width: 0%;
82
+ height: 100%;
83
+ background-color: yellow;
84
+ transition: width 0.05s linear;
85
+ }
86
+ </style>
87
  </head>
88
  <body>
89
+ <div id="gameArea">
90
+ <div id="paddleLeft" class="paddle"></div>
91
+ <div id="paddleRight" class="paddle"></div>
92
+ <div id="ball"></div>
93
+ <div id="powerUp"></div>
94
+ <div id="scores">
95
+ <span id="playerScore">0</span> - <span id="botScore">0</span>
96
  </div>
97
+ <div id="chargeIndicator"><div id="chargeIndicatorFill"></div></div>
98
+ </div>
99
+ <script src="script.js"></script> <!-- Link your JS file -->
 
 
 
100
  </body>
101
  </html>