-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
110 lines (98 loc) · 2.81 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
<!DOCTYPE html>
<html>
<head>
<style>
/* Add styles for the button and div elements here */
/* make the background color black */
body {
background-color: black;
}
#input {
/* Example styles */
font-size: 18px;
font-family: sans-serif;
border: none;
background-color: #333;
color: #fff;
padding: 10px 20px;
/* Center the button horizontally*/
display: block;
margin: 0 auto;
/* Place the button just above center of the page */
position: absolute;
top: 45%;
left: 50%;
transform: translate(-50%, -50%);
}
#result {
/* Example styles */
font-size: 36px;
font-family: sans-serif;
color: #fff;
/* Center the div horizontally */
display: block;
margin: 0 auto;
/* Place the div just below center of the page */
position: absolute;
top: 55%;
left: 50%;
transform: translate(-50%, -50%);
}
h1 {
color: #fff;
font-size: 60px;
font-family: sans-serif;
text-align: center;
}
.linkp1 {
font-size: 18px;
font-family: sans-serif;
color: #fff;
position: absolute;
top: 63%;
left: 50%;
transform: translate(-50%, -50%);
}
.linkp2 {
font-size: 18px;
font-family: sans-serif;
color: #fff;
position: absolute;
top: 68%;
left: 50%;
transform: translate(-50%, -50%);
}
</style>
</head>
<body>
<!--Big title-->
<h1>Project Naming Inspiration</h1>
<button id="input">Generate Letter Pair</button>
<div id="result"></div>
<p class="linkp1">Look for cool project names with the letter pair here:</p>
<br>
<a class="linkp2" href="https://chat.openai.com/chat/"><u>ChatGPT</u></a>
<script>
const usedPairs = [];
function generatePair() {
// Generate a random letter pair
const letter1 = String.fromCharCode(Math.floor(Math.random() * 26) + 65);
const letter2 = String.fromCharCode(Math.floor(Math.random() * 26) + 65);
const pair = letter1 + letter2;
// Check if the pair has already been used
if (usedPairs.includes(pair)) {
console.log("Pair already used: " + pair);
} else {
console.log("New pair: " + pair);
usedPairs.push(pair);
}
// Update the text content of the div element
const output = document.querySelector('div');
output.textContent = pair;
}
// Add an event listener to the button element
const button = document.querySelector('button');
button.addEventListener('click', generatePair);
</script>
</body>
</html>