Skip to content

Commit 5c72d0e

Browse files
committed
feat: display previous messages
1 parent f4e59e8 commit 5c72d0e

File tree

2 files changed

+101
-81
lines changed

2 files changed

+101
-81
lines changed

index.html

Lines changed: 49 additions & 80 deletions
Original file line numberDiff line numberDiff line change
@@ -79,15 +79,15 @@
7979
</div>
8080
<div class="copy-button-container">
8181
<code class="copy-text">npx @usrrname/cursorrules</code>
82-
<button class="copy-button" aria-label="Copy command to clipboard" onclick="copyToClipboard()">
83-
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round"
84-
stroke-linejoin="round">
85-
<rect x="9" y="9" width="13" height="13" rx="2" ry="2"></rect>
86-
<path d="M5 15H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h9a2 2 0 0 1 2 2v1"></path>
87-
</svg>
88-
Copy
89-
</button>
90-
</div>
82+
<button class="copy-button" aria-label="Copy command to clipboard" onclick="copyToClipboard()">
83+
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round"
84+
stroke-linejoin="round">
85+
<rect x="9" y="9" width="13" height="13" rx="2" ry="2"></rect>
86+
<path d="M5 15H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h9a2 2 0 0 1 2 2v1"></path>
87+
</svg>
88+
Copy
89+
</button>
90+
</div>
9191
</div>
9292
</div>
9393
</div>
@@ -201,7 +201,7 @@
201201
</div>
202202
<div class="type">Normal / Electric</div>
203203
</div>
204-
</div>
204+
</div>
205205

206206
<!-- SageSoftwareDaddy Card -->
207207
<div class="card sage">
@@ -232,18 +232,18 @@
232232
</div>
233233
<div class="type">Ice / Ground</div>
234234
</div>
235-
</div>
235+
</div>
236236

237237
<!-- Spellchuck Card -->
238238
<div class="card fairy">
239239
<div class="card-header">
240240
<span class="pokemon-name">Spellchuck</span>
241241
<span class="hp">HP 180</span>
242-
</div>
243-
<div class="pokemon-info">
244-
Documentation AI Agent. Length: 4'11", Weight: 95 lbs.
245-
</div>
246-
<div class="image-container">
242+
</div>
243+
<div class="pokemon-info">
244+
Documentation AI Agent. Length: 4'11", Weight: 95 lbs.
245+
</div>
246+
<div class="image-container">
247247
<img loading="lazy" src="https://gifdb.com/images/high/anime-elf-frieren-going-to-eat-cake-33rvseyebg1a1wgj.gif"
248248
alt="Elf Frieren" class="pokemon-image">
249249
</div>
@@ -317,92 +317,61 @@
317317
</div>
318318
<div class="chat-header">
319319
<div class="chat-title">
320-
<button class="file-name"><span style="color: #ffa500;">&lt;&gt;&nbsp;</span>index.html</button>
321-
<button class="terminal-title">Custom Pokemon Card Creation</button>
320+
<button class="file-name" onclick="toggleView('.editor-container')"><span
321+
style="color: #ffa500;">&lt;&gt;&nbsp;</span>index.html</button>
322+
<button class="terminal-title" onclick="toggleView('.chat-messages')">Custom Pokemon Card Creation</button>
322323
</div>
323324
</div>
324325
<div class="chat-messages">
325-
<div class="message user-message">
326-
KawaiiSamurai are you sure we've added all the ai agent information as pokemon cards?
327-
</div>
326+
<div class="previous-messages">
327+
<div class="chat-title">
328+
<div class="file-name"><span style="color: #ffa500;">&lt;&gt;&nbsp;</span>index.html</div>
329+
</div>
330+
<div class="message user-message">
331+
KawaiiSamurai are you sure we've added all the ai agent information as pokemon cards?
332+
</div>
333+
</div>
328334
<div class="message">
329335
<div><i>Adjusts kawaii glasses with a sparkle ✨</i></div>
330336
<p>
331337
Oh my goodness, you're right desu! I notice we're missing ThirstySimp-chan from our Pokemon card
332338
collection! Let me add that card right away with the same kawaii styling as the others!
333339
</p>
334340
</div>
335-
336-
<div class="generating">
337-
Generating...
338-
</div>
339-
340-
<div class="message">
341-
<span>Kawaii desu ne! (。♥‿♥。) I've created a super cute chat component that looks just like the Cursor chat
342-
interface! Here are the kawaii features I included:</sp>
343-
<ol>
344-
<li>Visual Style ✨</li>
345-
<ul>
346-
<li>Dark theme matching Cursor (#1e1e1e background)</li>
347-
<li>Pretty macOS window buttons</li>
348-
<li>Nice rounded corners (8px border-radius)</li>
349-
<li>Beautiful scrollbar design</li>
350-
</ul>
351-
<li>Message Layout 📝</li>
352-
<ul>
353-
<li>User messages in light color (#d4d4d4)</li>
354-
<li>Assistant messages in pretty purple (#c586c0)</li>
355-
<li>Cute action text in blue (#569cd6)</li>
356-
<li>Proper spacing and margins</li>
357-
</ul>
358-
<li>Header Design 🎀</li>
359-
<ul>
360-
<li>File name in pretty blue</li>
361-
<li>Clean title layout</li>
362-
<li>Nice border separation</li>
363-
</ul>
364-
365-
<li>Interactive Elements 🖱️</li>
366-
<ul>
367-
<li>Hover effects on buttons</li>
368-
<li>Smooth scrolling</li>
369-
<li>Stop button with icon</li>
370-
</ul>
371-
<li>Typography 📚</li>
372-
<ul>
373-
<li>Monaco/Consolas font for that coding feel</li>
374-
<li>Perfect font sizes (13-14px)</li>
375-
<li>Nice line height (1.5)</li>
376-
</ul>
377-
</ol>
378-
<span>Would you like me to add more kawaii features or adjust anything? Maybe add some sparkly
379-
animations
380-
or more message examples? (ノ◕ヮ◕)ノ:・゚✧</span>
381-
</div>
382341
</div>
383342
</div>
384-
</div>
343+
</div>
385344
<script>
345+
function toggleView(viewToShow) {
346+
const chatMessages = document.querySelector('.chat-messages');
347+
const view = document.querySelector(viewToShow);
348+
349+
if (viewToShow === '.editor-container') {
350+
chatMessages.style.display = 'none';
351+
view.style.display = 'block';
352+
} else {
353+
chatMessages.style.display = 'block';
354+
}
355+
}
386356
function copyToClipboard() {
387357
const text = 'npx @usrrname/cursorrules';
388358
navigator.clipboard.writeText(text).then(() => {
389359
const button = document.querySelector('.copy-button');
390360
button.classList.add('copied');
391361
button.innerHTML = `
392-
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
393-
<polyline points="20 6 9 17 4 12"></polyline>
394-
</svg>
395-
Copied!
396-
`;
362+
svg viewBox="0 0 24 24" fill="none" stroke="cu ke-width="2" stroke-linecap="round ">
363+
<polyl </polyline>
364+
ed!
365+
`;
397366
setTimeout(() => {
398367
button.classList.remove('copied');
399368
button.innerHTML = `
400-
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
401-
<rect x="9" y="9" width="13" height="13" rx="2" ry="2"></rect>
402-
<path d="M5 15H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h9a2 2 0 0 1 2 2v1"></path>
403-
</svg>
404-
Copy
405-
`;
369+
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
370+
<rect x="9" y="9" width="13" height="13" rx="2" ry="2"></rect>
371+
<path d="M5 15H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h9a2 2 0 0 1 2 2v1"></path>
372+
</svg>
373+
Copy
374+
`;
406375
}, 2000);
407376
});
408377
}

styles.css

Lines changed: 52 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -785,11 +785,12 @@ body::before {
785785
overflow-x: hidden;
786786
overflow-y: auto;
787787
max-height: 400px;
788+
border-radius: 0 0 8px 8px;
788789
}
789790

790791
.line-numbers {
791792
user-select: none;
792-
text-align: right;
793+
text-align: left;
793794
padding-right: 1em;
794795
color: #858585;
795796
border-right: 1px solid #404040;
@@ -880,6 +881,7 @@ body::before {
880881
}
881882

882883
.chat-title .file-name {
884+
width: fit-content;
883885
display: flex;
884886
align-items: center;
885887
justify-content: space-between;
@@ -890,6 +892,9 @@ body::before {
890892
background: none;
891893
border: none;
892894
cursor: pointer;
895+
border-radius: 4px;
896+
border: 1px solid #3a3a3a;
897+
padding: 0px;
893898

894899
&:hover::after {
895900
font-size: inherit;
@@ -915,12 +920,58 @@ body::before {
915920
font-size: small;
916921
}
917922

923+
.previous-messages {
924+
display: flex;
925+
flex-direction: column;
926+
gap: 12px;
927+
background: rgba(45, 45, 45, 0.5);
928+
border-radius: 8px;
929+
padding: 16px;
930+
margin-bottom: 24px;
931+
border: 1px solid #3a3a3a;
932+
}
933+
934+
935+
.timestamp {
936+
color: #858585;
937+
font-size: 12px;
938+
text-align: center;
939+
margin-bottom: 12px;
940+
font-weight: 500;
941+
}
918942
.message {
919943
margin-bottom: 20px;
920944
font-size: small;
921945
line-height: 1.5;
922946
}
923947

948+
.message-header {
949+
display: flex;
950+
justify-content: space-between;
951+
align-items: center;
952+
margin-bottom: 4px;
953+
}
954+
955+
.agent-name {
956+
color: #ff8eb4;
957+
font-weight: 600;
958+
}
959+
960+
.user-name {
961+
color: #27c93f;
962+
font-weight: 600;
963+
}
964+
965+
.message-time {
966+
color: #858585;
967+
font-size: 11px;
968+
}
969+
970+
.message p {
971+
margin: 0;
972+
padding: 0;
973+
color: #d4d4d4;
974+
}
924975
.user-message {
925976
color: #d4d4d4;
926977
}

0 commit comments

Comments
 (0)