-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.html
More file actions
200 lines (187 loc) · 11.4 KB
/
index.html
File metadata and controls
200 lines (187 loc) · 11.4 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
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
<!DOCTYPE html>
<html lang="en" class="h-full">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>LLMs Prompt Optimizer</title>
<script src="https://cdn.tailwindcss.com"></script>
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css">
<script>
tailwind.config = {
theme: {
extend: {
colors: {
primary: '#4F46E5',
secondary: '#10B981',
}
}
}
}
</script>
<style>
@keyframes slide {
0% {
transform: translateX(0);
}
100% {
transform: translateX(-50%);
}
}
.flag-carousel {
white-space: nowrap;
overflow: hidden;
}
.flag-carousel-inner {
display: inline-block;
animation: slide 60s linear infinite;
}
.flag-carousel-inner:hover {
animation-play-state: paused;
}
.flag {
display: inline-block;
padding: 0 0.25rem;
}
.spinner {
border: 4px solid rgba(0, 0, 0, 0.1);
width: 36px;
height: 36px;
border-radius: 50%;
border-left-color: #4F46E5;
animation: spin 1s ease infinite;
margin: 0 auto;
}
@keyframes spin {
0% { transform: rotate(0deg); }
100% { transform: rotate(360deg); }
}
.tooltip {
position: absolute;
left: 50%;
transform: translateX(-50%);
white-space: nowrap;
}
.tooltip-arrow,
.tooltip-arrow::before {
position: absolute;
width: 8px;
height: 8px;
background: inherit;
}
.tooltip-arrow {
visibility: hidden;
}
.tooltip-arrow::before {
visibility: visible;
content: '';
transform: rotate(45deg);
}
.tooltip[data-popper-placement^='top'] > .tooltip-arrow {
bottom: -4px;
}
.tooltip[data-popper-placement^='bottom'] > .tooltip-arrow {
top: -4px;
}
.tooltip[data-popper-placement^='left'] > .tooltip-arrow {
right: -4px;
}
.tooltip[data-popper-placement^='right'] > .tooltip-arrow {
left: -4px;
}
</style>
</head>
<body class="bg-gradient-to-br from-blue-100 to-purple-100 min-h-screen flex flex-col items-center justify-center p-4">
<div class="w-full max-w-3xl">
<div class="bg-white rounded-lg shadow-lg p-6 space-y-4">
<div class="flex justify-between items-center">
<h1 class="text-2xl font-bold text-gray-800">LLMs Prompt Optimizer</h1>
<button id="settings-icon" class="text-gray-600 hover:text-primary transition-colors">
<i class="fas fa-cog text-xl"></i>
</button>
</div>
<p class="text-sm text-gray-600">Note: All new UI (07/06/2024) / Updated to GPT-4o model (05/13/2024)</p>
<textarea id="prompt-input" class="w-full h-40 p-2 border border-gray-300 rounded-md focus:ring-2 focus:ring-primary focus:border-transparent" placeholder="Please enter what you would like AI to do..."></textarea>
<div class="flex justify-between items-center">
<button id="optimize-button" class="bg-gradient-to-r from-primary to-blue-600 text-white px-4 py-2 rounded-md hover:from-blue-600 hover:to-primary transition-all duration-300 disabled:opacity-50 disabled:cursor-not-allowed" disabled>
Optimize
</button>
<div class="flex space-x-2">
<div class="relative inline-block">
<button id="chatgpt-button" class="bg-green-500 text-white px-3 py-2 rounded-md hover:bg-green-600 transition-colors opacity-50 cursor-not-allowed" disabled>
<i class="fab fa-telegram"></i>
</button>
<div id="chatgpt-tooltip" class="absolute z-10 invisible inline-block px-3 py-2 text-sm font-medium text-white transition-opacity duration-300 bg-gray-900 rounded-lg shadow-sm opacity-0 tooltip dark:bg-gray-700">
Use optimized prompt in ChatGPT
<div class="tooltip-arrow" data-popper-arrow></div>
</div>
</div>
<button id="copy-button" class="hidden bg-secondary text-white px-3 py-2 rounded-md hover:bg-green-600 transition-colors">
<i class="far fa-copy"></i>
</button>
<button id="copied-button" class="hidden bg-green-600 text-white px-3 py-2 rounded-md">
<i class="fas fa-check"></i>
</button>
</div>
</div>
</div>
<div class="mt-4 bg-white rounded-lg shadow-lg p-4">
<div class="flag-carousel text-2xl">
<div class="flag-carousel-inner">
<span class="flag">🇨🇳</span><span class="flag">🇺🇸</span><span class="flag">🇫🇷</span><span class="flag">🇷🇺</span><span class="flag">🇪🇸</span><span class="flag">🇪🇬</span><span class="flag">🇵🇹</span><span class="flag">🇩🇪</span><span class="flag">🇯🇵</span><span class="flag">🇰🇷</span><span class="flag">🇮🇹</span><span class="flag">🇳🇱</span><span class="flag">🇮🇳</span><span class="flag">🇹🇷</span><span class="flag">🇸🇪</span><span class="flag">🇵🇱</span><span class="flag">🇻🇳</span><span class="flag">🇹🇭</span><span class="flag">🇮🇩</span><span class="flag">🇬🇷</span><span class="flag">🇨🇿</span><span class="flag">🇫🇮</span><span class="flag">🇳🇴</span><span class="flag">🇩🇰</span><span class="flag">🇬🇧</span><span class="flag">🇮🇷</span><span class="flag">🇦🇺</span><span class="flag">🇧🇷</span><span class="flag">🇨🇦</span><span class="flag">🇲🇽</span><span class="flag">🇦🇷</span><span class="flag">🇨🇱</span><span class="flag">🇨🇴</span><span class="flag">🇵🇪</span><span class="flag">🇻🇪</span><span class="flag">🇿🇦</span><span class="flag">🇳🇬</span><span class="flag">🇰🇪</span><span class="flag">🇪🇹</span><span class="flag">🇲🇦</span><span class="flag">🇸🇦</span><span class="flag">🇦🇪</span><span class="flag">🇮🇱</span><span class="flag">🇵🇰</span><span class="flag">🇧🇩</span>
<span class="flag">🇨🇳</span><span class="flag">🇺🇸</span><span class="flag">🇫🇷</span><span class="flag">🇷🇺</span><span class="flag">🇪🇸</span><span class="flag">🇪🇬</span><span class="flag">🇵🇹</span><span class="flag">🇩🇪</span><span class="flag">🇯🇵</span><span class="flag">🇰🇷</span><span class="flag">🇮🇹</span><span class="flag">🇳🇱</span><span class="flag">🇮🇳</span><span class="flag">🇹🇷</span><span class="flag">🇸🇪</span><span class="flag">🇵🇱</span><span class="flag">🇻🇳</span><span class="flag">🇹🇭</span><span class="flag">🇮🇩</span><span class="flag">🇬🇷</span><span class="flag">🇨🇿</span><span class="flag">🇫🇮</span><span class="flag">🇳🇴</span><span class="flag">🇩🇰</span><span class="flag">🇬🇧</span><span class="flag">🇮🇷</span><span class="flag">🇦🇺</span><span class="flag">🇧🇷</span><span class="flag">🇨🇦</span><span class="flag">🇲🇽</span><span class="flag">🇦🇷</span><span class="flag">🇨🇱</span><span class="flag">🇨🇴</span><span class="flag">🇵🇪</span><span class="flag">🇻🇪</span><span class="flag">🇿🇦</span><span class="flag">🇳🇬</span><span class="flag">🇰🇪</span><span class="flag">🇪🇹</span><span class="flag">🇲🇦</span><span class="flag">🇸🇦</span><span class="flag">🇦🇪</span><span class="flag">🇮🇱</span><span class="flag">🇵🇰</span><span class="flag">🇧🇩</span>
</div>
</div>
<p class="mt-2 text-center text-sm text-gray-600 font-semibold">Supporting input in 90+ languages</p>
</div>
</div>
<footer class="mt-8 py-6 border-t border-gray-200">
<div class="max-w-3xl mx-auto px-4">
<div class="flex flex-col items-center space-y-2">
<div class="text-sm text-gray-600">
<a href="https://www.hichipli.com/contact"
target="_blank"
rel="noopener noreferrer"
class="hover:text-primary transition-colors">
Contact Us
</a>
<span class="mx-2">•</span>
<span>© 2024 University of Florida</span>
</div>
<p class="text-xs text-gray-500">
Developed by VIABLE Lab at UF
</p>
</div>
</div>
</footer>
<!-- Modal -->
<div id="modal" class="fixed inset-0 bg-black bg-opacity-50 hidden items-center justify-center">
<div class="bg-white rounded-lg p-6 w-full max-w-2xl mx-auto max-h-[90vh] overflow-y-auto">
<div id="loading" class="text-center mb-4 hidden">
<div class="text-lg mb-2">Optimizing Prompt...</div>
<div class="spinner"></div>
</div>
<textarea id="optimized-prompt" class="w-full h-40 p-2 border border-gray-300 rounded-md mb-4"></textarea>
<div class="flex justify-end space-x-2">
<button id="retry-button" class="bg-yellow-500 text-white px-4 py-2 rounded-md hover:bg-yellow-600 transition-colors">Retry</button>
<button id="accept-button" class="bg-green-500 text-white px-4 py-2 rounded-md hover:bg-green-600 transition-colors">Accept</button>
<button id="cancel-button" class="bg-red-500 text-white px-4 py-2 rounded-md hover:bg-red-600 transition-colors">Cancel</button>
</div>
</div>
</div>
<!-- Settings Modal -->
<div id="settings-modal" class="fixed inset-0 bg-black bg-opacity-50 hidden items-center justify-center">
<div class="bg-white rounded-lg p-6 w-full max-w-md mx-auto">
<h2 class="text-xl font-bold mb-4">Settings</h2>
<label for="api-key-input" class="block mb-2">OpenAI API Key:</label>
<input type="text" id="api-key-input" class="w-full p-2 border border-gray-300 rounded-md mb-4" placeholder="Enter your API key">
<div class="flex justify-between">
<button id="save-button" class="bg-primary text-white px-4 py-2 rounded-md hover:bg-blue-600 transition-colors">Save</button>
<button id="clear-button" class="bg-red-500 text-white px-4 py-2 rounded-md hover:bg-red-600 transition-colors">Clear</button>
<button id="copy-api-key-button" class="bg-secondary text-white px-4 py-2 rounded-md hover:bg-green-600 transition-colors">Copy</button>
</div>
<div id="api-key-message" class="mt-4 p-2 bg-red-100 text-red-800 rounded-md hidden"></div>
</div>
</div>
<script src="script.js"></script>
</body>
</html>