/
+page.svelte.md
273 lines (265 loc) 路 9.96 KB
/
+page.svelte.md
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
---
title: Chat bubble
desc: Chat bubbles are used to show one line of conversation and all its data, including the author image, author name, time, etc.
published: true
layout: components
---
<script>
import Component from "$components/Component.svelte"
import ClassTable from "$components/ClassTable.svelte"
import ComponentPageTabs from "$components/ComponentPageTabs.svelte"
import BrowserSupport from "$components/BrowserSupport.svelte"
import { prefix } from '$lib/stores';
import { replace } from '$lib/actions';
</script>
<!-- <ComponentPageTabs/> -->
<ClassTable
data="{[
{ type:'component', class: 'chat', desc: 'Container for one line of conversation and all its data' },
{ type:'modifier', class: 'chat-start', desc: 'Aligns `chat` to left (required)' },
{ type:'modifier', class: 'chat-end', desc: 'Aligns `chat` to end (required)' },
{ type:'component', class: 'chat-image', desc: 'For the author image' },
{ type:'component', class: 'chat-header', desc: 'For the line above the chat bubble' },
{ type:'component', class: 'chat-footer', desc: 'For the line below the chat bubble' },
{ type:'component', class: 'chat-bubble', desc: 'For the content of chat' },
{ type:'modifier', class: 'chat-bubble-primary', desc: 'sets `primary` color for the `chat-bubble`' },
{ type:'modifier', class: 'chat-bubble-secondary', desc: 'sets `secondary` color for the `chat-bubble`' },
{ type:'modifier', class: 'chat-bubble-accent', desc: 'sets `accent` color for the `chat-bubble`' },
{ type:'modifier', class: 'chat-bubble-info', desc: 'sets `info` color for the `chat-bubble`' },
{ type:'modifier', class: 'chat-bubble-success', desc: 'sets `success` color for the `chat-bubble`' },
{ type:'modifier', class: 'chat-bubble-warning', desc: 'sets `warning` color for the `chat-bubble`' },
{ type:'modifier', class: 'chat-bubble-error', desc: 'sets `error` color for the `chat-bubble`' },
]}"
/>
<Component title="chat-start and chat-end">
<div class="w-full">
<div class="chat chat-start">
<div class="chat-bubble">It's over Anakin, <br/>I have the high ground.</div>
</div>
<div class="chat chat-end">
<div class="chat-bubble">You underestimate my power!</div>
</div>
</div>
<pre slot="html" use:replace={{ to: $prefix }}>{
`<div class="$$chat $$chat-start">
<div class="$$chat-bubble">It's over Anakin, <br/>I have the high ground.</div>
</div>
<div class="$$chat $$chat-end">
<div class="$$chat-bubble">You underestimate my power!</div>
</div>`
}</pre>
</Component>
<Component title="Chat with image">
<div class="w-full">
<div class="chat chat-start">
<div class="chat-image avatar">
<div class="w-10 rounded-full">
<img alt="Tailwind CSS chat bubble component" src="https://img.daisyui.com/images/stock/photo-1534528741775-53994a69daeb.jpg" />
</div>
</div>
<div class="chat-bubble">It was said that you would, destroy the Sith, not join them.</div>
</div>
<div class="chat chat-start">
<div class="chat-image avatar">
<div class="w-10 rounded-full">
<img alt="Tailwind CSS chat bubble component" src="https://img.daisyui.com/images/stock/photo-1534528741775-53994a69daeb.jpg" />
</div>
</div>
<div class="chat-bubble">It was you who would bring balance to the Force</div>
</div>
<div class="chat chat-start">
<div class="chat-image avatar">
<div class="w-10 rounded-full">
<img alt="Tailwind CSS chat bubble component" src="https://img.daisyui.com/images/stock/photo-1534528741775-53994a69daeb.jpg" />
</div>
</div>
<div class="chat-bubble">Not leave it in Darkness</div>
</div>
</div>
<pre slot="html" use:replace={{ to: $prefix }}>{
`<div class="$$chat $$chat-start">
<div class="$$chat-image $$avatar">
<div class="w-10 rounded-full">
<img alt="Tailwind CSS chat bubble component" src="https://img.daisyui.com/images/stock/photo-1534528741775-53994a69daeb.jpg" />
</div>
</div>
<div class="$$chat-bubble">It was said that you would, destroy the Sith, not join them.</div>
</div>
<div class="$$chat $$chat-start">
<div class="$$chat-image $$avatar">
<div class="w-10 rounded-full">
<img alt="Tailwind CSS chat bubble component" src="https://img.daisyui.com/images/stock/photo-1534528741775-53994a69daeb.jpg" />
</div>
</div>
<div class="$$chat-bubble">It was you who would bring balance to the Force</div>
</div>
<div class="$$chat $$chat-start">
<div class="$$chat-image $$avatar">
<div class="w-10 rounded-full">
<img alt="Tailwind CSS chat bubble component" src="https://img.daisyui.com/images/stock/photo-1534528741775-53994a69daeb.jpg" />
</div>
</div>
<div class="$$chat-bubble">Not leave it in Darkness</div>
</div>`
}</pre>
</Component>
<Component title="Chat with image, header and footer">
<div class="w-full">
<div class="chat chat-start">
<div class="chat-image avatar">
<div class="w-10 rounded-full">
<img alt="Tailwind CSS chat bubble component" src="https://img.daisyui.com/images/stock/photo-1534528741775-53994a69daeb.jpg" />
</div>
</div>
<div class="chat-header">
Obi-Wan Kenobi
<time class="text-xs opacity-50">12:45</time>
</div>
<div class="chat-bubble">You were the Chosen One!</div>
<div class="chat-footer opacity-50">
Delivered
</div>
</div>
<div class="chat chat-end">
<div class="chat-image avatar">
<div class="w-10 rounded-full">
<img alt="Tailwind CSS chat bubble component" src="https://img.daisyui.com/images/stock/photo-1534528741775-53994a69daeb.jpg" />
</div>
</div>
<div class="chat-header">
Anakin
<time class="text-xs opacity-50">12:46</time>
</div>
<div class="chat-bubble">I hate you!</div>
<div class="chat-footer opacity-50">
Seen at 12:46
</div>
</div>
</div>
<pre slot="html" use:replace={{ to: $prefix }}>{
`<div class="$$chat $$chat-start">
<div class="$$chat-image avatar">
<div class="w-10 rounded-full">
<img alt="Tailwind CSS chat bubble component" src="https://img.daisyui.com/images/stock/photo-1534528741775-53994a69daeb.jpg" />
</div>
</div>
<div class="$$chat-header">
Obi-Wan Kenobi
<time class="text-xs opacity-50">12:45</time>
</div>
<div class="$$chat-bubble">You were the Chosen One!</div>
<div class="$$chat-footer opacity-50">
Delivered
</div>
</div>
<div class="$$chat $$chat-end">
<div class="$$chat-image avatar">
<div class="w-10 rounded-full">
<img alt="Tailwind CSS chat bubble component" src="https://img.daisyui.com/images/stock/photo-1534528741775-53994a69daeb.jpg" />
</div>
</div>
<div class="$$chat-header">
Anakin
<time class="text-xs opacity-50">12:46</time>
</div>
<div class="$$chat-bubble">I hate you!</div>
<div class="$$chat-footer opacity-50">
Seen at 12:46
</div>
</div>`
}</pre>
</Component>
<Component title="Chat with header and footer">
<div class="w-full">
<div class="chat chat-start">
<div class="chat-header">
Obi-Wan Kenobi
<time class="text-xs opacity-50">2 hours ago</time>
</div>
<div class="chat-bubble">You were my brother, Anakin.</div>
<div class="chat-footer opacity-50">
Seen
</div>
</div>
<div class="chat chat-start">
<div class="chat-header">
Obi-Wan Kenobi
<time class="text-xs opacity-50">2 hour ago</time>
</div>
<div class="chat-bubble">I loved you.</div>
<div class="chat-footer opacity-50">
Delivered
</div>
</div>
</div>
<pre slot="html" use:replace={{ to: $prefix }}>{
`<div class="$$chat $$chat-start">
<div class="$$chat-header">
Obi-Wan Kenobi
<time class="text-xs opacity-50">2 hours ago</time>
</div>
<div class="$$chat-bubble">You were the Chosen One!</div>
<div class="$$chat-footer opacity-50">
Seen
</div>
</div>
<div class="$$chat $$chat-start">
<div class="$$chat-header">
Obi-Wan Kenobi
<time class="text-xs opacity-50">2 hour ago</time>
</div>
<div class="$$chat-bubble">I loved you.</div>
<div class="$$chat-footer opacity-50">
Delivered
</div>
</div>`
}</pre>
</Component>
<Component title="Chat Bubble with colors">
<div class="w-full">
<div class="chat chat-start">
<div class="chat-bubble chat-bubble-primary">What kind of nonsense is this</div>
</div>
<div class="chat chat-start">
<div class="chat-bubble chat-bubble-secondary">Put me on the Council and not make me a Master!??</div>
</div>
<div class="chat chat-start">
<div class="chat-bubble chat-bubble-accent">That's never been done in the history of the Jedi. It's insulting!</div>
</div>
<div class="chat chat-end">
<div class="chat-bubble chat-bubble-info">Calm down, Anakin.</div>
</div>
<div class="chat chat-end">
<div class="chat-bubble chat-bubble-success">You have been given a great honor.</div>
</div>
<div class="chat chat-end">
<div class="chat-bubble chat-bubble-warning">To be on the Council at your age.</div>
</div>
<div class="chat chat-end">
<div class="chat-bubble chat-bubble-error">It's never happened before.</div>
</div>
</div>
<pre slot="html" use:replace={{ to: $prefix }}>{
`<div class="$$chat $$chat-start">
<div class="$$chat-bubble $$chat-bubble-primary">What kind of nonsense is this</div>
</div>
<div class="$$chat $$chat-start">
<div class="$$chat-bubble $$chat-bubble-secondary">Put me on the Council and not make me a Master!??</div>
</div>
<div class="$$chat $$chat-start">
<div class="$$chat-bubble $$chat-bubble-accent">That's never been done in the history of the Jedi. It's insulting!</div>
</div>
<div class="$$chat $$chat-end">
<div class="$$chat-bubble $$chat-bubble-info">Calm down, Anakin.</div>
</div>
<div class="$$chat $$chat-end">
<div class="$$chat-bubble $$chat-bubble-success">You have been given a great honor.</div>
</div>
<div class="$$chat $$chat-end">
<div class="$$chat-bubble $$chat-bubble-warning">To be on the Council at your age.</div>
</div>
<div class="$$chat $$chat-end">
<div class="$$chat-bubble $$chat-bubble-error">It's never happened before.</div>
</div>`
}</pre>
</Component>