File tree Expand file tree Collapse file tree 2 files changed +22
-30
lines changed Expand file tree Collapse file tree 2 files changed +22
-30
lines changed Original file line number Diff line number Diff line change 1
1
<script setup lang="ts">
2
2
import { transformJsxToString } from ' unplugin-jsx-string/api'
3
3
4
- const { copy } = useClipboard ()
4
+ const { copy, copied } = useClipboard ()
5
5
6
6
const code = $ref (
7
7
`
@@ -33,41 +33,40 @@ const convert = () => {
33
33
}
34
34
}
35
35
36
- const copyOutput = async () => {
37
- await copy (result )
38
- // eslint-disable-next-line no-alert
39
- alert (' Copied!' )
40
- }
36
+ const copyOutput = () => copy (result )
41
37
42
38
watch ($$ (code ), () => convert (), { immediate: true })
43
39
</script >
44
40
45
41
<template >
46
- <main font-sans p =" x-4 y-10" text =" center gray-700 dark:gray-200" >
42
+ <main
43
+ font-sans
44
+ py10
45
+ text =" gray-700 dark:gray-200"
46
+ flex =" ~ col"
47
+ items-center
48
+ gap4
49
+ >
47
50
<app-header />
48
-
49
- <div py-4 />
50
-
51
51
<code-input v-model =" code" placeholder =" Paste your code" />
52
52
53
- <div py-4 >Output</div >
54
-
55
- <code-input :model-value =" result" readonly />
56
-
57
- <div >
53
+ <div flex gap2 items-center >
54
+ Output
58
55
<button
59
56
text-sm
60
- btn
61
- flex = " inline gap-1 "
62
- items-center
57
+ rounded
58
+ hover = " bg-active "
59
+ p2
63
60
:disabled =" !code"
64
61
@click =" copyOutput"
65
62
>
66
- <div i-carbon-copy inline-block />
67
- Copy
63
+ <div
64
+ :class =" copied ? 'i-carbon:checkmark text-green' : 'i-carbon-copy'"
65
+ />
68
66
</button >
69
67
</div >
70
68
69
+ <code-input :model-value =" result" readonly />
71
70
<app-footer />
72
71
</main >
73
72
</template >
Original file line number Diff line number Diff line change @@ -7,16 +7,9 @@ import {
7
7
} from 'unocss'
8
8
9
9
export default defineConfig ( {
10
- shortcuts : [
11
- [
12
- 'btn' ,
13
- 'px-4 py-1 rounded inline-block bg-teal-600 text-white cursor-pointer hover:bg-teal-700 disabled:cursor-default disabled:bg-gray-600 disabled:opacity-50' ,
14
- ] ,
15
- [
16
- 'icon-btn' ,
17
- 'text-[0.9em] inline-block cursor-pointer select-none opacity-75 transition duration-200 ease-in-out hover:opacity-100 hover:text-teal-600' ,
18
- ] ,
19
- ] ,
10
+ shortcuts : {
11
+ 'bg-active' : 'bg-#8881' ,
12
+ } ,
20
13
presets : [
21
14
presetWind3 ( ) ,
22
15
presetAttributify ( ) ,
You can’t perform that action at this time.
0 commit comments