-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtictactoet.html
More file actions
145 lines (126 loc) · 3.72 KB
/
tictactoet.html
File metadata and controls
145 lines (126 loc) · 3.72 KB
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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Thoughts Board</title>
<style>
body {
font-family: 'Arial', sans-serif;
background-color: #f4f4f9;
margin: 0;
padding: 0;
display: flex;
justify-content: center;
align-items: center;
min-height: 100vh;
flex-direction: column;
}
.container {
background-color: #fff;
box-shadow: 0 0 20px rgba(0, 0, 0, 0.1);
border-radius: 10px;
overflow: hidden;
width: 60%;
max-width: 800px;
max-height: 80vh;
display: flex;
flex-direction: column;
}
header {
background-color: #6200ea;
color: #fff;
text-align: center;
padding: 20px;
}
header h1 {
margin: 0;
font-size: 2rem;
}
header p {
margin: 0;
font-size: 1rem;
}
.input-section {
padding: 20px;
display: flex;
gap: 10px;
align-items: center;
}
textarea {
width: 100%;
height: 150px;
padding: 15px;
border: 1px solid #ccc;
border-radius: 5px;
font-size: 1.2rem;
resize: none;
outline: none;
transition: all 0.3s ease;
}
textarea:focus {
border-color: #6200ea;
box-shadow: 0 0 10px rgba(98, 0, 234, 0.2);
}
button {
padding: 15px 20px;
background-color: #6200ea;
color: #fff;
border: none;
border-radius: 5px;
cursor: pointer;
font-size: 1.2rem;
transition: background-color 0.3s ease;
}
button:hover {
background-color: #3700b3;
}
#thoughtsContainer {
padding: 20px;
border-top: 1px solid #eee;
overflow-y: auto;
flex-grow: 1;
}
.thought {
background-color: #f4f4f9;
padding: 15px;
margin-bottom: 10px;
border-radius: 5px;
box-shadow: 0 0 10px rgba(0, 0, 0, 0.05);
font-size: 1.2rem;
}
</style>
</head>
<body>
<div class="container">
<header>
<h1>Thoughts Board</h1>
<p>Share what's on your mind</p>
</header>
<div class="input-section">
<textarea id="thoughtInput" placeholder="Type your thoughts here..."></textarea>
<button onclick="postThought()">Post</button>
</div>
<div id="thoughtsContainer">
<!-- Thoughts will be displayed here -->
</div>
</div>
<script>
function postThought() {
const input = document.getElementById('thoughtInput');
const thoughtsContainer = document.getElementById('thoughtsContainer');
if (input.value.trim() === '') {
alert('Please enter a thought before posting.');
return;
}
const thoughtDiv = document.createElement('div');
thoughtDiv.className = 'thought';
thoughtDiv.textContent = input.value;
thoughtsContainer.appendChild(thoughtDiv);
// Scroll to the bottom to show the latest post
thoughtsContainer.scrollTop = thoughtsContainer.scrollHeight;
input.value = ''; // Clear the input field
}
</script>
</body>
</html>