Skip to content

Instantly share code, notes, and snippets.

@sibbng
sibbng / importmap.json
Created June 5, 2025 19:28
v0 clone voby
{
"imports": {
"voby": "https://esm.sh/voby",
"oby": "https://esm.sh/oby",
"react": "https://esm.sh/react",
"gsap": "https://esm.sh/gsap",
"gsap/ScrollTrigger": "https://esm.sh/gsap/ScrollTrigger",
"@/components/ui/button": "https://esm.sh/@/components/ui/button",
"@/components/ui/input": "https://esm.sh/@/components/ui/input",
"@/components/ui/card": "https://esm.sh/@/components/ui/card",
import { type Context, createContext } from 'voby';
import type { QueryClient } from './useQuery.ts';
// #region Context
export const QueryClientContext: Context<QueryClient> =
createContext<QueryClient>();
export const QueryClientProvider =
QueryClientContext.Provider as typeof QueryClientContext.Provider;
@sibbng
sibbng / importmap.json
Last active May 7, 2025 17:52
voby bookmark app
{
"imports": {
"voby": "https://esm.sh/voby"
}
}
{
"imports": {
"voby": "https://esm.sh/voby",
"voby-query": "https://esm.sh/voby-query"
}
}
@sibbng
sibbng / importmap.json
Last active May 7, 2025 17:38
voby todo app
{
"imports": {
"voby": "https://esm.sh/voby",
"oby": "https://esm.sh/oby"
}
}
{
"imports": {
"voby": "https://esm.sh/voby",
"oby": "https://esm.sh/oby"
}
}
import { $, For, render } from "voby";
import { animate, createTimeline } from "animejs";
const ViewSlider = () => {
const viewsData = [
{ title: "View 1", content: "This is the content of View 1." },
{ title: "View 2", content: "Welcome to View 2!" },
{ title: "View 3", content: "You've reached View 3." },
{ title: "View 4", content: "This is the final view, View 4." },
];
import { render, Switch, h, useEffect, ObservableReadonly, Observable, If } from 'voby';
import { $, useMemo, useReadonly, store } from 'voby';
// --- Event & Context Types ---
type EventObject = { type: string; payload?: any };
type GuardCondition<TContext, TEvent extends EventObject = EventObject> =
(context: TContext, event: TEvent) => boolean;
// --- Action Types ---
import { computed, nextTick, reactive, ref, unref, watch } from 'vue'
import type { MaybeElementRef, MaybeRef } from '@vueuse/core'
import { clamp, createEventHook, tryOnScopeDispose, unrefElement, useEventListener } from '@vueuse/core'
type Edges = 'top-left' | 'top-right' | 'bottom-left' | 'bottom-right' | 'left' | 'right' | 'top' | 'bottom'
export interface UseResizeOptions {
disabled?: boolean
mode?: MaybeRef<'auto' | 'manual'>
disableCursor?: MaybeRef<boolean>
xMultiplier?: MaybeRef<number>
import { unrefElement, useEventListener } from '@vueuse/core'
const defaultWindow = typeof window !== 'undefined' ? window : undefined
/**
* Listen for clicks outside of an element.
*
* @see https://vueuse.org/onClickOutside
* @param target
* @param handler