|
8 | 8 |
|
9 | 9 | const itemsToCopy = [ |
10 | 10 | { |
11 | | - text: '<span class="text-indigo-400">npm</span> <span>i @lostisworld/svelte-interactive-cursor</span>' |
| 11 | + text: '<span class="text-amber-600">npm</span> <span>i @lostisworld/svelte-interactive-cursor</span>' |
12 | 12 | }, |
13 | 13 | { |
14 | | - text: '<span class="text-indigo-400">pnpm</span> <span>add @lostisworld/svelte-interactive-cursor</span>' |
| 14 | + text: '<span class="text-amber-600">pnpm</span> <span>add @lostisworld/svelte-interactive-cursor</span>' |
15 | 15 | } |
16 | 16 | ]; |
17 | 17 |
|
|
39 | 39 | }); |
40 | 40 | </script> |
41 | 41 |
|
42 | | -<header |
| 42 | +<aside |
43 | 43 | class={[ |
44 | | - 'lg:min-h-screen px-4 py-32 flex flex-col items-center justify-center bg-gray-900 relative', |
45 | | - 'before:block before:w-px before:bg-gray-700 before:mx-auto before:mb-8 before:flex-1', |
46 | | - 'after:block after:w-px after:h-9 after:bg-gray-700 after:mx-auto after:mt-8 after:flex-1' |
| 44 | + '2xl:fixed 2xl:top-0 2xl:left-0 2xl:bottom-0 2xl:w-2/5 bg-indigo-600', |
| 45 | + 'flex justify-center 2xl:justify-end text-indigo-100 max-w-full' |
47 | 46 | ]} |
48 | | - data-interactive-cursor-area |
49 | 47 | > |
50 | | - <h1 class="text-3xl font-extrabold sm:text-5xl lg:text-8xl text-center"> |
51 | | - Svelte |
52 | | - <strong class="font-extrabold text-indigo-600 sm:block">Interactive Cursor</strong> |
53 | | - </h1> |
54 | | - |
55 | | - <p class="mt-8 sm:text-xl text-pretty max-w-xl mx-auto text-center text-gray-400"> |
56 | | - The <strong>InteractiveCursor</strong> is a Svelte 5 component that provides a customizable, interactive |
57 | | - cursor effect. It dynamically changes its position and size based on user interactions within specified |
58 | | - trigger areas. |
59 | | - </p> |
60 | | - |
61 | 48 | <div |
62 | | - class="mt-16 flex flex-wrap justify-center gap-4 lg:max-w-lg max-w-md border border-gray-700 rounded-md p-4 lg:p-6" |
63 | | - data-interactive-cursor="copyarea" |
| 49 | + class="h-full overflow-y-auto pt-64 min-h-screen pb-32 lg:py-16 flex flex-col justify-center 2xl:items-end items-center px-8 2xl:pr-16" |
64 | 50 | > |
65 | | - {#each itemsToCopy as { text }, idx (idx)} |
66 | | - <div class="flex w-full rounded-md shadow-sm"> |
67 | | - <pre |
68 | | - class="bg-gray-800 p-2 rounded-l-md text-sm flex w-full overflow-auto border-t border-l border-b border-gray-700"> |
69 | | - <code>{@html text}</code> |
70 | | - </pre> |
71 | | - <button |
72 | | - type="button" |
73 | | - class="h-full p-2 rounded-r-md shrink-0 {isCopied && toCopiedText === text |
74 | | - ? 'bg-indigo-600' |
75 | | - : 'bg-gray-600 hover:bg-indigo-600'}" |
76 | | - aria-label="copy to clipboard" |
77 | | - onclick={() => getClipboardText(text)} |
78 | | - > |
79 | | - <svg |
80 | | - xmlns="http://www.w3.org/2000/svg" |
81 | | - fill="none" |
82 | | - viewBox="0 0 24 24" |
83 | | - stroke-width="2" |
84 | | - stroke="currentColor" |
85 | | - class="h-full" |
86 | | - > |
87 | | - <path |
88 | | - stroke-linecap="round" |
89 | | - stroke-linejoin="round" |
90 | | - d="m4.5 12.75 6 6 9-13.5" |
91 | | - class={isCopied && toCopiedText === text ? 'block' : 'hidden'} |
92 | | - /> |
| 51 | + <h1 class="font-extrabold text-7xl lg:text-8xl text-center 2xl:text-right text-white mb-16"> |
| 52 | + <span class="drop-shadow-lg">Svelte</span> |
| 53 | + <strong class="block drop-shadow-lg text-indigo-950">Interactive</strong> |
| 54 | + <span class="drop-shadow-lg text-indigo-950">Cursor</span> |
| 55 | + </h1> |
93 | 56 |
|
94 | | - <path |
95 | | - class={!isCopied || toCopiedText !== text ? 'block' : 'hidden'} |
96 | | - stroke-linecap="round" |
97 | | - stroke-linejoin="round" |
98 | | - d="M15.75 17.25v3.375c0 .621-.504 1.125-1.125 1.125h-9.75a1.125 1.125 0 0 1-1.125-1.125V7.875c0-.621.504-1.125 1.125-1.125H6.75a9.06 9.06 0 0 1 1.5.124m7.5 10.376h3.375c.621 0 1.125-.504 1.125-1.125V11.25c0-4.46-3.243-8.161-7.5-8.876a9.06 9.06 0 0 0-1.5-.124H9.375c-.621 0-1.125.504-1.125 1.125v3.5m7.5 10.375H9.375a1.125 1.125 0 0 1-1.125-1.125v-9.25m12 6.625v-1.875a3.375 3.375 0 0 0-3.375-3.375h-1.5a1.125 1.125 0 0 1-1.125-1.125v-1.5a3.375 3.375 0 0 0-3.375-3.375H9.75" |
99 | | - /> |
100 | | - </svg> |
101 | | - </button> |
102 | | - </div> |
103 | | - {/each} |
104 | | - </div> |
| 57 | + <p class="sm:text-xl text-pretty max-w-xl mx-auto text-center 2xl:text-right"> |
| 58 | + This package enhances user experience by providing a customizable and interactive cursor. It |
| 59 | + is perfect for adding unique cursor effects to your Svelte applications, making them more |
| 60 | + engaging and visually appealing. |
| 61 | + </p> |
| 62 | + |
| 63 | + <div class="flex flex-wrap justify-center gap-4 lg:max-w-lg max-w-md mt-8"> |
| 64 | + {#each itemsToCopy as { text }, idx (idx)} |
| 65 | + <div class="flex w-full rounded-md shadow-sm"> |
| 66 | + <pre class="bg-gray-900 p-2 rounded-l-md text-sm flex w-full overflow-auto"> |
| 67 | + <code>{@html text}</code> |
| 68 | + </pre> |
| 69 | + <button |
| 70 | + type="button" |
| 71 | + class="h-full p-2 rounded-r-md shrink-0 {isCopied && toCopiedText === text |
| 72 | + ? 'bg-amber-600' |
| 73 | + : 'bg-gray-600 hover:bg-amber-600'}" |
| 74 | + aria-label="copy to clipboard" |
| 75 | + onclick={() => getClipboardText(text)} |
| 76 | + > |
| 77 | + <svg |
| 78 | + xmlns="http://www.w3.org/2000/svg" |
| 79 | + fill="none" |
| 80 | + viewBox="0 0 24 24" |
| 81 | + stroke-width="2" |
| 82 | + stroke="currentColor" |
| 83 | + class="h-full" |
| 84 | + > |
| 85 | + <path |
| 86 | + stroke-linecap="round" |
| 87 | + stroke-linejoin="round" |
| 88 | + d="m4.5 12.75 6 6 9-13.5" |
| 89 | + class={isCopied && toCopiedText === text ? 'block' : 'hidden'} |
| 90 | + /> |
105 | 91 |
|
106 | | - <div class="absolute bottom-24 left-1/2 -translate-x-1/2 text-gray-700"> |
107 | | - <svg |
108 | | - xmlns="http://www.w3.org/2000/svg" |
109 | | - fill="none" |
110 | | - viewBox="0 0 24 24" |
111 | | - stroke-width="1" |
112 | | - stroke="currentColor" |
113 | | - class="size-6 lg:animate-bounce" |
114 | | - > |
115 | | - <path stroke-linecap="round" stroke-linejoin="round" d="m19.5 8.25-7.5 7.5-7.5-7.5" /> |
116 | | - </svg> |
| 92 | + <path |
| 93 | + class={!isCopied || toCopiedText !== text ? 'block' : 'hidden'} |
| 94 | + stroke-linecap="round" |
| 95 | + stroke-linejoin="round" |
| 96 | + d="M15.75 17.25v3.375c0 .621-.504 1.125-1.125 1.125h-9.75a1.125 1.125 0 0 1-1.125-1.125V7.875c0-.621.504-1.125 1.125-1.125H6.75a9.06 9.06 0 0 1 1.5.124m7.5 10.376h3.375c.621 0 1.125-.504 1.125-1.125V11.25c0-4.46-3.243-8.161-7.5-8.876a9.06 9.06 0 0 0-1.5-.124H9.375c-.621 0-1.125.504-1.125 1.125v3.5m7.5 10.375H9.375a1.125 1.125 0 0 1-1.125-1.125v-9.25m12 6.625v-1.875a3.375 3.375 0 0 0-3.375-3.375h-1.5a1.125 1.125 0 0 1-1.125-1.125v-1.5a3.375 3.375 0 0 0-3.375-3.375H9.75" |
| 97 | + /> |
| 98 | + </svg> |
| 99 | + </button> |
| 100 | + </div> |
| 101 | + {/each} |
| 102 | + </div> |
117 | 103 | </div> |
118 | | -</header> |
| 104 | +</aside> |
0 commit comments