@valerius_petrini/corekit-ui 0.1.48 → 0.1.51
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.ts +15 -13
- package/dist/index.js +14 -12
- package/package.json +3 -3
- package/dist/actions/fbm.d.ts +0 -10
- package/dist/actions/fbm.js +0 -199
- package/dist/components/Analytics.svelte +0 -28
- package/dist/components/Analytics.svelte.d.ts +0 -4
- package/dist/components/Button.svelte +0 -64
- package/dist/components/Button.svelte.d.ts +0 -4
- package/dist/components/Card.svelte +0 -24
- package/dist/components/Card.svelte.d.ts +0 -4
- package/dist/components/Checkbox.svelte +0 -35
- package/dist/components/Checkbox.svelte.d.ts +0 -4
- package/dist/components/FloatingInput.svelte +0 -78
- package/dist/components/FloatingInput.svelte.d.ts +0 -4
- package/dist/components/FloatingSelect.svelte +0 -39
- package/dist/components/FloatingSelect.svelte.d.ts +0 -4
- package/dist/components/Navbar.svelte +0 -37
- package/dist/components/Navbar.svelte.d.ts +0 -4
- package/dist/components/NavbarElement.svelte +0 -39
- package/dist/components/NavbarElement.svelte.d.ts +0 -4
- package/dist/components/NavbarSeparator.svelte +0 -1
- package/dist/components/NavbarSeparator.svelte.d.ts +0 -26
- package/dist/components/SEO.svelte +0 -43
- package/dist/components/SEO.svelte.d.ts +0 -4
- package/dist/components/Text.svelte +0 -39
- package/dist/components/Text.svelte.d.ts +0 -4
- package/dist/components/Typewriter.svelte +0 -86
- package/dist/components/Typewriter.svelte.d.ts +0 -4
- package/dist/styles/color.d.ts +0 -4
- package/dist/styles/color.js +0 -62
- package/dist/styles/layout.css +0 -44
- package/dist/styles/size.d.ts +0 -3
- package/dist/styles/size.js +0 -57
- package/dist/types/Analytics.d.ts +0 -3
- package/dist/types/Button.d.ts +0 -17
- package/dist/types/Card.d.ts +0 -6
- package/dist/types/Checkbox.d.ts +0 -9
- package/dist/types/FloatingInput.d.ts +0 -13
- package/dist/types/FloatingSelect.d.ts +0 -10
- package/dist/types/Navbar.d.ts +0 -14
- package/dist/types/SEO.d.ts +0 -6
- package/dist/types/Text.d.ts +0 -8
- package/dist/types/Typewriter.d.ts +0 -18
package/dist/index.d.ts
CHANGED
|
@@ -1,13 +1,15 @@
|
|
|
1
|
-
export { default as Button } from "
|
|
2
|
-
export { default as Typewriter } from "
|
|
3
|
-
export { default as Analytics } from "
|
|
4
|
-
export { default as SEO } from "
|
|
5
|
-
export { default as Navbar } from "
|
|
6
|
-
export { default as NavbarSeparator } from "
|
|
7
|
-
export { default as NavbarElement } from "
|
|
8
|
-
export { default as FloatingInput } from "
|
|
9
|
-
export { default as FloatingSelect } from "
|
|
10
|
-
export { default as Text } from "
|
|
11
|
-
export { default as Card } from "
|
|
12
|
-
export {
|
|
13
|
-
export
|
|
1
|
+
export { default as Button } from "../components/Button.svelte";
|
|
2
|
+
export { default as Typewriter } from "../components/Typewriter.svelte";
|
|
3
|
+
export { default as Analytics } from "../components/Analytics.svelte";
|
|
4
|
+
export { default as SEO } from "../components/SEO.svelte";
|
|
5
|
+
export { default as Navbar } from "../components/Navbar.svelte";
|
|
6
|
+
export { default as NavbarSeparator } from "../components/NavbarSeparator.svelte";
|
|
7
|
+
export { default as NavbarElement } from "../components/NavbarElement.svelte";
|
|
8
|
+
export { default as FloatingInput } from "../components/FloatingInput.svelte";
|
|
9
|
+
export { default as FloatingSelect } from "../components/FloatingSelect.svelte";
|
|
10
|
+
export { default as Text } from "../components/Text.svelte";
|
|
11
|
+
export { default as Card } from "../components/Card.svelte";
|
|
12
|
+
export { default as Checkbox } from "../components/Checkbox.svelte";
|
|
13
|
+
export { default as Progress } from "../components/Progress.svelte";
|
|
14
|
+
export { fbmBackground } from "../actions/fbm.ts";
|
|
15
|
+
export type { TypewriterAction, DisplaySegment } from "../types/Typewriter.d.ts";
|
package/dist/index.js
CHANGED
|
@@ -1,12 +1,14 @@
|
|
|
1
|
-
export { default as Button } from "
|
|
2
|
-
export { default as Typewriter } from "
|
|
3
|
-
export { default as Analytics } from "
|
|
4
|
-
export { default as SEO } from "
|
|
5
|
-
export { default as Navbar } from "
|
|
6
|
-
export { default as NavbarSeparator } from "
|
|
7
|
-
export { default as NavbarElement } from "
|
|
8
|
-
export { default as FloatingInput } from "
|
|
9
|
-
export { default as FloatingSelect } from "
|
|
10
|
-
export { default as Text } from "
|
|
11
|
-
export { default as Card } from "
|
|
12
|
-
export {
|
|
1
|
+
export { default as Button } from "../components/Button.svelte";
|
|
2
|
+
export { default as Typewriter } from "../components/Typewriter.svelte";
|
|
3
|
+
export { default as Analytics } from "../components/Analytics.svelte";
|
|
4
|
+
export { default as SEO } from "../components/SEO.svelte";
|
|
5
|
+
export { default as Navbar } from "../components/Navbar.svelte";
|
|
6
|
+
export { default as NavbarSeparator } from "../components/NavbarSeparator.svelte";
|
|
7
|
+
export { default as NavbarElement } from "../components/NavbarElement.svelte";
|
|
8
|
+
export { default as FloatingInput } from "../components/FloatingInput.svelte";
|
|
9
|
+
export { default as FloatingSelect } from "../components/FloatingSelect.svelte";
|
|
10
|
+
export { default as Text } from "../components/Text.svelte";
|
|
11
|
+
export { default as Card } from "../components/Card.svelte";
|
|
12
|
+
export { default as Checkbox } from "../components/Checkbox.svelte";
|
|
13
|
+
export { default as Progress } from "../components/Progress.svelte";
|
|
14
|
+
export { fbmBackground } from "../actions/fbm.js";
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@valerius_petrini/corekit-ui",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.51",
|
|
4
4
|
"description": "Component Library used across all my projects",
|
|
5
5
|
"author": "Valerius Petrini Jr.",
|
|
6
6
|
"license": "MIT",
|
|
@@ -28,8 +28,7 @@
|
|
|
28
28
|
".": {
|
|
29
29
|
"types": "./dist/index.d.ts",
|
|
30
30
|
"svelte": "./dist/index.js"
|
|
31
|
-
}
|
|
32
|
-
"./layout.css": "./dist/styles/layout.css"
|
|
31
|
+
}
|
|
33
32
|
},
|
|
34
33
|
"peerDependencies": {
|
|
35
34
|
"svelte": "^5.0.0"
|
|
@@ -54,6 +53,7 @@
|
|
|
54
53
|
"svelte"
|
|
55
54
|
],
|
|
56
55
|
"dependencies": {
|
|
56
|
+
"@lucide/svelte": "^1.3.0",
|
|
57
57
|
"tailwind-merge": "^3.5.0"
|
|
58
58
|
}
|
|
59
59
|
}
|
package/dist/actions/fbm.d.ts
DELETED
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
export interface FBMBackgroundOptions {
|
|
2
|
-
octaves?: number;
|
|
3
|
-
warps?: number;
|
|
4
|
-
scale?: number;
|
|
5
|
-
seed?: number;
|
|
6
|
-
}
|
|
7
|
-
export declare function fbmBackground(canvas: HTMLCanvasElement, options?: FBMBackgroundOptions): {
|
|
8
|
-
update(newOptions: FBMBackgroundOptions): void;
|
|
9
|
-
destroy(): void;
|
|
10
|
-
} | undefined;
|
package/dist/actions/fbm.js
DELETED
|
@@ -1,199 +0,0 @@
|
|
|
1
|
-
const FBM_VERTEX_SHADER_SOURCE = `
|
|
2
|
-
attribute vec4 aVertexPosition;
|
|
3
|
-
|
|
4
|
-
void main() {
|
|
5
|
-
gl_Position = aVertexPosition;
|
|
6
|
-
}`;
|
|
7
|
-
const FBM_FRAGMENT_SHADER_SOURCE = `
|
|
8
|
-
precision mediump float;
|
|
9
|
-
|
|
10
|
-
uniform vec2 u_resolution;
|
|
11
|
-
uniform float u_seed;
|
|
12
|
-
uniform float u_scale;
|
|
13
|
-
uniform int u_octaves;
|
|
14
|
-
uniform int u_warp;
|
|
15
|
-
|
|
16
|
-
const int maxOctaves = 20;
|
|
17
|
-
const int maxWarps = 5;
|
|
18
|
-
|
|
19
|
-
float rand(vec2 n) {
|
|
20
|
-
return fract(sin(dot(n.xy + u_seed, vec2(12.9898, 78.233))) * 43758.5453);
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
float noise(vec2 p){
|
|
24
|
-
vec2 i = floor(p);
|
|
25
|
-
vec2 f = fract(p);
|
|
26
|
-
|
|
27
|
-
// Four corners in 2D of a tile
|
|
28
|
-
float a = rand(i);
|
|
29
|
-
float b = rand(i + vec2(1.0, 0.0));
|
|
30
|
-
float c = rand(i + vec2(0.0, 1.0));
|
|
31
|
-
float d = rand(i + vec2(1.0, 1.0));
|
|
32
|
-
|
|
33
|
-
vec2 u = f * f * f * (f * (f * 6.0 - 15.0) + 10.0);
|
|
34
|
-
|
|
35
|
-
return mix(a, b, u.x) +
|
|
36
|
-
(c - a)* u.y * (1.0 - u.x) +
|
|
37
|
-
(d - b) * u.x * u.y;
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
float fbm( in vec2 x, in float H ) {
|
|
41
|
-
float v = 00.0000;
|
|
42
|
-
float a = 0.5;
|
|
43
|
-
vec2 shift = vec2(100);
|
|
44
|
-
// Rotate to reduce axial bias
|
|
45
|
-
mat2 rot = mat2(0.877, 0.479, -0.479, 0.877);
|
|
46
|
-
for (int i = 0; i < maxOctaves; ++i) {
|
|
47
|
-
v += a * noise(x);
|
|
48
|
-
x = rot * x * 2.0 + shift;
|
|
49
|
-
a *= 0.5;
|
|
50
|
-
if (i > u_octaves) break;
|
|
51
|
-
}
|
|
52
|
-
return v;
|
|
53
|
-
}
|
|
54
|
-
|
|
55
|
-
void main() {
|
|
56
|
-
vec2 uv = gl_FragCoord.xy / u_resolution.xy;
|
|
57
|
-
uv.x *= u_resolution.x / u_resolution.y;
|
|
58
|
-
|
|
59
|
-
float baseNoise = fbm(uv * u_scale, 1.2);
|
|
60
|
-
|
|
61
|
-
vec2 warp = uv;
|
|
62
|
-
for (int i = 0; i < maxWarps; ++i) {
|
|
63
|
-
warp += vec2(fbm(warp * 2.0, 1.0), fbm(warp * 4.0 + vec2(10.2), 1.0));
|
|
64
|
-
if (i > u_warp) break;
|
|
65
|
-
}
|
|
66
|
-
|
|
67
|
-
baseNoise = fbm(warp * u_scale, 1.2);
|
|
68
|
-
|
|
69
|
-
gl_FragColor = vec4(vec3(baseNoise), 1.0);
|
|
70
|
-
}`;
|
|
71
|
-
function loadShaders(gl, type, source) {
|
|
72
|
-
const shader = gl.createShader(type);
|
|
73
|
-
if (!shader) {
|
|
74
|
-
console.error("Unable to create shader");
|
|
75
|
-
return null;
|
|
76
|
-
}
|
|
77
|
-
gl.shaderSource(shader, source);
|
|
78
|
-
gl.compileShader(shader);
|
|
79
|
-
if (!gl.getShaderParameter(shader, gl.COMPILE_STATUS)) {
|
|
80
|
-
console.error("An error occurred compiling the shaders: " + gl.getShaderInfoLog(shader));
|
|
81
|
-
gl.deleteShader(shader);
|
|
82
|
-
return null;
|
|
83
|
-
}
|
|
84
|
-
return shader;
|
|
85
|
-
}
|
|
86
|
-
function initializeShaders(gl, vertexSource, fragmentSource) {
|
|
87
|
-
const vertexShader = loadShaders(gl, gl.VERTEX_SHADER, vertexSource);
|
|
88
|
-
const fragmentShader = loadShaders(gl, gl.FRAGMENT_SHADER, fragmentSource);
|
|
89
|
-
if (!vertexShader || !fragmentShader)
|
|
90
|
-
return null;
|
|
91
|
-
const shaderProgram = gl.createProgram();
|
|
92
|
-
if (!shaderProgram) {
|
|
93
|
-
console.error("Unable to create shader program");
|
|
94
|
-
return null;
|
|
95
|
-
}
|
|
96
|
-
gl.attachShader(shaderProgram, vertexShader);
|
|
97
|
-
gl.attachShader(shaderProgram, fragmentShader);
|
|
98
|
-
gl.linkProgram(shaderProgram);
|
|
99
|
-
if (!gl.getProgramParameter(shaderProgram, gl.LINK_STATUS)) {
|
|
100
|
-
console.error("Unable to initialize the shader program: " + gl.getProgramInfoLog(shaderProgram));
|
|
101
|
-
return null;
|
|
102
|
-
}
|
|
103
|
-
return shaderProgram;
|
|
104
|
-
}
|
|
105
|
-
function initBuffers(gl) {
|
|
106
|
-
const positionBuffer = gl.createBuffer();
|
|
107
|
-
gl.bindBuffer(gl.ARRAY_BUFFER, positionBuffer);
|
|
108
|
-
const vertices = new Float32Array([
|
|
109
|
-
-1.0, -1.0,
|
|
110
|
-
1.0, -1.0,
|
|
111
|
-
-1.0, 1.0,
|
|
112
|
-
1.0, 1.0,
|
|
113
|
-
]);
|
|
114
|
-
gl.bufferData(gl.ARRAY_BUFFER, vertices, gl.STATIC_DRAW);
|
|
115
|
-
return {
|
|
116
|
-
position: positionBuffer,
|
|
117
|
-
};
|
|
118
|
-
}
|
|
119
|
-
export function fbmBackground(canvas, options = {}) {
|
|
120
|
-
let gl = canvas.getContext("webgl", { antialias: true, premultipliedAlpha: false, preserveDrawingBuffer: true });
|
|
121
|
-
if (!gl) {
|
|
122
|
-
console.error("WebGL not supported");
|
|
123
|
-
return;
|
|
124
|
-
}
|
|
125
|
-
let currentOptions = { ...options };
|
|
126
|
-
let internalSeed = options.seed ?? Math.random() * 1000;
|
|
127
|
-
const shaderProgram = initializeShaders(gl, FBM_VERTEX_SHADER_SOURCE, FBM_FRAGMENT_SHADER_SOURCE);
|
|
128
|
-
if (!shaderProgram) {
|
|
129
|
-
console.error("Failed to initialize shaders");
|
|
130
|
-
return;
|
|
131
|
-
}
|
|
132
|
-
const programInfo = {
|
|
133
|
-
program: shaderProgram,
|
|
134
|
-
attribLocations: {
|
|
135
|
-
vertexPosition: gl.getAttribLocation(shaderProgram, "aVertexPosition"),
|
|
136
|
-
},
|
|
137
|
-
uniformLocations: {
|
|
138
|
-
resolution: gl.getUniformLocation(shaderProgram, "u_resolution"),
|
|
139
|
-
seed: gl.getUniformLocation(shaderProgram, "u_seed"),
|
|
140
|
-
scale: gl.getUniformLocation(shaderProgram, "u_scale"),
|
|
141
|
-
octaves: gl.getUniformLocation(shaderProgram, "u_octaves"),
|
|
142
|
-
warp: gl.getUniformLocation(shaderProgram, "u_warp"),
|
|
143
|
-
}
|
|
144
|
-
};
|
|
145
|
-
const buffers = initBuffers(gl);
|
|
146
|
-
function updateCanvasSize() {
|
|
147
|
-
const DPR = window.devicePixelRatio || 1;
|
|
148
|
-
const newWidth = Math.floor(canvas.offsetWidth * DPR);
|
|
149
|
-
const newHeight = Math.floor(canvas.offsetHeight * DPR);
|
|
150
|
-
if (canvas.width !== newWidth || canvas.height !== newHeight) {
|
|
151
|
-
canvas.width = newWidth;
|
|
152
|
-
canvas.height = newHeight;
|
|
153
|
-
if (gl)
|
|
154
|
-
gl.viewport(0, 0, canvas.width, canvas.height);
|
|
155
|
-
}
|
|
156
|
-
}
|
|
157
|
-
function render() {
|
|
158
|
-
updateCanvasSize();
|
|
159
|
-
if (!gl)
|
|
160
|
-
return;
|
|
161
|
-
gl.viewport(0, 0, canvas.width, canvas.height);
|
|
162
|
-
gl.clearColor(0, 0, 0, 1);
|
|
163
|
-
gl.clearDepth(1.0);
|
|
164
|
-
gl.clear(gl.COLOR_BUFFER_BIT | gl.DEPTH_BUFFER_BIT);
|
|
165
|
-
gl.enable(gl.DEPTH_TEST);
|
|
166
|
-
gl.depthFunc(gl.LEQUAL);
|
|
167
|
-
gl.bindBuffer(gl.ARRAY_BUFFER, buffers.position);
|
|
168
|
-
gl.vertexAttribPointer(programInfo.attribLocations.vertexPosition, 2, gl.FLOAT, false, 0, 0);
|
|
169
|
-
gl.enableVertexAttribArray(programInfo.attribLocations.vertexPosition);
|
|
170
|
-
gl.useProgram(programInfo.program);
|
|
171
|
-
gl.uniform2f(programInfo.uniformLocations.resolution, canvas.width, canvas.height);
|
|
172
|
-
gl.uniform1f(programInfo.uniformLocations.seed, currentOptions.seed ?? internalSeed);
|
|
173
|
-
gl.uniform1i(programInfo.uniformLocations.octaves, currentOptions.octaves ?? 4);
|
|
174
|
-
gl.uniform1i(programInfo.uniformLocations.warp, currentOptions.warps ?? 2);
|
|
175
|
-
gl.uniform1f(programInfo.uniformLocations.scale, currentOptions.scale ?? 2);
|
|
176
|
-
gl.drawArrays(gl.TRIANGLE_STRIP, 0, 4);
|
|
177
|
-
}
|
|
178
|
-
const resizeObserver = new ResizeObserver(() => {
|
|
179
|
-
requestAnimationFrame(render);
|
|
180
|
-
});
|
|
181
|
-
resizeObserver.observe(canvas);
|
|
182
|
-
render();
|
|
183
|
-
return {
|
|
184
|
-
update(newOptions) {
|
|
185
|
-
const changed = JSON.stringify(currentOptions) !== JSON.stringify(newOptions);
|
|
186
|
-
if (changed) {
|
|
187
|
-
currentOptions = { ...newOptions };
|
|
188
|
-
render();
|
|
189
|
-
}
|
|
190
|
-
},
|
|
191
|
-
destroy() {
|
|
192
|
-
resizeObserver.disconnect();
|
|
193
|
-
gl.bindBuffer(gl.ARRAY_BUFFER, null);
|
|
194
|
-
gl.deleteBuffer(buffers.position);
|
|
195
|
-
gl.deleteProgram(shaderProgram);
|
|
196
|
-
gl.getExtension("WEBGL_lose_context")?.loseContext();
|
|
197
|
-
}
|
|
198
|
-
};
|
|
199
|
-
}
|
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
<script lang="ts">
|
|
2
|
-
import { page } from '$app/state'
|
|
3
|
-
import type { AnalyticsProps } from '../types/Analytics.js';
|
|
4
|
-
|
|
5
|
-
let { measurementId }: AnalyticsProps = $props();
|
|
6
|
-
|
|
7
|
-
const ANALYTICS_URL = $derived(`https://www.googletagmanager.com/gtag/js?id=${measurementId}`);
|
|
8
|
-
|
|
9
|
-
$effect(() => {
|
|
10
|
-
if (typeof gtag !== 'undefined') {
|
|
11
|
-
gtag('config', measurementId, {
|
|
12
|
-
page_title: document.title,
|
|
13
|
-
page_path: page.url.pathname,
|
|
14
|
-
})
|
|
15
|
-
}
|
|
16
|
-
})
|
|
17
|
-
</script>
|
|
18
|
-
|
|
19
|
-
<svelte:head>
|
|
20
|
-
{#if measurementId}
|
|
21
|
-
<script async src={ANALYTICS_URL}></script>
|
|
22
|
-
<script>
|
|
23
|
-
window.dataLayer = window.dataLayer || [];
|
|
24
|
-
function gtag() { dataLayer.push(arguments); }
|
|
25
|
-
gtag('js', new Date());
|
|
26
|
-
</script>
|
|
27
|
-
{/if}
|
|
28
|
-
</svelte:head>
|
|
@@ -1,64 +0,0 @@
|
|
|
1
|
-
<script lang="ts">
|
|
2
|
-
import { generateColorStyle } from "../styles/color.js";
|
|
3
|
-
import { sizeStyleParts, type SizeStyle } from "../styles/size.js";
|
|
4
|
-
import type { ButtonProps } from "../types/Button.js";
|
|
5
|
-
import { twMerge } from "tailwind-merge";
|
|
6
|
-
|
|
7
|
-
let {
|
|
8
|
-
children = undefined,
|
|
9
|
-
class: className = "",
|
|
10
|
-
pill = false,
|
|
11
|
-
icon = false,
|
|
12
|
-
href = undefined,
|
|
13
|
-
color = "none",
|
|
14
|
-
variant = "full",
|
|
15
|
-
disabled = false,
|
|
16
|
-
external = false,
|
|
17
|
-
size = "md",
|
|
18
|
-
radius = "md",
|
|
19
|
-
...restProps
|
|
20
|
-
}: ButtonProps = $props();
|
|
21
|
-
|
|
22
|
-
const sizeClasses = $derived.by(() => {
|
|
23
|
-
if (typeof size === "string") {
|
|
24
|
-
const parts = sizeStyleParts[size as SizeStyle];
|
|
25
|
-
return icon ? parts.buttonIcon : parts.button;
|
|
26
|
-
}
|
|
27
|
-
return icon ? "p-0 flex-none" : "h-fit";
|
|
28
|
-
});
|
|
29
|
-
|
|
30
|
-
const customStyle = $derived(
|
|
31
|
-
typeof size === "number"
|
|
32
|
-
? `width: ${size}px; height: ${size}px; flex: none;`
|
|
33
|
-
: ""
|
|
34
|
-
);
|
|
35
|
-
|
|
36
|
-
const defaultClass = "inline-flex items-center justify-center gap-2 transition-colors duration-300 text-white whitespace-nowrap";
|
|
37
|
-
const radiusClass = $derived(pill || icon ? "rounded-full" : sizeStyleParts[radius as SizeStyle].radius);
|
|
38
|
-
const disabledClass = $derived(disabled ? "opacity-50 pointer-events-none" : "cursor-pointer");
|
|
39
|
-
|
|
40
|
-
const mergedClass = $derived(twMerge(
|
|
41
|
-
defaultClass,
|
|
42
|
-
generateColorStyle(color, variant),
|
|
43
|
-
disabledClass,
|
|
44
|
-
sizeClasses,
|
|
45
|
-
radiusClass,
|
|
46
|
-
className
|
|
47
|
-
));
|
|
48
|
-
|
|
49
|
-
const mergedStyle = $derived([customStyle, restProps.style].filter(Boolean).join("; "));
|
|
50
|
-
</script>
|
|
51
|
-
|
|
52
|
-
<svelte:element
|
|
53
|
-
this={href ? "a" : "button"}
|
|
54
|
-
class={mergedClass}
|
|
55
|
-
{disabled}
|
|
56
|
-
aria-disabled={disabled}
|
|
57
|
-
type={href ? undefined : (restProps.type || "button")}
|
|
58
|
-
style={mergedStyle}
|
|
59
|
-
target={external ? "_blank" : undefined}
|
|
60
|
-
rel={external ? "noopener noreferrer" : undefined}
|
|
61
|
-
{...(href ? { href } : {})}
|
|
62
|
-
{...restProps}>
|
|
63
|
-
{@render children?.()}
|
|
64
|
-
</svelte:element>
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
<script lang="ts">
|
|
2
|
-
import type { CardProps } from "../types/Card.js";
|
|
3
|
-
import type { SvelteComponent } from "svelte";
|
|
4
|
-
import { twMerge } from "tailwind-merge";
|
|
5
|
-
|
|
6
|
-
let {
|
|
7
|
-
children = undefined,
|
|
8
|
-
class: className = "",
|
|
9
|
-
href = undefined,
|
|
10
|
-
...restProps
|
|
11
|
-
}: CardProps = $props();
|
|
12
|
-
|
|
13
|
-
let defaultClass = "text-main-text shadow-xl radius-lg transition-colors bg-sub-background hover:bg-sub-background-hover p-4";
|
|
14
|
-
let combinedClass = $derived(twMerge(defaultClass, className));
|
|
15
|
-
</script>
|
|
16
|
-
|
|
17
|
-
<svelte:element
|
|
18
|
-
this={href ? "a" : "div"}
|
|
19
|
-
class={combinedClass}
|
|
20
|
-
{...(href ? { href } : {})}
|
|
21
|
-
{...restProps}
|
|
22
|
-
>
|
|
23
|
-
{@render children?.()}
|
|
24
|
-
</svelte:element>
|
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
<script lang="ts">
|
|
2
|
-
import { twMerge } from "tailwind-merge";
|
|
3
|
-
import Text from "./Text.svelte";
|
|
4
|
-
import type { CheckboxProps } from "../types/Checkbox.js";
|
|
5
|
-
|
|
6
|
-
let {
|
|
7
|
-
children = undefined,
|
|
8
|
-
class: className = "",
|
|
9
|
-
labelClass = "",
|
|
10
|
-
divClass = "",
|
|
11
|
-
checked = $bindable(),
|
|
12
|
-
id = crypto.randomUUID(),
|
|
13
|
-
...restProps
|
|
14
|
-
}: CheckboxProps = $props();
|
|
15
|
-
|
|
16
|
-
let defaultClass = "z-20 bg-form-input-background text-main-text rounded-lg outline-none focus:ring-2 focus:ring-blue-500 transition-all";
|
|
17
|
-
let defaultLabelClass = "block text-sub-text font-medium";
|
|
18
|
-
let defaultDivClass = "relative flex items-center gap-2";
|
|
19
|
-
|
|
20
|
-
let combinedLabelClass = $derived(twMerge(defaultLabelClass, labelClass));
|
|
21
|
-
let combinedClass = $derived(twMerge(defaultClass, className));
|
|
22
|
-
let combinedDivClass = $derived(twMerge(defaultDivClass, divClass));
|
|
23
|
-
</script>
|
|
24
|
-
|
|
25
|
-
<div class={combinedDivClass}>
|
|
26
|
-
<input
|
|
27
|
-
type="checkbox"
|
|
28
|
-
id={id}
|
|
29
|
-
bind:checked={checked}
|
|
30
|
-
class={combinedClass}
|
|
31
|
-
{...restProps}/>
|
|
32
|
-
<Text tag="label" for={id} class={combinedLabelClass}>
|
|
33
|
-
{@render children?.()}
|
|
34
|
-
</Text>
|
|
35
|
-
</div>
|
|
@@ -1,78 +0,0 @@
|
|
|
1
|
-
<script lang="ts">
|
|
2
|
-
import type { FloatingInputProps } from "../types/FloatingInput.js";
|
|
3
|
-
import { twMerge } from "tailwind-merge";
|
|
4
|
-
import Text from "./Text.svelte";
|
|
5
|
-
|
|
6
|
-
let {
|
|
7
|
-
children = undefined,
|
|
8
|
-
class: className = "",
|
|
9
|
-
labelClass = "",
|
|
10
|
-
divClass = "",
|
|
11
|
-
value = $bindable(),
|
|
12
|
-
onfocus = undefined,
|
|
13
|
-
onblur = undefined,
|
|
14
|
-
isTextArea = false,
|
|
15
|
-
validInputRegex = undefined,
|
|
16
|
-
id = crypto.randomUUID(),
|
|
17
|
-
...restProps
|
|
18
|
-
}: FloatingInputProps = $props();
|
|
19
|
-
|
|
20
|
-
let isFocused = $state(false);
|
|
21
|
-
let touched = $state(false);
|
|
22
|
-
|
|
23
|
-
let hasContent = $derived(value !== undefined && value !== null && value.toString().length > 0);
|
|
24
|
-
let isValid = $derived(!touched || !validInputRegex || validInputRegex.test(value || ""));
|
|
25
|
-
|
|
26
|
-
let defaultClass = "z-20 bg-form-input-background text-main-text w-full rounded px-2 pt-4 pb-1 text-xs outline-none focus:ring-2 focus:ring-blue-500 transition-all";
|
|
27
|
-
let defaultLabelClass = "block text-sub-text rounded-md text-sm font-medium mb-1 absolute transition-all duration-100 pointer-events-none";
|
|
28
|
-
let defaultDivClass = "relative";
|
|
29
|
-
|
|
30
|
-
let originalLabelClass = "left-2 z-0";
|
|
31
|
-
let originalLabelClassInput = "top-1/2 transform -translate-y-1/2";
|
|
32
|
-
let originalLabelClassTextArea = "top-2";
|
|
33
|
-
let selectedLabelClass = "left-2 z-30 top-0.5 text-[10px]!";
|
|
34
|
-
|
|
35
|
-
let invalidClass = "border border-red-500 focus:ring-red-500";
|
|
36
|
-
|
|
37
|
-
let labelClassFull = $derived(twMerge(isTextArea ? originalLabelClassTextArea : originalLabelClassInput, originalLabelClass));
|
|
38
|
-
|
|
39
|
-
let combinedLabelClass = $derived(twMerge(defaultLabelClass, isFocused || hasContent ? selectedLabelClass : labelClassFull, labelClass));
|
|
40
|
-
let combinedClass = $derived(twMerge(defaultClass, className, isValid ? "" : invalidClass));
|
|
41
|
-
let combinedDivClass = $derived(twMerge(defaultDivClass, divClass));
|
|
42
|
-
|
|
43
|
-
function handleFocus(e: FocusEvent) {
|
|
44
|
-
isFocused = true;
|
|
45
|
-
onfocus?.(e);
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
function handleBlur(e: FocusEvent) {
|
|
49
|
-
isFocused = false;
|
|
50
|
-
touched = true;
|
|
51
|
-
onblur?.(e);
|
|
52
|
-
}
|
|
53
|
-
</script>
|
|
54
|
-
|
|
55
|
-
<div class={combinedDivClass}>
|
|
56
|
-
<Text tag="label" for={id} class={combinedLabelClass}>
|
|
57
|
-
{@render children?.()}
|
|
58
|
-
</Text>
|
|
59
|
-
{#if isTextArea}
|
|
60
|
-
<textarea
|
|
61
|
-
{id}
|
|
62
|
-
bind:value={value}
|
|
63
|
-
onfocus={handleFocus}
|
|
64
|
-
onblur={handleBlur}
|
|
65
|
-
class={combinedClass}
|
|
66
|
-
{...restProps}
|
|
67
|
-
></textarea>
|
|
68
|
-
{:else}
|
|
69
|
-
<input
|
|
70
|
-
{id}
|
|
71
|
-
bind:value={value}
|
|
72
|
-
onfocus={handleFocus}
|
|
73
|
-
onblur={handleBlur}
|
|
74
|
-
class={combinedClass}
|
|
75
|
-
{...restProps}
|
|
76
|
-
/>
|
|
77
|
-
{/if}
|
|
78
|
-
</div>
|
|
@@ -1,39 +0,0 @@
|
|
|
1
|
-
<script lang="ts">
|
|
2
|
-
import type { FloatingSelectProps } from "../types/FloatingSelect.js";
|
|
3
|
-
import { twMerge } from "tailwind-merge";
|
|
4
|
-
import Text from "./Text.svelte";
|
|
5
|
-
|
|
6
|
-
let {
|
|
7
|
-
children = undefined,
|
|
8
|
-
class: className = "",
|
|
9
|
-
divClass = "",
|
|
10
|
-
optionClass = "",
|
|
11
|
-
value = $bindable(),
|
|
12
|
-
options = [],
|
|
13
|
-
id = crypto.randomUUID(),
|
|
14
|
-
...restProps
|
|
15
|
-
}: FloatingSelectProps = $props();
|
|
16
|
-
|
|
17
|
-
let defaultSelectClass = "cursor-pointer bg-form-input-background text-main-text z-20 w-full rounded px-1 pt-4 pb-1 text-xs outline-none focus:ring-2 focus:ring-blue-500 transition-all";
|
|
18
|
-
let defaultLabelClass = "block text-sub-text rounded-md text-sm font-medium mb-1 absolute transition-all duration-100 pointer-events-none";
|
|
19
|
-
let defaultDivClass = "relative w-fit";
|
|
20
|
-
|
|
21
|
-
let selectedLabelClass = "left-2 z-30 top-0.5 text-[10px]!";
|
|
22
|
-
|
|
23
|
-
let combinedLabelClass = $derived(twMerge(defaultLabelClass, selectedLabelClass, className));
|
|
24
|
-
let combinedSelectClass = $derived(twMerge(defaultSelectClass, className));
|
|
25
|
-
let combinedDivClass = $derived(twMerge(defaultDivClass, divClass));
|
|
26
|
-
</script>
|
|
27
|
-
|
|
28
|
-
<div class={combinedDivClass}>
|
|
29
|
-
<Text tag="label" for={id} class={combinedLabelClass}>
|
|
30
|
-
{@render children?.()}
|
|
31
|
-
</Text>
|
|
32
|
-
<select {id} class={combinedSelectClass} {...restProps} bind:value={value}>
|
|
33
|
-
{#each options as option}
|
|
34
|
-
<option value={option.value} class={optionClass}>
|
|
35
|
-
{option.label}
|
|
36
|
-
</option>
|
|
37
|
-
{/each}
|
|
38
|
-
</select>
|
|
39
|
-
</div>
|
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
<script lang="ts">
|
|
2
|
-
import type { NavbarProps } from "../types/Navbar.js";
|
|
3
|
-
import { onMount } from "svelte";
|
|
4
|
-
import { twMerge } from "tailwind-merge";
|
|
5
|
-
|
|
6
|
-
let {
|
|
7
|
-
children = undefined,
|
|
8
|
-
class: className = "",
|
|
9
|
-
classTop = "",
|
|
10
|
-
...restProps
|
|
11
|
-
}: NavbarProps = $props();
|
|
12
|
-
|
|
13
|
-
let defaultClass = "box-border transition-colors duration-300 fixed top-0 left-0 w-full h-14 z-[100] flex items-center bg-main-background/99 border-b-sub-background border-b";
|
|
14
|
-
|
|
15
|
-
let scrollY = $state(0);
|
|
16
|
-
|
|
17
|
-
let combinedClass = $derived(scrollY === 0
|
|
18
|
-
? twMerge(defaultClass, className, classTop)
|
|
19
|
-
: twMerge(defaultClass, className));
|
|
20
|
-
|
|
21
|
-
function onScroll() {
|
|
22
|
-
scrollY = window.scrollY;
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
onMount(() => {
|
|
26
|
-
window.addEventListener('scroll', onScroll);
|
|
27
|
-
onScroll();
|
|
28
|
-
|
|
29
|
-
return () => {
|
|
30
|
-
window.removeEventListener('scroll', onScroll);
|
|
31
|
-
};
|
|
32
|
-
});
|
|
33
|
-
</script>
|
|
34
|
-
|
|
35
|
-
<nav class={combinedClass} {...restProps}>
|
|
36
|
-
{@render children?.()}
|
|
37
|
-
</nav>
|
|
@@ -1,39 +0,0 @@
|
|
|
1
|
-
<script lang="ts">
|
|
2
|
-
import { twMerge } from "tailwind-merge";
|
|
3
|
-
import Button from "./Button.svelte";
|
|
4
|
-
import { onMount } from "svelte";
|
|
5
|
-
import type { NavbarElementProps } from "../types/Navbar.js";
|
|
6
|
-
|
|
7
|
-
let {
|
|
8
|
-
children = undefined,
|
|
9
|
-
class: className = "",
|
|
10
|
-
classTop = "",
|
|
11
|
-
href = undefined,
|
|
12
|
-
...restProps
|
|
13
|
-
}: NavbarElementProps = $props();
|
|
14
|
-
|
|
15
|
-
let defaultClass = "navbar-element w-fit h-full px-5 py-0 text-main-text hover:bg-navbar-element-hover-background";
|
|
16
|
-
|
|
17
|
-
let scrollY = $state(0);
|
|
18
|
-
|
|
19
|
-
let combinedClass = $derived(scrollY === 0
|
|
20
|
-
? twMerge(defaultClass, className, classTop)
|
|
21
|
-
: twMerge(defaultClass, className));
|
|
22
|
-
|
|
23
|
-
function onScroll() {
|
|
24
|
-
scrollY = window.scrollY;
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
onMount(() => {
|
|
28
|
-
window.addEventListener('scroll', onScroll);
|
|
29
|
-
onScroll();
|
|
30
|
-
|
|
31
|
-
return () => {
|
|
32
|
-
window.removeEventListener('scroll', onScroll);
|
|
33
|
-
};
|
|
34
|
-
});
|
|
35
|
-
</script>
|
|
36
|
-
|
|
37
|
-
<Button radius={0} {href} class={combinedClass} {...restProps}>
|
|
38
|
-
{@render children?.()}
|
|
39
|
-
</Button>
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
<div class="ml-auto"></div>
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
export default NavbarSeparator;
|
|
2
|
-
type NavbarSeparator = SvelteComponent<{
|
|
3
|
-
[x: string]: never;
|
|
4
|
-
}, {
|
|
5
|
-
[evt: string]: CustomEvent<any>;
|
|
6
|
-
}, {}> & {
|
|
7
|
-
$$bindings?: string | undefined;
|
|
8
|
-
};
|
|
9
|
-
declare const NavbarSeparator: $$__sveltets_2_IsomorphicComponent<{
|
|
10
|
-
[x: string]: never;
|
|
11
|
-
}, {
|
|
12
|
-
[evt: string]: CustomEvent<any>;
|
|
13
|
-
}, {}, {}, string>;
|
|
14
|
-
interface $$__sveltets_2_IsomorphicComponent<Props extends Record<string, any> = any, Events extends Record<string, any> = any, Slots extends Record<string, any> = any, Exports = {}, Bindings = string> {
|
|
15
|
-
new (options: import("svelte").ComponentConstructorOptions<Props>): import("svelte").SvelteComponent<Props, Events, Slots> & {
|
|
16
|
-
$$bindings?: Bindings;
|
|
17
|
-
} & Exports;
|
|
18
|
-
(internal: unknown, props: {
|
|
19
|
-
$$events?: Events;
|
|
20
|
-
$$slots?: Slots;
|
|
21
|
-
}): Exports & {
|
|
22
|
-
$set?: any;
|
|
23
|
-
$on?: any;
|
|
24
|
-
};
|
|
25
|
-
z_$$bindings?: Bindings;
|
|
26
|
-
}
|
|
@@ -1,43 +0,0 @@
|
|
|
1
|
-
<script lang="ts">
|
|
2
|
-
import { page } from '$app/state';
|
|
3
|
-
import type { SEOProps } from '../types/SEO.js';
|
|
4
|
-
|
|
5
|
-
const DEFAULT_TITLE = "My SvelteKit App";
|
|
6
|
-
const DEFAULT_DESCRIPTION = "Description of your website.";
|
|
7
|
-
const DEFAULT_IMAGE = "/favicon.png";
|
|
8
|
-
|
|
9
|
-
let {
|
|
10
|
-
websiteName,
|
|
11
|
-
title = DEFAULT_TITLE,
|
|
12
|
-
description = DEFAULT_DESCRIPTION,
|
|
13
|
-
image = DEFAULT_IMAGE
|
|
14
|
-
}: SEOProps = $props();
|
|
15
|
-
|
|
16
|
-
let fullUrl = $derived(`${websiteName}${page.url.pathname.toString()}`);
|
|
17
|
-
</script>
|
|
18
|
-
|
|
19
|
-
<svelte:head>
|
|
20
|
-
<title>{title}</title>
|
|
21
|
-
<meta name="description" content={description}>
|
|
22
|
-
<meta property="og_site_name" content={websiteName}>
|
|
23
|
-
<meta property="og:url" content={fullUrl}>
|
|
24
|
-
<meta property="og:type" content="website">
|
|
25
|
-
<meta property="og:title" content="{title}">
|
|
26
|
-
<meta property="og:description" content={description}>
|
|
27
|
-
<meta property="og:image" content={websiteName + image}>
|
|
28
|
-
|
|
29
|
-
<meta name="twitter:card" content="summary_large_image">
|
|
30
|
-
<meta property="twitter:domain" content={websiteName}>
|
|
31
|
-
<meta property="twitter:url" content={fullUrl}>
|
|
32
|
-
<meta name="twitter:title" content="{title}">
|
|
33
|
-
<meta name="twitter:description" content={description}>
|
|
34
|
-
<meta name="twitter:image" content={websiteName + image}>
|
|
35
|
-
{@html ` <script type="application/ld+json">{
|
|
36
|
-
"@context": "https://schema.org",
|
|
37
|
-
"@type": "Website",
|
|
38
|
-
"name": "${title}",
|
|
39
|
-
"url": "${fullUrl}",
|
|
40
|
-
"logo": "${websiteName}${image}" }</script>`}
|
|
41
|
-
|
|
42
|
-
<meta name="google-site-verification" content="F6vDzwDyZfebc9kWIZlhzpsAm5zhanaPkOArdCZdDSU" />
|
|
43
|
-
</svelte:head>
|
|
@@ -1,39 +0,0 @@
|
|
|
1
|
-
<script lang="ts">
|
|
2
|
-
import type { TextProps } from "../types/Text.js";
|
|
3
|
-
import { twMerge } from "tailwind-merge";
|
|
4
|
-
|
|
5
|
-
let {
|
|
6
|
-
children = undefined,
|
|
7
|
-
class: className = "",
|
|
8
|
-
tag = "p",
|
|
9
|
-
...restProps
|
|
10
|
-
}: TextProps = $props();
|
|
11
|
-
|
|
12
|
-
const tagStyles = {
|
|
13
|
-
"p": "text-base",
|
|
14
|
-
"div": "text-base",
|
|
15
|
-
"span": "text-base",
|
|
16
|
-
"label": "text-sm",
|
|
17
|
-
"strong": "text-base font-bold",
|
|
18
|
-
"em": "text-base italic",
|
|
19
|
-
"small": "text-sm",
|
|
20
|
-
"blockquote": "border-l-4 border-gray-500 pl-2 opacity-70",
|
|
21
|
-
"pre": "font-mono bg-sub-background px-3 py-2 radius overflow-x-auto whitespace-pre",
|
|
22
|
-
"code": "font-mono bg-sub-background px-3 py-2 radius inline-block",
|
|
23
|
-
"a": "text-blue-400 hover:text-blue-500 hover:underline",
|
|
24
|
-
"li": "text-base list-disc list-inside",
|
|
25
|
-
"h1": "text-6xl font-extrabold",
|
|
26
|
-
"h2": "text-5xl font-bold",
|
|
27
|
-
"h3": "text-4xl font-semibold",
|
|
28
|
-
"h4": "text-3xl font-medium",
|
|
29
|
-
"h5": "text-2xl font-medium",
|
|
30
|
-
"h6": "text-xl font-medium"
|
|
31
|
-
};
|
|
32
|
-
|
|
33
|
-
let defaultClass = "text-main-text";
|
|
34
|
-
let combinedClass = $derived(twMerge(defaultClass, tagStyles[tag] || "", className));
|
|
35
|
-
</script>
|
|
36
|
-
|
|
37
|
-
<svelte:element this={tag} class={combinedClass} {...restProps}>
|
|
38
|
-
{@render children?.()}
|
|
39
|
-
</svelte:element>
|
|
@@ -1,86 +0,0 @@
|
|
|
1
|
-
<script lang="ts">
|
|
2
|
-
import { twMerge } from "tailwind-merge";
|
|
3
|
-
import { onMount } from "svelte";
|
|
4
|
-
|
|
5
|
-
import type { DisplaySegment, TypewriterProps } from "../types/Typewriter.d.js";
|
|
6
|
-
import Text from "./Text.svelte";
|
|
7
|
-
|
|
8
|
-
let {
|
|
9
|
-
actions,
|
|
10
|
-
class: className = "",
|
|
11
|
-
textClass = "",
|
|
12
|
-
...restProps
|
|
13
|
-
}: TypewriterProps = $props();
|
|
14
|
-
|
|
15
|
-
let displaySegments = $state<DisplaySegment[]>([]);
|
|
16
|
-
|
|
17
|
-
async function execute() {
|
|
18
|
-
for (let i = 0; i < actions.length; i++) {
|
|
19
|
-
const action = actions[i];
|
|
20
|
-
switch (action.type) {
|
|
21
|
-
case "write":
|
|
22
|
-
const segment = { text: "", color: "", label: action.label };
|
|
23
|
-
displaySegments.push(segment);
|
|
24
|
-
|
|
25
|
-
const segmentProxy = displaySegments[displaySegments.length - 1];
|
|
26
|
-
|
|
27
|
-
const resolvedValue = typeof action.value === "function" ? action.value() : action.value;
|
|
28
|
-
const resolvedColor = typeof action.color === "function" ? action.color() : action.color;
|
|
29
|
-
segmentProxy.color = resolvedColor;
|
|
30
|
-
for (const char of resolvedValue) {
|
|
31
|
-
segmentProxy.text += char;
|
|
32
|
-
const speed = Math.random() * ((action.maxspeed || 100) - (action.minspeed || 50)) + (action.minspeed || 50);
|
|
33
|
-
await new Promise(resolve => setTimeout(resolve, speed));
|
|
34
|
-
}
|
|
35
|
-
break;
|
|
36
|
-
case "delete":
|
|
37
|
-
const index = displaySegments.findIndex(s => s.label === action.to);
|
|
38
|
-
if (index === -1) break;
|
|
39
|
-
for (let j = displaySegments.length - 1; j >= index; j--) {
|
|
40
|
-
const deleteSegment = displaySegments[j];
|
|
41
|
-
while (deleteSegment.text.length > 0) {
|
|
42
|
-
deleteSegment.text = deleteSegment.text.slice(0, -1);
|
|
43
|
-
const speed = Math.random() * ((action.maxspeed || 100) - (action.minspeed || 50)) + (action.minspeed || 50);
|
|
44
|
-
await new Promise(resolve => setTimeout(resolve, speed));
|
|
45
|
-
}
|
|
46
|
-
}
|
|
47
|
-
displaySegments.splice(index, 1);
|
|
48
|
-
break;
|
|
49
|
-
case "pause":
|
|
50
|
-
await new Promise(resolve => setTimeout(resolve, action.duration || 1000));
|
|
51
|
-
break;
|
|
52
|
-
case "jump":
|
|
53
|
-
const position = actions.findIndex(a => a.label === action.position);
|
|
54
|
-
if (position !== -1)
|
|
55
|
-
i = position - 1;
|
|
56
|
-
break;
|
|
57
|
-
}
|
|
58
|
-
}
|
|
59
|
-
}
|
|
60
|
-
|
|
61
|
-
onMount(() => {
|
|
62
|
-
execute();
|
|
63
|
-
});
|
|
64
|
-
|
|
65
|
-
let combinedClass = $derived(twMerge("typewriter w-fit text-main-text", className));
|
|
66
|
-
</script>
|
|
67
|
-
|
|
68
|
-
<div class={combinedClass} {...restProps}>
|
|
69
|
-
{#each displaySegments as segment}
|
|
70
|
-
{#key segment}
|
|
71
|
-
<Text tag="span" class={textClass} style="color: {segment.color}">{segment.text}</Text>
|
|
72
|
-
{/key}
|
|
73
|
-
{/each}
|
|
74
|
-
</div>
|
|
75
|
-
|
|
76
|
-
<style>
|
|
77
|
-
.typewriter::after {
|
|
78
|
-
content: "\00a0";
|
|
79
|
-
animation: blink .7s step-start infinite;
|
|
80
|
-
text-decoration: underline;
|
|
81
|
-
}
|
|
82
|
-
|
|
83
|
-
@keyframes blink {
|
|
84
|
-
50% { opacity: 0; }
|
|
85
|
-
}
|
|
86
|
-
</style>
|
package/dist/styles/color.d.ts
DELETED
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
export type ColorStyle = "red" | "yellow" | "lightgreen" | "blue" | "pink" | "purple" | "gray" | "sub" | "none";
|
|
2
|
-
export type ColorStyleType = "full" | "light" | "outline" | "ghost";
|
|
3
|
-
export declare const colorStyleParts: Record<ColorStyle, Record<ColorStyleType, string>>;
|
|
4
|
-
export declare function generateColorStyle(color: ColorStyle, variant: ColorStyleType): string;
|
package/dist/styles/color.js
DELETED
|
@@ -1,62 +0,0 @@
|
|
|
1
|
-
export const colorStyleParts = {
|
|
2
|
-
red: {
|
|
3
|
-
full: "bg-red-500 hover:bg-red-600",
|
|
4
|
-
light: "bg-red-500/35 hover:bg-red-600/35 text-white/60",
|
|
5
|
-
outline: "border border-red-500 hover:border-red-600 text-red-500 hover:text-red-600 hover:bg-red-500/10",
|
|
6
|
-
ghost: "hover:bg-red-500"
|
|
7
|
-
},
|
|
8
|
-
yellow: {
|
|
9
|
-
full: "bg-yellow-500 hover:bg-yellow-600",
|
|
10
|
-
light: "bg-yellow-500/35 hover:bg-yellow-600/35 text-white/60",
|
|
11
|
-
outline: "border border-yellow-500 hover:border-yellow-600 text-yellow-500 hover:text-yellow-600 hover:bg-yellow-500/10",
|
|
12
|
-
ghost: "hover:bg-yellow-500"
|
|
13
|
-
},
|
|
14
|
-
lightgreen: {
|
|
15
|
-
full: "bg-green-500 hover:bg-green-600",
|
|
16
|
-
light: "bg-green-500/35 hover:bg-green-600/35 text-white/60",
|
|
17
|
-
outline: "border border-green-500 hover:border-green-600 text-green-500 hover:text-green-600 hover:bg-green-500/10",
|
|
18
|
-
ghost: "hover:bg-green-500"
|
|
19
|
-
},
|
|
20
|
-
blue: {
|
|
21
|
-
full: "bg-blue-500 hover:bg-blue-600",
|
|
22
|
-
light: "bg-blue-500/35 hover:bg-blue-600/35 text-white/60",
|
|
23
|
-
outline: "border border-blue-500 hover:border-blue-600 text-blue-500 hover:text-blue-600 hover:bg-blue-500/10",
|
|
24
|
-
ghost: "hover:bg-blue-500"
|
|
25
|
-
},
|
|
26
|
-
pink: {
|
|
27
|
-
full: "bg-pink-500 hover:bg-pink-600",
|
|
28
|
-
light: "bg-pink-500/35 hover:bg-pink-600/35 text-white/60",
|
|
29
|
-
outline: "border border-pink-500 hover:border-pink-600 text-pink-500 hover:text-pink-600 hover:bg-pink-500/10",
|
|
30
|
-
ghost: "hover:bg-pink-500"
|
|
31
|
-
},
|
|
32
|
-
purple: {
|
|
33
|
-
full: "bg-purple-500 hover:bg-purple-600",
|
|
34
|
-
light: "bg-purple-500/35 hover:bg-purple-600/35 text-white/60",
|
|
35
|
-
outline: "border border-purple-500 hover:border-purple-600 text-purple-500 hover:text-purple-600 hover:bg-purple-500/10",
|
|
36
|
-
ghost: "hover:bg-purple-500"
|
|
37
|
-
},
|
|
38
|
-
gray: {
|
|
39
|
-
full: "bg-gray-500 hover:bg-gray-600",
|
|
40
|
-
light: "bg-gray-500/35 hover:bg-gray-600/35 text-white/60",
|
|
41
|
-
outline: "border border-gray-500 hover:border-gray-600 text-gray-500 hover:text-gray-600 hover:bg-gray-500/10",
|
|
42
|
-
ghost: "hover:bg-gray-500"
|
|
43
|
-
},
|
|
44
|
-
sub: {
|
|
45
|
-
full: "bg-sub-background hover:bg-sub-background-hover",
|
|
46
|
-
light: "bg-sub-background hover:bg-sub-background-hover text-white/60",
|
|
47
|
-
outline: "border border-sub-background hover:border-sub-background-hover text-sub-background hover:text-sub-background-hover hover:bg-sub-background/10",
|
|
48
|
-
ghost: "hover:bg-sub-background"
|
|
49
|
-
},
|
|
50
|
-
none: {
|
|
51
|
-
full: "",
|
|
52
|
-
light: "",
|
|
53
|
-
outline: "",
|
|
54
|
-
ghost: ""
|
|
55
|
-
}
|
|
56
|
-
};
|
|
57
|
-
export function generateColorStyle(color, variant) {
|
|
58
|
-
const styles = colorStyleParts[color];
|
|
59
|
-
if (!styles)
|
|
60
|
-
return "";
|
|
61
|
-
return styles[variant] || "";
|
|
62
|
-
}
|
package/dist/styles/layout.css
DELETED
|
@@ -1,44 +0,0 @@
|
|
|
1
|
-
@import 'tailwindcss';
|
|
2
|
-
|
|
3
|
-
@utility flex-center {
|
|
4
|
-
@apply flex items-center justify-center;
|
|
5
|
-
}
|
|
6
|
-
|
|
7
|
-
@custom-variant dark (&:where(.dark, .dark *));
|
|
8
|
-
|
|
9
|
-
@theme {
|
|
10
|
-
--color-main-background: var(--vpcui-color-main-background);
|
|
11
|
-
--color-sub-background: var(--vpcui-color-sub-background);
|
|
12
|
-
--color-sub-background-hover: var(--vpcui-color-sub-background-hover);
|
|
13
|
-
--color-main-text: var(--vpcui-color-main-text);
|
|
14
|
-
--color-sub-text: var(--vpcui-color-sub-text);
|
|
15
|
-
--color-form-input-background: var(--vpcui-color-form-input-background);
|
|
16
|
-
--color-form-input-hover: var(--vpcui-color-form-input-hover);
|
|
17
|
-
--color-navbar-element-hover-background: var(--vpcui-color-navbar-element-hover-background);
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
:root {
|
|
21
|
-
--vpcui-color-main-background: var(--color-mist-50);
|
|
22
|
-
--vpcui-color-sub-background: var(--color-mist-300);
|
|
23
|
-
--vpcui-color-sub-background-hover: var(--color-mist-400);
|
|
24
|
-
--vpcui-color-main-text: #000;
|
|
25
|
-
--vpcui-color-sub-text: #555;
|
|
26
|
-
--vpcui-color-form-input-background: var(--color-mist-100);
|
|
27
|
-
--vpcui-color-form-input-hover: var(--color-mist-200);
|
|
28
|
-
--vpcui-color-navbar-element-hover-background: var(--color-mist-100);
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
html.dark {
|
|
32
|
-
--vpcui-color-main-background: #121212;
|
|
33
|
-
--vpcui-color-sub-background: #1c1c1c;
|
|
34
|
-
--vpcui-color-sub-background-hover: #242424;
|
|
35
|
-
--vpcui-color-main-text: #fff;
|
|
36
|
-
--vpcui-color-sub-text: #aaa;
|
|
37
|
-
--vpcui-color-form-input-background: #1c1c1c;
|
|
38
|
-
--vpcui-color-form-input-hover: #2c2c2c;
|
|
39
|
-
--vpcui-color-navbar-element-hover-background: var(--color-zinc-900);
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
html {
|
|
43
|
-
background-color: var(--color-main-background);
|
|
44
|
-
}
|
package/dist/styles/size.d.ts
DELETED
package/dist/styles/size.js
DELETED
|
@@ -1,57 +0,0 @@
|
|
|
1
|
-
export const sizeStyleParts = {
|
|
2
|
-
xs: {
|
|
3
|
-
button: "text-xs h-4 px-1 py-0.5",
|
|
4
|
-
buttonIcon: "text-xs h-4 w-4 p-0.5",
|
|
5
|
-
radius: "rounded-xs"
|
|
6
|
-
},
|
|
7
|
-
sm: {
|
|
8
|
-
button: "text-sm h-6 px-2 py-1",
|
|
9
|
-
buttonIcon: "text-sm h-6 w-6 p-1",
|
|
10
|
-
radius: "rounded-sm"
|
|
11
|
-
},
|
|
12
|
-
md: {
|
|
13
|
-
button: "text-base h-8 px-3 py-1.5",
|
|
14
|
-
buttonIcon: "text-base h-8 w-8 p-1.5",
|
|
15
|
-
radius: "rounded-md"
|
|
16
|
-
},
|
|
17
|
-
lg: {
|
|
18
|
-
button: "text-lg h-10 px-4 py-2",
|
|
19
|
-
buttonIcon: "text-lg h-10 w-10 p-2",
|
|
20
|
-
radius: "rounded-lg"
|
|
21
|
-
},
|
|
22
|
-
xl: {
|
|
23
|
-
button: "text-xl h-12 px-5 py-2.5",
|
|
24
|
-
buttonIcon: "text-xl h-12 w-12 p-2.5",
|
|
25
|
-
radius: "rounded-xl"
|
|
26
|
-
},
|
|
27
|
-
"2xl": {
|
|
28
|
-
button: "text-2xl h-14 px-6 py-3",
|
|
29
|
-
buttonIcon: "text-2xl h-14 w-14 p-3",
|
|
30
|
-
radius: "rounded-2xl"
|
|
31
|
-
},
|
|
32
|
-
"3xl": {
|
|
33
|
-
button: "text-3xl h-16 px-7 py-3.5",
|
|
34
|
-
buttonIcon: "text-3xl h-16 w-16 p-3.5",
|
|
35
|
-
radius: "rounded-3xl"
|
|
36
|
-
},
|
|
37
|
-
"4xl": {
|
|
38
|
-
button: "text-4xl h-18 px-8 py-4",
|
|
39
|
-
buttonIcon: "text-4xl h-18 w-18 p-4",
|
|
40
|
-
radius: "rounded-4xl"
|
|
41
|
-
},
|
|
42
|
-
full: {
|
|
43
|
-
button: "w-full text-base h-8 px-3 py-1",
|
|
44
|
-
buttonIcon: "w-full aspect-square text-base p-1",
|
|
45
|
-
radius: "rounded-full"
|
|
46
|
-
},
|
|
47
|
-
none: {
|
|
48
|
-
button: "",
|
|
49
|
-
buttonIcon: "",
|
|
50
|
-
radius: "rounded-none"
|
|
51
|
-
},
|
|
52
|
-
0: {
|
|
53
|
-
button: "",
|
|
54
|
-
buttonIcon: "",
|
|
55
|
-
radius: "rounded-none"
|
|
56
|
-
}
|
|
57
|
-
};
|
package/dist/types/Button.d.ts
DELETED
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import type { ColorStyle, ColorStyleType } from "../styles/color.ts";
|
|
2
|
-
import type { SizeStyle } from "../styles/size.ts";
|
|
3
|
-
|
|
4
|
-
export interface ButtonProps {
|
|
5
|
-
children?: any;
|
|
6
|
-
class?: string;
|
|
7
|
-
pill?: boolean;
|
|
8
|
-
icon?: boolean;
|
|
9
|
-
href?: string;
|
|
10
|
-
color?: ColorStyle;
|
|
11
|
-
variant?: ColorStyleType;
|
|
12
|
-
disabled?: boolean;
|
|
13
|
-
external?: boolean;
|
|
14
|
-
size?: SizeStyle;
|
|
15
|
-
radius?: SizeStyle;
|
|
16
|
-
[key: string]: any;
|
|
17
|
-
}
|
package/dist/types/Card.d.ts
DELETED
package/dist/types/Checkbox.d.ts
DELETED
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
export interface FloatingInputProps {
|
|
2
|
-
children?: any;
|
|
3
|
-
class?: string;
|
|
4
|
-
labelClass?: string;
|
|
5
|
-
divClass?: string;
|
|
6
|
-
value?: string;
|
|
7
|
-
isTextArea?: boolean;
|
|
8
|
-
onfocus?: (e?: FocusEvent) => void;
|
|
9
|
-
onblur?: (e?: FocusEvent) => void;
|
|
10
|
-
validInputRegex?: RegExp;
|
|
11
|
-
id?: `${string}-${string}-${string}-${string}-${string}`;
|
|
12
|
-
[key: string]: any;
|
|
13
|
-
};
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
export interface FloatingSelectProps {
|
|
2
|
-
children?: any;
|
|
3
|
-
class?: string;
|
|
4
|
-
divClass?: string;
|
|
5
|
-
optionClass?: string;
|
|
6
|
-
value?: any;
|
|
7
|
-
options: { value: any; label: string }[];
|
|
8
|
-
id?: `${string}-${string}-${string}-${string}-${string}`;
|
|
9
|
-
[key: string]: any;
|
|
10
|
-
};
|
package/dist/types/Navbar.d.ts
DELETED
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
export interface NavbarProps {
|
|
2
|
-
children?: any;
|
|
3
|
-
class?: string;
|
|
4
|
-
classTop?: string;
|
|
5
|
-
[key: string]: any;
|
|
6
|
-
};
|
|
7
|
-
|
|
8
|
-
export interface NavbarElementProps {
|
|
9
|
-
children?: any;
|
|
10
|
-
class?: string;
|
|
11
|
-
classTop?: string;
|
|
12
|
-
href?: string;
|
|
13
|
-
[key: string]: any;
|
|
14
|
-
}
|
package/dist/types/SEO.d.ts
DELETED
package/dist/types/Text.d.ts
DELETED
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
type TextTagOptions = "p" | "div" | "span" | "label" | "strong" | "em" | "small" | "blockquote" | "pre" | "code" | "a" | "li" | "h1" | "h2" | "h3" | "h4" | "h5" | "h6";
|
|
2
|
-
|
|
3
|
-
export interface TextProps {
|
|
4
|
-
children?: any;
|
|
5
|
-
class?: string;
|
|
6
|
-
tag?: TextTagOptions;
|
|
7
|
-
[key: string]: any;
|
|
8
|
-
};
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
export type TypewriterAction =
|
|
2
|
-
| { type: "write", value: string | (() => string), color?: string | (() => string), minspeed?: number, maxspeed?: number, label?: string }
|
|
3
|
-
| { type: "delete", to: string, minspeed?: number, maxspeed?: number, label?: string }
|
|
4
|
-
| { type: "pause", duration: number, label?: string }
|
|
5
|
-
| { type: "jump", position: string, label?: string };
|
|
6
|
-
|
|
7
|
-
export interface DisplaySegment {
|
|
8
|
-
text: string;
|
|
9
|
-
color?: string;
|
|
10
|
-
label?: string;
|
|
11
|
-
};
|
|
12
|
-
|
|
13
|
-
export interface TypewriterProps {
|
|
14
|
-
actions: TypewriterAction[];
|
|
15
|
-
class?: string;
|
|
16
|
-
textClass?: string;
|
|
17
|
-
[key: string]: any;
|
|
18
|
-
}
|