forked from steamship-core/langchain-production-starter
-
Notifications
You must be signed in to change notification settings - Fork 439
/
index.html
366 lines (276 loc) · 9.96 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
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
<head>
<!-- This will show up on the tab in your browser -->
<title>GirlfriendGPT</title>
<style>
.banner {
padding: 30px;
text-align: center;
color: white;
background: linear-gradient(270deg, #ff00cc, #3333cc);
background-size: 200% 200%;
animation: Gradient 2s ease infinite;
border: 5px solid #000000;
}
.banner h1 {
font-size: 3em;
text-shadow: 3px 3px #000000;
animation: flash 1s linear infinite;
}
@keyframes Gradient {
0% { background-position: 0% 50%; }
50% { background-position: 100% 50%; }
100% { background-position: 0% 50%; }
}
@keyframes flash {
0%,100% { opacity: 1; }
50% { opacity: 0.3; }
}
.row {
display: grid;
grid-template-columns: repeat(4, 1fr);
grid-gap: 10px;
}
.card {
background-color: #00FF00;
border: 2px solid #0000FF;
padding: 10px;
margin: 10px;
background-size: cover;
background-position: center;
color: #000;
position: relative;
overflow: hidden;
}
.card::before {
content: "";
float: left;
padding-top: 100%;
}
.card-content {
position: absolute;
top: 0;
left: 0;
right: 0;
bottom: 0;
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
background: rgba(0,0,0,0.6);
opacity: 0;
transition: opacity 0.3s ease;
color: #fff; /* This changes the text color to white */
}
.card:hover .card-content {
opacity: 1;
}
body {
text-align: center;
margin: 0px;
font-family: "Comic Sans MS";
background-color: #A0A0A0;
}
.about {
background-color: yellow;
padding: 0px;
}
.competition {
background-color: orange;
padding: 0px;
}
.cta {
margin: 30px;
padding: 30px;
text-align: center;
background-color: #00ccff;
border: 5px solid #000000;
}
.cta h2 {
font-size: 2em;
}
.cta p {
font-size: 1.2em;
}
.subscription {
margin: 30px;
padding: 30px;
text-align: center;
background-color: #ffcc00;
border: 5px solid #000000;
color: #000;
}
.subscription h2 {
font-size: 2em;
}
.subscription p {
font-size: 1.2em;
}
@media screen and (min-width: 1024px) {
body {
padding-left: 20%;
padding-right: 20%;
}
}
.iframe-wrapper {
overflow: hidden;
}
.card-content-selected {
opacity: 1 !important;
}
</style>
<!-- Google tag (gtag.js) -->
<script async src="https://www.googletagmanager.com/gtag/js?id=G-J780NZZD4N"></script>
<script>
window.dataLayer = window.dataLayer || [];
function gtag(){dataLayer.push(arguments);}
gtag('js', new Date());
gtag('config', 'G-J780NZZD4N');
</script>
</head>
<body>
<!-- This is the start of the "About" section -->
<div class="about">
<h1>GirlfriendGPT</h1>
<h2>The OSS AI companion store 👋
<a href="https://twitter.com/eniascailliau">Enias Cailliau</a></h2>
</div>
<div class="competition">
<h2>💰 Hey there! Ready to win $100 while having fun?</h2>
<p>We're kick-starting the FIRST open-source AI companion playstore, and here's your shot to be part of this exciting journey!</p>
<p>Got a cool idea for a personality? Sassy, brainy, sexy, mysterious... anything goes! The best part? The most kick-ass personality will pocket a sweet $100. So why wait?</p>
<p><strong><a href="https://airtable.com/shrZB2X6jEW2BdbpK" target="_blank">Submit your awesome personality right here, right now!</a></strong></p>
<p id="countdown">Hurry up, the clock is ticking! Submissions close in:</p>
</div>
<h1>Personalities:</h1>
<div id="grid" class="grid"></div>
<div class="cta">
<h2>Deploy your own AI companion!</h2>
<p>Pick one of the personalities and connect to your own private Telegram bot.
<br/>
<a href="https://www.steamship.com/packages/girlfriend-gpt-bot/_create">Click here</a> to get started for free.
</p>
</div>
<div class="subscription">
<h2>Subscribe for Updates</h2>
<p>I'm posting updates on Twitter every day.</p>
<p><a href="https://twitter.com/eniascailliau">Click here</a> to subscribe.</p>
</div>
<!-- This is the start of the projects section -->
<a href="https://www.github.com/EniasCailliau/GirlfriendGPT">
<div class="about">
<h1>Source code</h1>
</div>
</a>
<script>
function countdownTimer(endtime) {
var timer = setInterval(function() {
var t = Date.parse(endtime) - Date.parse(new Date());
var seconds = Math.floor((t / 1000) % 60);
var minutes = Math.floor((t / 1000 / 60) % 60);
var hours = Math.floor((t / (1000 * 60 * 60)) % 24);
var days = Math.floor(t / (1000 * 60 * 60 * 24));
document.getElementById("countdown").innerHTML = days + ' days ' +
hours + ' hours ' +
minutes + ' minutes and ' +
seconds + ' seconds remaining until winner is selected.';
if (t <= 0) {
clearInterval(timer);
document.getElementById("countdown").innerHTML = 'Competition Time!';
}
}, 1000);
}
window.onload = function() {
// Set the date we're counting down to (next Friday 8PM PST)
var countdownEndDate = new Date();
countdownEndDate.setDate(countdownEndDate.getDate() + (10 - countdownEndDate.getDay()) % 7);
countdownEndDate.setHours(20, 0, 0, 0);
countdownEndDate = countdownEndDate.toString().replace(/GMT.*/, 'PST');
countdownTimer(countdownEndDate);
}
function validateEmail(email) {
const re = /^(([^<>()[\]\\.,;:\s@\"]+(\.[^<>()[\]\\.,;:\s@\"]+)*)|(\".+\"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/;
return re.test(email);
}
function generateRandomHash() {
let array = new Uint32Array(10);
window.crypto.getRandomValues(array);
let hash = Array.from(array, dec => ('0' + dec.toString(16)).substr(-2)).join('');
return hash
}
fetch('girlfriends.json')
.then(response => response.json())
.then(girlfriends => {
let row;
girlfriends.forEach(function(girlfriend, i) {
if (i % 4 === 0) {
row = document.createElement('div');
row.className = 'row';
grid.appendChild(row);
}
const card = document.createElement('div');
card.className = 'card';
card.style.backgroundImage = `url(${girlfriend.profile_image})`;
const cardContent = document.createElement('div');
cardContent.className = 'card-content';
const name = document.createElement('h2');
name.innerText = girlfriend.name;
cardContent.appendChild(name);
const description = document.createElement('p');
description.innerText = girlfriend.description;
cardContent.appendChild(description);
card.appendChild(cardContent);
row.appendChild(card);
let cardIsOpen = false;
let cardIframeWrapper;
card.onclick = async function() {
const clickedRow = this.parentNode;
const allCardContents = grid.querySelectorAll('.card-content');
allCardContents.forEach(cardContent => {
cardContent.classList.remove('card-content-selected');
});
let chatId = localStorage.getItem("chatId");
if (chatId === null) {
chatId = generateRandomHash()
localStorage.setItem("chatId", chatId);
}
const allIframeWrappers = grid.querySelectorAll('.iframe-wrapper');
allIframeWrappers.forEach(iframeWrapper => {
if (iframeWrapper !== cardIframeWrapper) {
iframeWrapper.style.height = '0px';
setTimeout(function() {
grid.removeChild(iframeWrapper);
}, 2000);
}
});
if (cardIsOpen && cardIframeWrapper) {
cardIframeWrapper.style.height = '0px';
setTimeout(function() {
grid.removeChild(cardIframeWrapper);
cardIsOpen = false; // Reset cardIsOpen to false here
}, 2000);
} else {
cardContent.classList.add('card-content-selected');
const iframeWrapper = document.createElement('div');
iframeWrapper.style.padding = '10px';
iframeWrapper.style.height = '0px';
iframeWrapper.style.transition = 'height 2s';
iframeWrapper.className = 'iframe-wrapper';
const iframe = document.createElement('iframe');
iframe.src = girlfriend.chat_src + "&chat_id=" + chatId;
iframe.width = "100%";
iframe.height = "700";
iframe.frameBorder = "0";
iframeWrapper.appendChild(iframe);
grid.insertBefore(iframeWrapper, clickedRow.nextSibling);
setTimeout(function() {
iframeWrapper.style.height = '700px';
}, 0);
cardIsOpen = true;
cardIframeWrapper = iframeWrapper;
}
};
});
})
.catch(error => console.error('Error:', error));
</script>
</body>