Register
Login
Resources
Docs Blog Datasets Glossary Case Studies Tutorials & Webinars
Product
Data Engine LLMs Platform Enterprise
Pricing Explore
Connect to our Discord channel

embed-preview.html 14 KB

You have to be logged in to leave a comment. Sign In
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
  1. <!DOCTYPE html>
  2. <html lang="en">
  3. <head>
  4. <meta charset="UTF-8">
  5. <meta name="viewport" content="width=device-width, initial-scale=1.0">
  6. <title>{{ page.title | default: 'Prompt Share' }} - {{ site.title }}</title>
  7. <!-- Tailwind CSS -->
  8. <script src="https://cdn.tailwindcss.com"></script>
  9. <script>
  10. tailwind.config = {
  11. theme: {
  12. extend: {
  13. colors: {
  14. 'dynamic-background': 'rgb(var(--background) / <alpha-value>)',
  15. 'dynamic-foreground': 'rgb(var(--foreground) / <alpha-value>)',
  16. 'dynamic-muted': 'rgb(var(--muted) / <alpha-value>)',
  17. 'dynamic-muted-foreground': 'rgb(var(--muted-foreground) / <alpha-value>)',
  18. 'dynamic-primary': 'rgb(var(--primary) / <alpha-value>)',
  19. 'dynamic-accent': 'rgb(var(--accent) / <alpha-value>)',
  20. 'dynamic-border': 'rgb(var(--border) / <alpha-value>)',
  21. }
  22. }
  23. }
  24. }
  25. </script>
  26. <link rel="stylesheet" href="{{ '/embed-preview-style.css' | relative_url }}">
  27. <link rel="icon" type="image/x-icon" href="{{ '/favicon.ico' | relative_url }}">
  28. <meta name="description" content="AI prompt viewer">
  29. <style>
  30. @keyframes flash {
  31. 0%, 100% { opacity: 1; }
  32. 50% { opacity: 0.4; }
  33. }
  34. .flash-animation {
  35. animation: flash 1.5s ease-in-out infinite;
  36. }
  37. @keyframes slideUp {
  38. from {
  39. transform: translateY(100%);
  40. opacity: 0;
  41. }
  42. to {
  43. transform: translateY(0);
  44. opacity: 1;
  45. }
  46. }
  47. @keyframes slideDown {
  48. from {
  49. transform: translateY(0);
  50. opacity: 1;
  51. }
  52. to {
  53. transform: translateY(100%);
  54. opacity: 0;
  55. }
  56. }
  57. .diff-enter {
  58. animation: slideUp 0.3s ease-out;
  59. }
  60. .diff-exit {
  61. animation: slideDown 0.3s ease-out;
  62. }
  63. </style>
  64. </head>
  65. <body class="bg-dynamic-background text-dynamic-foreground overflow-hidden">
  66. <!-- Viewer Mode -->
  67. <div id="viewer-mode" class="viewer-mode h-screen flex">
  68. <!-- Sidebar - File Tree -->
  69. <div id="file-sidebar" class="hidden w-40 sm:w-44 border-r border-dynamic-border bg-dynamic-muted/30 flex-shrink-0 overflow-y-auto custom-scrollbar">
  70. <div class="p-2 border-b border-dynamic-border">
  71. <h3 class="text-[10px] font-semibold text-dynamic-muted-foreground uppercase tracking-wider">Files</h3>
  72. </div>
  73. <div id="file-tree" class="p-1"></div>
  74. </div>
  75. <!-- Main Content -->
  76. <div class="flex-1 flex flex-col p-2 sm:p-4 h-full overflow-hidden">
  77. <!-- Top Bar with Context Pills and Edit Button -->
  78. <div class="flex justify-between items-start gap-2 mb-1 sm:mb-2 flex-shrink-0">
  79. <!-- Context Pills -->
  80. <div id="context-pills" class="flex flex-wrap gap-1.5 empty:hidden flex-1 min-w-0 pr-2"></div>
  81. <!-- Edit Button -->
  82. <button id="edit-button" class="p-1 text-dynamic-muted-foreground hover:text-dynamic-foreground transition-colors flex-shrink-0" title="Edit in designer">
  83. <svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
  84. <path d="M11 4H4a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-7"/>
  85. <path d="M18.5 2.5a2.121 2.121 0 0 1 3 3L12 15l-4 1 1-4 9.5-9.5z"/>
  86. </svg>
  87. </button>
  88. </div>
  89. <!-- Main Prompt Interface with Floating Diff - Flex-1 to take remaining space -->
  90. <div class="flex-1 relative min-h-0 overflow-hidden">
  91. <!-- Floating Diff View (when enabled and viewport is compact) -->
  92. <div id="diff-view" class="hidden absolute top-2 left-2 right-2 z-10 diff-floating">
  93. <div class="bg-dynamic-background/95 backdrop-blur-sm border border-dynamic-border shadow-lg rounded-lg p-3">
  94. <div class="flex items-center justify-between">
  95. <div class="flex items-center gap-1.5">
  96. <svg class="w-3 h-3 text-dynamic-primary flex-shrink-0" viewBox="0 0 20 20" fill="currentColor">
  97. <path fill-rule="evenodd" d="M4 2a2 2 0 00-2 2v12a2 2 0 002 2h12a2 2 0 002-2V7.414A2 2 0 0017.414 6L14 2.586A2 2 0 0012.586 2H4zm2 4a1 1 0 011-1h4a1 1 0 110 2H7a1 1 0 01-1-1zm1 3a1 1 0 100 2h6a1 1 0 100-2H7zm-1 5a1 1 0 011-1h6a1 1 0 110 2H7a1 1 0 01-1-1z" clip-rule="evenodd"/>
  98. </svg>
  99. <span id="diff-filename" class="text-xs font-medium text-dynamic-foreground truncate"></span>
  100. </div>
  101. <div class="flex gap-1 items-center">
  102. <div class="flex rounded-md overflow-hidden">
  103. <button id="diff-accept-diff" class="px-2 py-0.5 bg-green-500 hover:bg-green-600 text-white text-[10px] font-medium transition-colors flex items-center gap-0.5">
  104. <svg class="w-2.5 h-2.5" viewBox="0 0 20 20" fill="currentColor">
  105. <path fill-rule="evenodd" d="M16.707 5.293a1 1 0 010 1.414l-8 8a1 1 0 01-1.414 0l-4-4a1 1 0 011.414-1.414L8 12.586l7.293-7.293a1 1 0 011.414 0z" clip-rule="evenodd"/>
  106. </svg>
  107. <span class="hidden sm:inline">Accept</span>
  108. </button>
  109. <button id="diff-reject-diff" class="px-2 py-0.5 bg-red-500 hover:bg-red-600 text-white text-[10px] font-medium transition-colors flex items-center gap-0.5">
  110. <svg class="w-2.5 h-2.5" viewBox="0 0 20 20" fill="currentColor">
  111. <path fill-rule="evenodd" d="M4.293 4.293a1 1 0 011.414 0L10 8.586l4.293-4.293a1 1 0 111.414 1.414L11.414 10l4.293 4.293a1 1 0 01-1.414 1.414L10 11.414l-4.293 4.293a1 1 0 01-1.414-1.414L8.586 10 4.293 5.707a1 1 0 010-1.414z" clip-rule="evenodd"/>
  112. </svg>
  113. <span class="hidden sm:inline">Reject</span>
  114. </button>
  115. </div>
  116. <!-- Collapse/Expand button -->
  117. <button id="toggle-diff" class="p-0.5 text-dynamic-muted-foreground hover:text-dynamic-foreground transition-colors" title="Toggle diff view">
  118. <svg class="w-3 h-3 transform transition-transform" viewBox="0 0 20 20" fill="currentColor">
  119. <path fill-rule="evenodd" d="M5.293 7.293a1 1 0 011.414 0L10 10.586l3.293-3.293a1 1 0 111.414 1.414l-4 4a1 1 0 01-1.414 0l-4-4a1 1 0 010-1.414z" clip-rule="evenodd"/>
  120. </svg>
  121. </button>
  122. </div>
  123. </div>
  124. <div id="diff-content" class="space-y-1 transition-all duration-300 overflow-hidden">
  125. <div id="diff-old-content" class="bg-red-50/70 dark:bg-red-950/20 p-2 rounded text-[10px] font-mono whitespace-pre-wrap text-red-700 dark:text-red-400 overflow-x-auto border border-red-200/50 dark:border-red-900/30 max-h-20 overflow-y-auto custom-scrollbar"></div>
  126. <div id="diff-new-content" class="bg-green-50/70 dark:bg-green-950/20 p-2 rounded text-[10px] font-mono whitespace-pre-wrap text-green-700 dark:text-green-400 overflow-x-auto border border-green-200/50 dark:border-green-900/30 max-h-20 overflow-y-auto custom-scrollbar"></div>
  127. </div>
  128. </div>
  129. </div>
  130. <!-- Container for inline diff and prompt -->
  131. <div class="h-full flex flex-col">
  132. <!-- Inline Diff View (when enabled and viewport has space) -->
  133. <div id="diff-view-inline" class="hidden mb-2 flex-shrink-0">
  134. <div class="bg-dynamic-muted border border-dynamic-border rounded-lg p-2">
  135. <div class="flex items-center justify-between mb-1.5">
  136. <div class="flex items-center gap-1.5">
  137. <svg class="w-3 h-3 text-dynamic-primary flex-shrink-0" viewBox="0 0 20 20" fill="currentColor">
  138. <path fill-rule="evenodd" d="M4 2a2 2 0 00-2 2v12a2 2 0 002 2h12a2 2 0 002-2V7.414A2 2 0 0017.414 6L14 2.586A2 2 0 0012.586 2H4zm2 4a1 1 0 011-1h4a1 1 0 110 2H7a1 1 0 01-1-1zm1 3a1 1 0 100 2h6a1 1 0 100-2H7zm-1 5a1 1 0 011-1h6a1 1 0 110 2H7a1 1 0 01-1-1z" clip-rule="evenodd"/>
  139. </svg>
  140. <span id="inline-diff-filename" class="text-xs font-medium text-dynamic-foreground truncate"></span>
  141. </div>
  142. <div class="flex rounded-md overflow-hidden">
  143. <button id="inline-accept-diff" class="px-2 py-0.5 bg-green-500 hover:bg-green-600 text-white text-[10px] font-medium transition-colors flex items-center gap-0.5">
  144. <svg class="w-2.5 h-2.5" viewBox="0 0 20 20" fill="currentColor">
  145. <path fill-rule="evenodd" d="M16.707 5.293a1 1 0 010 1.414l-8 8a1 1 0 01-1.414 0l-4-4a1 1 0 011.414-1.414L8 12.586l7.293-7.293a1 1 0 011.414 0z" clip-rule="evenodd"/>
  146. </svg>
  147. <span class="hidden sm:inline">Accept</span>
  148. </button>
  149. <button id="inline-reject-diff" class="px-2 py-0.5 bg-red-500 hover:bg-red-600 text-white text-[10px] font-medium transition-colors flex items-center gap-0.5">
  150. <svg class="w-2.5 h-2.5" viewBox="0 0 20 20" fill="currentColor">
  151. <path fill-rule="evenodd" d="M4.293 4.293a1 1 0 011.414 0L10 8.586l4.293-4.293a1 1 0 111.414 1.414L11.414 10l4.293 4.293a1 1 0 01-1.414 1.414L10 11.414l-4.293 4.293a1 1 0 01-1.414-1.414L8.586 10 4.293 5.707a1 1 0 010-1.414z" clip-rule="evenodd"/>
  152. </svg>
  153. <span class="hidden sm:inline">Reject</span>
  154. </button>
  155. </div>
  156. </div>
  157. <div class="space-y-0.5">
  158. <div id="inline-old-content" class="bg-red-50/70 dark:bg-red-950/20 p-1 rounded text-[10px] font-mono whitespace-pre-wrap text-red-700 dark:text-red-400 overflow-x-auto border border-red-200/50 dark:border-red-900/30 max-h-20 overflow-y-auto custom-scrollbar"></div>
  159. <div id="inline-new-content" class="bg-green-50/70 dark:bg-green-950/20 p-1 rounded text-[10px] font-mono whitespace-pre-wrap text-green-700 dark:text-green-400 overflow-x-auto border border-green-200/50 dark:border-green-900/30 max-h-20 overflow-y-auto custom-scrollbar"></div>
  160. </div>
  161. </div>
  162. </div>
  163. <!-- Prompt Container - Full height of parent -->
  164. <div id="prompt-container" class="flex-1 bg-dynamic-muted border border-dynamic-border rounded-xl p-3 relative focus-within:border-dynamic-primary transition-colors flex flex-col min-h-0">
  165. <div id="prompt-text" class="flex-1 text-dynamic-foreground leading-relaxed whitespace-pre-wrap overflow-y-auto custom-scrollbar text-sm sm:text-base duration-300"></div>
  166. <div id="prompt-placeholder" class="text-dynamic-muted-foreground italic absolute top-3 left-3 pointer-events-none text-sm sm:text-base">← Enter your prompt on designer...</div>
  167. </div>
  168. </div>
  169. </div>
  170. <!-- Bottom Bar - Always visible with reduced height -->
  171. <div class="flex justify-between items-center gap-2 mt-1 pt-1 flex-shrink-0">
  172. <!-- Settings Pills - Smaller -->
  173. <div id="settings-pills" class="flex gap-1 flex-wrap flex-1 min-w-0"></div>
  174. <!-- Send Button - Smaller -->
  175. <button id="copy-button" class="w-7 h-7 sm:w-8 sm:h-8 bg-dynamic-primary text-white rounded-full flex items-center justify-center hover:opacity-90 transition-opacity flex-shrink-0 shadow-md" title="Send prompt">
  176. <svg width="14" height="14" class="sm:w-4 sm:h-4" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.5">
  177. <path d="M12 19V5M5 12l7-7 7 7"/>
  178. </svg>
  179. </button>
  180. </div>
  181. </div>
  182. </div>
  183. <!-- Notification -->
  184. <div id="notification" class="fixed top-4 right-4 bg-dynamic-accent text-white px-4 py-2 rounded-lg font-medium opacity-0 transition-opacity z-50 pointer-events-none"></div>
  185. <script src="{{ '/embed-preview-script.js' | relative_url }}"></script>
  186. </body>
  187. </html>
Tip!

Press p or to see the previous file or, n or to see the next file

Comments

Loading...