-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
187 lines (159 loc) · 6.04 KB
/
index.html
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
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Tic Tac Toe</title>
<link rel="stylesheet" href="https://fonts.googleapis.com/icon?family=Material+Icons">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/material-components-web/11.0.0/material-components-web.min.css">
<link rel="stylesheet" href="styles.css">
</head>
<body>
<div class="container">
<h1>Tic Tac Toe</h1>
<div class="player-info">
<div class="player">
<label for="player1">Player X:</label>
<input type="text" id="player1" placeholder="Enter Player X Name">
<span id="scoreX" class="score">0</span>
</div>
<div class="player">
<label for="player2">Player O:</label>
<input type="text" id="player2" placeholder="Enter Player O Name">
<span id="scoreO" class="score">0</span>
</div>
</div>
<div class="board" id="board">
<div class="cell" data-cell></div>
<div class="cell" data-cell></div>
<div class="cell" data-cell></div>
<div class="cell" data-cell></div>
<div class="cell" data-cell></div>
<div class="cell" data-cell></div>
<div class="cell" data-cell></div>
<div class="cell" data-cell></div>
<div class="cell" data-cell></div>
</div>
<div class="message" id="message"></div>
<div class="buttons">
<button id="restartButton" class="mdc-button mdc-button--raised">
<span class="mdc-button__label">Restart Game</span>
</button>
<button id="resetScoresButton" class="mdc-button mdc-button--outlined">
<span class="mdc-button__label">Reset Scores</span>
</button>
</div>
</div>
<script src="https://cdnjs.cloudflare.com/ajax/libs/material-components-web/11.0.0/material-components-web.min.js"></script>
<script src="script.js"></script>
<script>
// Create the badge element
const badge = document.createElement('div');
badge.id = 'badge_843219';
badge.className = 'badge_219843';
// Create the logo element
const logo = document.createElement('img');
logo.id = 'logo_982134';
logo.className = 'logo_412983';
logo.src = 'https://cdn.githubraw.com/harshitj183/harshitj183/main/badge/profileLOgo.png';
logo.alt = 'Google logo';
// Create the text element
const text = document.createElement('div');
text.id = 'text_654321';
text.className = 'text_123654';
// Create the partner element
const partner = document.createElement('span');
partner.id = 'partner_765432';
partner.className = 'partner_345678';
partner.textContent = '@harshitj183';
// Create the fullName element
const fullName = document.createElement('span');
fullName.id = 'fullName_987654';
fullName.className = 'full-name_567890';
fullName.textContent = 'Harshit Jaiswal';
// Create the developedByText element
const developedByText = document.createElement('span');
developedByText.id = 'developedByText_456789';
developedByText.className = 'developed-by-text_890123';
developedByText.textContent = 'Developed by';
// Append the elements to the page
text.appendChild(developedByText);
text.appendChild(partner);
text.appendChild(fullName);
badge.appendChild(logo);
badge.appendChild(text);
document.body.appendChild(badge);
// Add the CSS styles
const styles = `
#badge_843219 {
position: fixed;
bottom: 10px;
right: 10px;
display: flex;
align-items: center;
padding: 2px;
background-color: #4285f4;
border: 1px solid #4285f4;
border-radius: 3px;
font-size: 10px;
color: #fff;
width: 120px;
height: 30px;
animation: trending 2s infinite;
}
#logo_982134 {
position: absolute;
top: -10px;
left: -10px;
width: 50px;
height: 50px;
border-radius: 25%;
border: 2px solid #fff;
border-bottom: 2px solid #4285f4;
border-radius: 50% 50% 50% 50%/60% 60% 40% 40%;
transition: transform 0.2s ease-in-out;
}
#logo_982134:hover {
transform: rotate(360deg) scale(1.1);
}
#text_654321 {
display: flex;
flex-direction: column;
align-items: flex-start;
margin-left: 50px;
}
#partner_765432 {
color: #fff;
font-weight: bold;
display: block;
}
#fullName_987654 {
display: none;
}
@keyframes trending {
0% {
transform: scale(1);
}
50% {
transform: scale(1.1);
}
100% {
transform: scale(1);
}
}
`;
const styleSheet = document.createElement('style');
styleSheet.textContent = styles;
document.head.appendChild(styleSheet);
// Add hover effect to badge
badge.addEventListener('mouseover', () => {
developedByText.style.display = 'none';
fullName.style.display = 'block';
});
badge.addEventListener('mouseout', () => {
developedByText.style.display = 'block';
fullName.style.display = 'none';
});
</script>
</body>
</html>