chore: format
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
<script setup lang="ts">
|
||||
const { footer } = useAppConfig()
|
||||
const { footer } = useAppConfig();
|
||||
</script>
|
||||
|
||||
<template>
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
<script setup lang="ts">
|
||||
import type { ContentNavigationItem } from '@nuxt/content'
|
||||
import type { ContentNavigationItem } from "@nuxt/content";
|
||||
|
||||
const navigation = inject<Ref<ContentNavigationItem[]>>('navigation')
|
||||
const navigation = inject<Ref<ContentNavigationItem[]>>("navigation");
|
||||
|
||||
const { header } = useAppConfig()
|
||||
const { header } = useAppConfig();
|
||||
</script>
|
||||
|
||||
<template>
|
||||
|
||||
@@ -75,50 +75,50 @@
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import { ref } from 'vue'
|
||||
import { ref } from "vue";
|
||||
|
||||
interface Props {
|
||||
size?: string
|
||||
interactive?: boolean
|
||||
size?: string;
|
||||
interactive?: boolean;
|
||||
}
|
||||
|
||||
const props = withDefaults(defineProps<Props>(), {
|
||||
size: '192px',
|
||||
interactive: true
|
||||
})
|
||||
size: "192px",
|
||||
interactive: true,
|
||||
});
|
||||
|
||||
const isClicked = ref(false)
|
||||
const showRipple = ref(false)
|
||||
const isClicked = ref(false);
|
||||
const showRipple = ref(false);
|
||||
|
||||
const handleClick = () => {
|
||||
if (!props.interactive) return
|
||||
if (!props.interactive) return;
|
||||
|
||||
isClicked.value = true
|
||||
showRipple.value = true
|
||||
isClicked.value = true;
|
||||
showRipple.value = true;
|
||||
|
||||
setTimeout(() => {
|
||||
isClicked.value = false
|
||||
}, 600)
|
||||
setTimeout(() => {
|
||||
isClicked.value = false;
|
||||
}, 600);
|
||||
|
||||
setTimeout(() => {
|
||||
showRipple.value = false
|
||||
}, 800)
|
||||
}
|
||||
setTimeout(() => {
|
||||
showRipple.value = false;
|
||||
}, 800);
|
||||
};
|
||||
|
||||
const handleHover = () => {
|
||||
if (!props.interactive) return
|
||||
// Hover animations are handled by CSS
|
||||
}
|
||||
if (!props.interactive) return;
|
||||
// Hover animations are handled by CSS
|
||||
};
|
||||
|
||||
const handleLeave = () => {
|
||||
if (!props.interactive) return
|
||||
// Leave animations are handled by CSS
|
||||
}
|
||||
if (!props.interactive) return;
|
||||
// Leave animations are handled by CSS
|
||||
};
|
||||
|
||||
const handleTouch = (e: TouchEvent) => {
|
||||
if (!props.interactive) return
|
||||
handleClick()
|
||||
}
|
||||
if (!props.interactive) return;
|
||||
handleClick();
|
||||
};
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
-->
|
||||
|
||||
<script setup>
|
||||
import AppIcon from './AppIcon.vue'
|
||||
import AppIcon from "./AppIcon.vue";
|
||||
</script>
|
||||
|
||||
<template>
|
||||
|
||||
@@ -1,21 +1,22 @@
|
||||
<script setup>
|
||||
import { ref, computed } from 'vue'
|
||||
import { ref, computed } from "vue";
|
||||
|
||||
const props = defineProps({
|
||||
size: {
|
||||
type: String,
|
||||
default: '42px' // Can be: '24px', '32px', '42px', '56px', etc.
|
||||
}
|
||||
})
|
||||
size: {
|
||||
type: String,
|
||||
default: "42px", // Can be: '24px', '32px', '42px', '56px', etc.
|
||||
},
|
||||
});
|
||||
|
||||
const isHovered = ref(false)
|
||||
const isHovered = ref(false);
|
||||
|
||||
// Load Google Font
|
||||
if (typeof document !== 'undefined') {
|
||||
const link = document.createElement('link')
|
||||
link.href = 'https://fonts.googleapis.com/css2?family=Inter:wght@800;900&display=swap'
|
||||
link.rel = 'stylesheet'
|
||||
document.head.appendChild(link)
|
||||
if (typeof document !== "undefined") {
|
||||
const link = document.createElement("link");
|
||||
link.href =
|
||||
"https://fonts.googleapis.com/css2?family=Inter:wght@800;900&display=swap";
|
||||
link.rel = "stylesheet";
|
||||
document.head.appendChild(link);
|
||||
}
|
||||
</script>
|
||||
|
||||
|
||||
@@ -1,11 +1,14 @@
|
||||
<script lang="ts" setup>
|
||||
const props = withDefaults(defineProps<{ title?: string, description?: string, headline?: string }>(), {
|
||||
title: 'title',
|
||||
description: 'description'
|
||||
})
|
||||
const props = withDefaults(
|
||||
defineProps<{ title?: string; description?: string; headline?: string }>(),
|
||||
{
|
||||
title: "title",
|
||||
description: "description",
|
||||
},
|
||||
);
|
||||
|
||||
const title = computed(() => (props.title || '').slice(0, 60))
|
||||
const description = computed(() => (props.description || '').slice(0, 200))
|
||||
const title = computed(() => (props.title || "").slice(0, 60));
|
||||
const description = computed(() => (props.description || "").slice(0, 200));
|
||||
</script>
|
||||
|
||||
<template>
|
||||
|
||||
@@ -1,51 +1,51 @@
|
||||
<script setup lang="ts">
|
||||
import { useClipboard } from '@vueuse/core'
|
||||
import { useClipboard } from "@vueuse/core";
|
||||
|
||||
const route = useRoute()
|
||||
const toast = useToast()
|
||||
const { copy, copied } = useClipboard()
|
||||
const site = useSiteConfig()
|
||||
const isCopying = ref(false)
|
||||
console.log(site)
|
||||
const route = useRoute();
|
||||
const toast = useToast();
|
||||
const { copy, copied } = useClipboard();
|
||||
const site = useSiteConfig();
|
||||
const isCopying = ref(false);
|
||||
console.log(site);
|
||||
|
||||
const mdPath = computed(() => `${site.url}/raw${route.path}.md`)
|
||||
const mdPath = computed(() => `${site.url}/raw${route.path}.md`);
|
||||
|
||||
const items = [
|
||||
{
|
||||
label: 'Copy Markdown link',
|
||||
icon: 'i-lucide-link',
|
||||
onSelect() {
|
||||
copy(mdPath.value)
|
||||
toast.add({
|
||||
title: 'Copied to clipboard',
|
||||
icon: 'i-lucide-check-circle'
|
||||
})
|
||||
}
|
||||
},
|
||||
{
|
||||
label: 'View as Markdown',
|
||||
icon: 'i-simple-icons:markdown',
|
||||
target: '_blank',
|
||||
to: `/raw${route.path}.md`
|
||||
},
|
||||
{
|
||||
label: 'Open in ChatGPT',
|
||||
icon: 'i-simple-icons:openai',
|
||||
target: '_blank',
|
||||
to: `https://chatgpt.com/?hints=search&q=${encodeURIComponent(`Read ${mdPath.value} so I can ask questions about it.`)}`
|
||||
},
|
||||
{
|
||||
label: 'Open in Claude',
|
||||
icon: 'i-simple-icons:anthropic',
|
||||
target: '_blank',
|
||||
to: `https://claude.ai/new?q=${encodeURIComponent(`Read ${mdPath.value} so I can ask questions about it.`)}`
|
||||
}
|
||||
]
|
||||
{
|
||||
label: "Copy Markdown link",
|
||||
icon: "i-lucide-link",
|
||||
onSelect() {
|
||||
copy(mdPath.value);
|
||||
toast.add({
|
||||
title: "Copied to clipboard",
|
||||
icon: "i-lucide-check-circle",
|
||||
});
|
||||
},
|
||||
},
|
||||
{
|
||||
label: "View as Markdown",
|
||||
icon: "i-simple-icons:markdown",
|
||||
target: "_blank",
|
||||
to: `/raw${route.path}.md`,
|
||||
},
|
||||
{
|
||||
label: "Open in ChatGPT",
|
||||
icon: "i-simple-icons:openai",
|
||||
target: "_blank",
|
||||
to: `https://chatgpt.com/?hints=search&q=${encodeURIComponent(`Read ${mdPath.value} so I can ask questions about it.`)}`,
|
||||
},
|
||||
{
|
||||
label: "Open in Claude",
|
||||
icon: "i-simple-icons:anthropic",
|
||||
target: "_blank",
|
||||
to: `https://claude.ai/new?q=${encodeURIComponent(`Read ${mdPath.value} so I can ask questions about it.`)}`,
|
||||
},
|
||||
];
|
||||
|
||||
async function copyPage() {
|
||||
isCopying.value = true
|
||||
copy(await $fetch<string>(`/raw${route.path}.md`))
|
||||
isCopying.value = false
|
||||
isCopying.value = true;
|
||||
copy(await $fetch<string>(`/raw${route.path}.md`));
|
||||
isCopying.value = false;
|
||||
}
|
||||
</script>
|
||||
|
||||
|
||||
@@ -1,17 +1,17 @@
|
||||
<script setup lang="ts">
|
||||
const { isLoading } = useLoadingIndicator()
|
||||
const { isLoading } = useLoadingIndicator();
|
||||
|
||||
const appear = ref(false)
|
||||
const appeared = ref(false)
|
||||
const appear = ref(false);
|
||||
const appeared = ref(false);
|
||||
|
||||
onMounted(() => {
|
||||
setTimeout(() => {
|
||||
appear.value = true
|
||||
setTimeout(() => {
|
||||
appeared.value = true
|
||||
}, 1000)
|
||||
}, 0)
|
||||
})
|
||||
setTimeout(() => {
|
||||
appear.value = true;
|
||||
setTimeout(() => {
|
||||
appeared.value = true;
|
||||
}, 1000);
|
||||
}, 0);
|
||||
});
|
||||
</script>
|
||||
|
||||
<template>
|
||||
|
||||
@@ -1,58 +1,67 @@
|
||||
<script setup lang="ts">
|
||||
interface Star {
|
||||
x: number
|
||||
y: number
|
||||
size: number
|
||||
x: number;
|
||||
y: number;
|
||||
size: number;
|
||||
}
|
||||
|
||||
const props = withDefaults(defineProps<{
|
||||
starCount?: number
|
||||
color?: string
|
||||
speed?: 'slow' | 'normal' | 'fast'
|
||||
size?: { min: number, max: number }
|
||||
}>(), {
|
||||
starCount: 300,
|
||||
color: 'var(--ui-primary)',
|
||||
speed: 'normal',
|
||||
size: () => ({
|
||||
min: 1,
|
||||
max: 2
|
||||
})
|
||||
})
|
||||
const props = withDefaults(
|
||||
defineProps<{
|
||||
starCount?: number;
|
||||
color?: string;
|
||||
speed?: "slow" | "normal" | "fast";
|
||||
size?: { min: number; max: number };
|
||||
}>(),
|
||||
{
|
||||
starCount: 300,
|
||||
color: "var(--ui-primary)",
|
||||
speed: "normal",
|
||||
size: () => ({
|
||||
min: 1,
|
||||
max: 2,
|
||||
}),
|
||||
},
|
||||
);
|
||||
|
||||
// Generate random star positions and sizes
|
||||
const generateStars = (count: number): Star[] => {
|
||||
return Array.from({ length: count }, () => ({
|
||||
x: Math.floor(Math.random() * 2000),
|
||||
y: Math.floor(Math.random() * 2000),
|
||||
size: typeof props.size === 'number'
|
||||
? props.size
|
||||
: Math.random() * (props.size.max - props.size.min) + props.size.min
|
||||
}))
|
||||
}
|
||||
return Array.from({ length: count }, () => ({
|
||||
x: Math.floor(Math.random() * 2000),
|
||||
y: Math.floor(Math.random() * 2000),
|
||||
size:
|
||||
typeof props.size === "number"
|
||||
? props.size
|
||||
: Math.random() * (props.size.max - props.size.min) + props.size.min,
|
||||
}));
|
||||
};
|
||||
|
||||
// Define speed configurations once
|
||||
const speedMap = {
|
||||
slow: { duration: 200, opacity: 0.5, ratio: 0.3 },
|
||||
normal: { duration: 150, opacity: 0.75, ratio: 0.3 },
|
||||
fast: { duration: 100, opacity: 1, ratio: 0.4 }
|
||||
}
|
||||
slow: { duration: 200, opacity: 0.5, ratio: 0.3 },
|
||||
normal: { duration: 150, opacity: 0.75, ratio: 0.3 },
|
||||
fast: { duration: 100, opacity: 1, ratio: 0.4 },
|
||||
};
|
||||
|
||||
// Use a more efficient approach to generate and store stars
|
||||
const stars = useState<{ slow: Star[], normal: Star[], fast: Star[] }>('stars', () => {
|
||||
return {
|
||||
slow: generateStars(Math.floor(props.starCount * speedMap.slow.ratio)),
|
||||
normal: generateStars(Math.floor(props.starCount * speedMap.normal.ratio)),
|
||||
fast: generateStars(Math.floor(props.starCount * speedMap.fast.ratio))
|
||||
}
|
||||
})
|
||||
const stars = useState<{ slow: Star[]; normal: Star[]; fast: Star[] }>(
|
||||
"stars",
|
||||
() => {
|
||||
return {
|
||||
slow: generateStars(Math.floor(props.starCount * speedMap.slow.ratio)),
|
||||
normal: generateStars(
|
||||
Math.floor(props.starCount * speedMap.normal.ratio),
|
||||
),
|
||||
fast: generateStars(Math.floor(props.starCount * speedMap.fast.ratio)),
|
||||
};
|
||||
},
|
||||
);
|
||||
|
||||
// Compute star layers with different speeds and opacities
|
||||
const starLayers = computed(() => [
|
||||
{ stars: stars.value.fast, ...speedMap.fast },
|
||||
{ stars: stars.value.normal, ...speedMap.normal },
|
||||
{ stars: stars.value.slow, ...speedMap.slow }
|
||||
])
|
||||
{ stars: stars.value.fast, ...speedMap.fast },
|
||||
{ stars: stars.value.normal, ...speedMap.normal },
|
||||
{ stars: stars.value.slow, ...speedMap.slow },
|
||||
]);
|
||||
</script>
|
||||
|
||||
<template>
|
||||
|
||||
Reference in New Issue
Block a user