file_path stringlengths 3 280 | file_language stringclasses 66
values | content stringlengths 1 1.04M | repo_name stringlengths 5 92 | repo_stars int64 0 154k | repo_description stringlengths 0 402 | repo_primary_language stringclasses 108
values | developer_username stringlengths 1 25 | developer_name stringlengths 0 30 | developer_company stringlengths 0 82 |
|---|---|---|---|---|---|---|---|---|---|
src/App.vue | Vue | <script setup lang="ts">
import { onBeforeMount, onMounted } from "vue"
import { supabase } from "./plugins/supabase"
import { store } from "@/store"
onBeforeMount(() => {
let session = supabase.auth.session()
if (session) store.user = session?.user
})
supabase.auth.onAuthStateChange((event, session) => {
conso... | zernonia/supadb | 47 | Connect and play with Supabase REST API / Graphql easily | Vue | zernonia | zernonia | Troop Travel |
src/assets/main.css | CSS | html {
font-family: "Inter", sans-serif;
@apply text-light-900;
}
pre {
@apply p-6 rounded-2xl md:text-lg !bg-dark-300 overflow-y-auto;
}
pre span {
font-family: "Roboto Mono", monospace;
}
label {
@apply font-font-font-medium text-lg;
}
input {
@apply px-6 py-3 rounded-xl mt-1 mb-3 disabled:bg-dark-300 di... | zernonia/supadb | 47 | Connect and play with Supabase REST API / Graphql easily | Vue | zernonia | zernonia | Troop Travel |
src/components/BasePage.vue | Vue | <script setup lang="ts">
import CodeInit from "@/components/CodeInit.vue"
import { ref } from "vue"
import CodeGraphql from "./CodeGraphql.vue"
import LazyImage from "./LazyImage.vue"
const props = defineProps({
dictionary: Object,
banner: String,
title: String,
})
const isLoading = ref(true)
</script>
<templa... | zernonia/supadb | 47 | Connect and play with Supabase REST API / Graphql easily | Vue | zernonia | zernonia | Troop Travel |
src/components/CodeGraphql.vue | Vue | <script setup lang="ts">
import { ref } from "vue"
import { highlighter } from "@/plugins/shiki"
const props = defineProps({
title: String,
})
let code = ref(`query ${props.title}Query {
${props.title}Collection {
edges {
node {
id
title
link
image
... | zernonia/supadb | 47 | Connect and play with Supabase REST API / Graphql easily | Vue | zernonia | zernonia | Troop Travel |
src/components/CodeInit.vue | Vue | <script setup lang="ts">
import { ref, watch } from "vue"
import { highlighter } from "@/plugins/shiki"
const props = defineProps({
title: String,
})
const code = ref("")
code.value = highlighter.codeToHtml(code.value, "ts")
const tab = ref("supabase_client")
const tabs = [
{ name: "Supabase Client", value: "su... | zernonia/supadb | 47 | Connect and play with Supabase REST API / Graphql easily | Vue | zernonia | zernonia | Troop Travel |
src/components/LazyImage.vue | Vue | <script setup lang="ts">
import { ref } from "vue"
const props = defineProps({
src: String,
})
const isLoading = ref(true)
const image = new URL(`../assets/images/${props.src}`, import.meta.url).href
const imageBlur = new URL(`../assets/images/${props.src?.replace(/(\.[\w\d_-]+)$/i, "_blur$1")}`, import.meta.url).hr... | zernonia/supadb | 47 | Connect and play with Supabase REST API / Graphql easily | Vue | zernonia | zernonia | Troop Travel |
src/components/Tabs.vue | Vue | <script setup lang="ts">
import { PropType } from "vue"
interface Tab {
name: string
value: string
}
const props = defineProps({
modelValue: String,
tabs: Object as PropType<Tab[]>,
})
const emit = defineEmits<{
(e: "update:modelValue", value: string): void
}>()
</script>
<template>
<div class="flex">
... | zernonia/supadb | 47 | Connect and play with Supabase REST API / Graphql easily | Vue | zernonia | zernonia | Troop Travel |
src/env.d.ts | TypeScript | /// <reference types="vite/client" />
/// <reference types="vite-plugin-pages/client" />
declare module "*.vue" {
import type { DefineComponent } from "vue"
// eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/ban-types
const component: DefineComponent<{}, {}, any>
export default ... | zernonia/supadb | 47 | Connect and play with Supabase REST API / Graphql easily | Vue | zernonia | zernonia | Troop Travel |
src/main.ts | TypeScript | import { createApp } from "vue"
import App from "./App.vue"
import "virtual:windi.css"
import "./assets/main.css"
import { initHighlighter } from "./plugins/shiki"
import { router } from "./plugins/router"
initHighlighter().then(() => {
createApp(App).use(router).mount("#app")
})
| zernonia/supadb | 47 | Connect and play with Supabase REST API / Graphql easily | Vue | zernonia | zernonia | Troop Travel |
src/pages/imdb.vue | Vue | <script setup lang="ts">
const dictionary = [
{ name: "id", type: "string", value: "tt0050051" },
{
name: "image",
type: "string",
value: "https://m.media-amazon.com/images/M/MV5BZjEzYmZk...",
},
{ name: "link", type: "string", value: "https://www.imdb.com/title/tt0050051/?ref_=adv_li_i" },
{ name... | zernonia/supadb | 47 | Connect and play with Supabase REST API / Graphql easily | Vue | zernonia | zernonia | Troop Travel |
src/pages/index.vue | Vue | <script setup lang="ts">
import imgImdb from "@/assets/images/imdb.jpeg"
import imgSteam from "@/assets/images/steam.jpeg"
</script>
<template>
<div>
<div class="flex flex-col items-center">
<h1 class="mt-16 md:mt-32 text-4xl md:text-6xl xl:text-7xl font-bold text-center leading-tight">
Pre-Built <... | zernonia/supadb | 47 | Connect and play with Supabase REST API / Graphql easily | Vue | zernonia | zernonia | Troop Travel |
src/pages/login.vue | Vue | <script setup lang="ts">
import { supabase } from "@/plugins/supabase"
const login = () => {
supabase.auth.signIn({
provider: "github",
})
}
</script>
<template>
<div class="mt-12 flex flex-col items-center">
<h2 class="text-yellow-300 text-4xl text-center font-semibold">
Login with <br class="blo... | zernonia/supadb | 47 | Connect and play with Supabase REST API / Graphql easily | Vue | zernonia | zernonia | Troop Travel |
src/pages/settings.vue | Vue | <script setup lang="ts">
import { store } from "@/store"
import { computed, ref, watch } from "vue"
import { useClipboard } from "@vueuse/core"
import { highlighter } from "@/plugins/shiki"
const config = ref({
url: import.meta.env.VITE_SUPABASE_URL,
anon: import.meta.env.VITE_SUPABASE_ANON,
auth: "",
})
const ... | zernonia/supadb | 47 | Connect and play with Supabase REST API / Graphql easily | Vue | zernonia | zernonia | Troop Travel |
src/pages/steam.vue | Vue | <script setup lang="ts">
const dictionary = [
{ name: "id", type: "number", value: "915810" },
{
name: "link",
type: "string",
value: "https://store.steampowered.com/app/915810/Midnight_Ghost_Hunt/?snr=1_241_4_action_103",
},
{
name: "image",
type: "string",
value: "https://cdn.akamai.st... | zernonia/supadb | 47 | Connect and play with Supabase REST API / Graphql easily | Vue | zernonia | zernonia | Troop Travel |
src/pages/terms-and-conditions.vue | Vue | <template>
<div>
<h2 class="text-yellow-300 text-2xl md:text-4xl font-semibold">Terms and Conditions</h2>
<ul class="my-6 list-disc list-inside">
<li>You may not offer to sell service from SupaDB.</li>
<li>You may not use SupaDB for commercial gain.</li>
<li>You may not purposely jam the tr... | zernonia/supadb | 47 | Connect and play with Supabase REST API / Graphql easily | Vue | zernonia | zernonia | Troop Travel |
src/plugins/router.ts | TypeScript | import { store } from "@/store"
import { createRouter, createWebHistory } from "vue-router"
import routes from "~pages"
export const router = createRouter({
history: createWebHistory(),
routes,
})
router.beforeEach((to, from) => {
const toName = to.name?.toString() ?? ""
if (!store.user && toName.includes("se... | zernonia/supadb | 47 | Connect and play with Supabase REST API / Graphql easily | Vue | zernonia | zernonia | Troop Travel |
src/plugins/shiki.ts | TypeScript | import { setCDN, setOnigasmWASM, Highlighter, getHighlighter } from "shiki"
setOnigasmWASM(import.meta.env.DEV ? "" : "/shiki/dist/onigasm.wasm")
setCDN(import.meta.env.DEV ? "node_modules/shiki/" : "/shiki/")
export let highlighter: Highlighter
export async function initHighlighter() {
highlighter = await getHigh... | zernonia/supadb | 47 | Connect and play with Supabase REST API / Graphql easily | Vue | zernonia | zernonia | Troop Travel |
src/plugins/supabase.ts | TypeScript | import { createClient } from "@supabase/supabase-js"
export const supabase = createClient(import.meta.env.VITE_SUPABASE_URL, import.meta.env.VITE_SUPABASE_ANON)
| zernonia/supadb | 47 | Connect and play with Supabase REST API / Graphql easily | Vue | zernonia | zernonia | Troop Travel |
src/store.ts | TypeScript | import { User } from "@supabase/gotrue-js"
import { computed, reactive } from "vue"
export const store = reactive({
user: null as User | null | undefined,
})
| zernonia/supadb | 47 | Connect and play with Supabase REST API / Graphql easily | Vue | zernonia | zernonia | Troop Travel |
vite.config.ts | TypeScript | import { defineConfig } from "vite"
import vue from "@vitejs/plugin-vue"
import WindiCSS from "vite-plugin-windicss"
import Icons from "unplugin-icons/vite"
import IconsResolver from "unplugin-icons/resolver"
import Components from "unplugin-vue-components/vite"
import Pages from "vite-plugin-pages"
import { resolve } ... | zernonia/supadb | 47 | Connect and play with Supabase REST API / Graphql easily | Vue | zernonia | zernonia | Troop Travel |
windi.config.ts | TypeScript | import { defineConfig } from "windicss/helpers"
export default defineConfig({
theme: {
extend: {},
},
plugins: [require("@windicss/plugin-animations")({})],
})
| zernonia/supadb | 47 | Connect and play with Supabase REST API / Graphql easily | Vue | zernonia | zernonia | Troop Travel |
app.vue | Vue | <script setup lang="ts">
//@ts-ignore
import Logo from "~~/assets/logo.svg";
useHead({
title: "Tweetic | Convert Tweets to Static HTML ",
viewport: "width=device-width, initial-scale=1, maximum-scale=1",
charset: "utf-8",
link: [{ rel: "icon", href: "/logo.png" }],
meta: [
{
name: "description",
... | zernonia/tweetic | 248 | Convert Tweets to Static HTML | TypeScript | zernonia | zernonia | Troop Travel |
assets/main.css | CSS | :root {
--border: rgb(234, 234, 234);
--bg-primary: white;
--text-primary: rgb(35 35 35);
--text-secondary: rgb(31, 155, 240);
--subtext-primary: rgb(148, 163, 184);
}
body {
@apply min-h-screen bg-light-300;
}
#__nuxt {
@apply w-full flex flex-col items-center;
}
.btn {
@apply border px-4 py-2 rounded... | zernonia/tweetic | 248 | Convert Tweets to Static HTML | TypeScript | zernonia | zernonia | Troop Travel |
components/Arrow.vue | Vue | <template>
<svg width="148" height="139" viewBox="0 0 148 139" fill="none" xmlns="http://www.w3.org/2000/svg">
<path
d="M3.16858 112.804C7.08569 119.902 12.5672 129.344 17.5765 135.598M17.5765 135.598C18.1534 136.319 22.0417 130.583 22.1986 130.303C25.6464 124.175 28.1863 117.783 30.6351 111.213M17.5765 135... | zernonia/tweetic | 248 | Convert Tweets to Static HTML | TypeScript | zernonia | zernonia | Troop Travel |
components/Modal.vue | Vue | <script setup lang="ts">
import { onClickOutside } from "@vueuse/core";
const prop = defineProps({
open: Boolean,
});
const emit = defineEmits(["close"]);
const target = ref();
onClickOutside(target, (e) => {
emit("close");
});
watch(
() => prop.open,
(n) => {
n ? document.body.classList.add("overflow-hid... | zernonia/tweetic | 248 | Convert Tweets to Static HTML | TypeScript | zernonia | zernonia | Troop Travel |
components/Toggle.vue | Vue | <script setup lang="ts">
defineProps({
modelValue: Boolean,
name: String,
});
const emits = defineEmits(["update:modelValue"]);
const onClick = (ev: Event) => {
let el = ev.target as HTMLInputElement;
emits("update:modelValue", el.checked);
};
</script>
<template>
<label :for="name" class="inline-flex flex-... | zernonia/tweetic | 248 | Convert Tweets to Static HTML | TypeScript | zernonia | zernonia | Troop Travel |
components/Tweet.vue | Vue | <script setup lang="ts">
const props = defineProps({
url: String,
layout: { type: String, default: "" },
css: { type: String, default: "" },
enable_twemoji: { type: Boolean, default: true },
show_media: { type: Boolean, default: false },
show_quoted_tweet: { type: Boolean, default: false },
show_info: { t... | zernonia/tweetic | 248 | Convert Tweets to Static HTML | TypeScript | zernonia | zernonia | Troop Travel |
components/TweetWall.vue | Vue | <script setup lang="ts">
import { PropType } from "vue";
const props = defineProps({
urls: Object as PropType<string[]>,
options: Object,
isEditing: { type: Boolean, default: false },
});
const emits = defineEmits<{
(e: "click-tweet", payload: string): void;
}>();
const sortedUrls = computed(() => {
let col... | zernonia/tweetic | 248 | Convert Tweets to Static HTML | TypeScript | zernonia | zernonia | Troop Travel |
components/Underline.vue | Vue | <template>
<svg width="307" height="29" viewBox="0 0 307 29" fill="none" xmlns="http://www.w3.org/2000/svg">
<path
d="M213.014 26.8415C178.272 19.4138 139.489 23.4441 104.338 24.1263C94.2307 24.3226 83.8895 25.6318 73.7918 25.0712C72.4748 24.9984 66.7288 24.7252 65.6509 23.2654C65.5102 23.0755 69.9908 22.32... | zernonia/tweetic | 248 | Convert Tweets to Static HTML | TypeScript | zernonia | zernonia | Troop Travel |
components/docs/Base.vue | Vue | <script setup lang="ts">
defineProps({
method: String,
url: String,
description: String,
});
</script>
<template>
<div class="mt-20">
<div class="relative flex items-center p-2 bg-light-600 rounded-xl">
<div class="tag bg-blue-500 mr-4">{{ method }}</div>
<div>{{ url }}</div>
<span class=... | zernonia/tweetic | 248 | Convert Tweets to Static HTML | TypeScript | zernonia | zernonia | Troop Travel |
components/docs/DocsTweet.vue | Vue | <script setup lang="ts">
const params = ref({
url: "https://twitter.com/zernonia/status/1524620865987506176",
layout: "",
css: "tailwind",
enable_twemoji: true,
show_media: true,
show_quoted_tweet: true,
show_info: true,
});
const { $hljs } = useNuxtApp();
const tweetRef = ref();
const highlightResponse ... | zernonia/tweetic | 248 | Convert Tweets to Static HTML | TypeScript | zernonia | zernonia | Troop Travel |
composables/useCustomHead.ts | TypeScript | export const useCustomHead = (title: string, description?: string, image?: string) => {
useHead({
title,
meta: [
{ name: "description", content: description ?? "Convert Tweets to Static HTML | Free • Open Source" },
{ name: "twitter:card", content: "summary_large_image" },
{ name: "twitter:s... | zernonia/tweetic | 248 | Convert Tweets to Static HTML | TypeScript | zernonia | zernonia | Troop Travel |
nuxt.config.ts | TypeScript | // https://v3.nuxtjs.org/api/configuration/nuxt.config
export default defineNuxtConfig({
modules: ["nuxt-windicss", "@nuxtjs/supabase"],
css: ["~~/assets/main.css", "vue-toastification/dist/index.css"],
build: {
transpile: ["twitter-api-v2"],
},
runtimeConfig: {
API_SECRET_KEY: process.env.API_SECRET_... | zernonia/tweetic | 248 | Convert Tweets to Static HTML | TypeScript | zernonia | zernonia | Troop Travel |
pages/create.vue | Vue | <script setup lang="ts">
import { useStorage } from "@vueuse/core";
import { useClipboard } from "@vueuse/core";
import { obtainCss } from "~~/utils/function";
import { TweetOptions } from "~~/utils/types";
import { useToast } from "vue-toastification";
const toast = useToast();
const tweetsInput = useStorage("tweets"... | zernonia/tweetic | 248 | Convert Tweets to Static HTML | TypeScript | zernonia | zernonia | Troop Travel |
pages/docs.vue | Vue | <template>
<div>
<DocsTweet></DocsTweet>
</div>
</template>
| zernonia/tweetic | 248 | Convert Tweets to Static HTML | TypeScript | zernonia | zernonia | Troop Travel |
pages/index.vue | Vue | <script setup lang="ts"></script>
<template>
<div class="mt-32 flex flex-col items-center overflow-hidden xl:overflow-visible">
<h1 class="text-4xl md:text-7xl font-bold text-center">
Convert Tweets to <br />
Static HTML
</h1>
<h2 class="text-center mt-8 text-xl md:text-2xl text-gray-400">
... | zernonia/tweetic | 248 | Convert Tweets to Static HTML | TypeScript | zernonia | zernonia | Troop Travel |
pages/thank-you.vue | Vue | <script setup lang="ts">
const tweets = ref([
"https://twitter.com/dominiksumer/status/1524741858009694209",
"https://twitter.com/maazarin/status/1524732072832774147",
"https://twitter.com/kecrily/status/1524665293540589569",
"https://twitter.com/pramit_armpit/status/1524637652565524481",
"https://twitter.com... | zernonia/tweetic | 248 | Convert Tweets to Static HTML | TypeScript | zernonia | zernonia | Troop Travel |
pages/wall-of-tweets/[keyword].vue | Vue | <script setup lang="ts">
import { capitalizeFirstLetter } from "~~/utils/function";
const route = useRoute();
const keyword = route.params.keyword?.toString();
const { data, pending } = await useLazyFetch("/api/wall-of-tweets", { params: { keyword }, key: keyword });
useCustomHead(`${capitalizeFirstLetter(keyword.toSt... | zernonia/tweetic | 248 | Convert Tweets to Static HTML | TypeScript | zernonia | zernonia | Troop Travel |
plugins/highlight.ts | TypeScript | import hljs from "highlight.js/lib/core"
import json from "highlight.js/lib/languages/json"
import html from "highlight.js/lib/languages/xml"
import css from "highlight.js/lib/languages/css"
import "highlight.js/styles/base16/github.css"
export default defineNuxtPlugin(() => {
hljs.registerLanguage("json", json)
h... | zernonia/tweetic | 248 | Convert Tweets to Static HTML | TypeScript | zernonia | zernonia | Troop Travel |
plugins/toast.client.ts | TypeScript | import Toast, { PluginOptions, POSITION } from "vue-toastification/dist/index.mjs";
const options: PluginOptions = {
position: POSITION.TOP_CENTER,
maxToasts: 1,
timeout: 2000,
transition: "Vue-Toastification__fade",
};
export default defineNuxtPlugin((nuxt) => {
nuxt.vueApp.use(Toast, options);
});
| zernonia/tweetic | 248 | Convert Tweets to Static HTML | TypeScript | zernonia | zernonia | Troop Travel |
plugins/umami.client.ts | TypeScript | import { defineNuxtPlugin } from "#app";
export default defineNuxtPlugin(() => {
const moduleOptions = {
scriptUrl: "https://umami-zernonia.vercel.app/umami.js",
websiteId: "91452ea0-c879-4497-8bf0-0dd74ee96bb8",
domains: "tweetic.zernonia.com",
};
const options = { ...moduleOptions };
loadScript(... | zernonia/tweetic | 248 | Convert Tweets to Static HTML | TypeScript | zernonia | zernonia | Troop Travel |
server/_lib/parser.ts | TypeScript | import { TweetOptions, TweetContent, TweetSyndication } from "~~/utils/types";
import { mapClass } from "./reference";
import { format } from "date-fns";
import Twemoji from "twemoji";
export const constructHtml = (data: TweetSyndication, options: TweetOptions, isQuotedTweet = false) => {
try {
const mapClassOpt... | zernonia/tweetic | 248 | Convert Tweets to Static HTML | TypeScript | zernonia | zernonia | Troop Travel |
server/_lib/reference.ts | TypeScript | import { TweetOptions } from "~~/utils/types";
const tailwindClassBasic = {
"tweet-header": " flex items-center justify-between",
"tweet-author": "relative flex items-center",
"tweet-author-image": "w-12 h-12 rounded-full",
"tweet-author-info": "ml-4",
"tweet-author-name": "font-medium",
"tweet-author-hand... | zernonia/tweetic | 248 | Convert Tweets to Static HTML | TypeScript | zernonia | zernonia | Troop Travel |
server/_lib/verify.ts | TypeScript | import { H3Event } from "h3";
export const verify = (event: H3Event) => {
const { authorization } = event.req.headers;
let authorized = true;
if (process.env.NODE_ENV !== "development" && authorization !== `Bearer ${useRuntimeConfig().API_SECRET_KEY}`) {
event.res.statusCode = 401;
authorized = false;
... | zernonia/tweetic | 248 | Convert Tweets to Static HTML | TypeScript | zernonia | zernonia | Troop Travel |
server/api/crawl-all.ts | TypeScript | import { TwitterApi } from "twitter-api-v2";
import { verify } from "../_lib/verify";
import { serverSupabaseClient } from "#supabase/server";
export default defineEventHandler(async (event) => {
const authorized = verify(event);
const client = serverSupabaseClient(event);
if (!authorized) return "Unauthorized"... | zernonia/tweetic | 248 | Convert Tweets to Static HTML | TypeScript | zernonia | zernonia | Troop Travel |
server/api/crawl.ts | TypeScript | import { TwitterApi } from "twitter-api-v2";
import { verify } from "../_lib/verify";
import { serverSupabaseClient } from "#supabase/server";
export default defineEventHandler(async (event) => {
const authorized = verify(event);
const client = serverSupabaseClient(event);
if (!authorized) return "Unauthorized";... | zernonia/tweetic | 248 | Convert Tweets to Static HTML | TypeScript | zernonia | zernonia | Troop Travel |
server/api/tweet.ts | TypeScript | import { defu } from "defu";
import { TweetOptions, TweetQueryOptions, TweetSyndication } from "~~/utils/types";
import { constructHtml, getSyndication } from "../_lib/parser";
import { setResponseHeader } from "h3";
// Create Capture Group for twitter url.
const getTwitterId = (url: string): string | boolean => {
/... | zernonia/tweetic | 248 | Convert Tweets to Static HTML | TypeScript | zernonia | zernonia | Troop Travel |
server/api/wall-of-tweets.ts | TypeScript | import { serverSupabaseClient } from "#supabase/server";
export default defineEventHandler(async (event) => {
try {
const { keyword } = getQuery(event);
const client = serverSupabaseClient(event);
const { data } = await client.from("wall_of_tweets").select("url").eq("keyword", keyword);
return data?... | zernonia/tweetic | 248 | Convert Tweets to Static HTML | TypeScript | zernonia | zernonia | Troop Travel |
server/middleware/swr.ts | TypeScript | export default defineEventHandler(async (event) => {
event.context.res?.setHeader("Cache-Control", "s-maxage=7200, stale-while-revalidate");
});
| zernonia/tweetic | 248 | Convert Tweets to Static HTML | TypeScript | zernonia | zernonia | Troop Travel |
utils/function.ts | TypeScript | import { TweetOptions, ExportOptions } from "./types"
const baseStyle = `
:root {
--border: rgb(234, 234, 234);
--bg-primary: white;
--text-primary: rgb(35 35 35);
--text-secondary: rgb(31, 155, 240);
}
body { font-family: ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",Robot... | zernonia/tweetic | 248 | Convert Tweets to Static HTML | TypeScript | zernonia | zernonia | Troop Travel |
utils/types/index.ts | TypeScript | export * from "./syndication"
export * from "./interface"
| zernonia/tweetic | 248 | Convert Tweets to Static HTML | TypeScript | zernonia | zernonia | Troop Travel |
utils/types/interface.ts | TypeScript | export interface TweetOembed {
author_name: string
author_url: string
cache_age: string
height: number | null
html: string
provider_name: string
provider_url: string
type: string
url: string
version: string
width: number | null
}
export interface TweetOptions {
layout?: string
css?: string
... | zernonia/tweetic | 248 | Convert Tweets to Static HTML | TypeScript | zernonia | zernonia | Troop Travel |
utils/types/syndication.ts | TypeScript | export interface TweetSyndication {
lang: string
favorite_count: number
self_thread: SelfThread
created_at: string
display_text_range: number[]
entities: Entities
id_str: string
text: string
user: User
conversation_count: number
news_action_type: string
card: Card
photos: Photo[]
video: Vide... | zernonia/tweetic | 248 | Convert Tweets to Static HTML | TypeScript | zernonia | zernonia | Troop Travel |
app.vue | Vue | <script setup lang="ts">
const { name } = toRefs(useRoute());
const routeName = computed(
() => name.value && name.value.toString().charAt(0).toLocaleUpperCase() + name.value.toString().slice(1)
);
useHead({
titleTemplate: (title) => `${title ?? routeName.value} | Vista`,
link: [{ rel: "icon", href: "/logo.svg" ... | zernonia/vista | 107 | Add animated subtitle to your video automatically | Vue | zernonia | zernonia | Troop Travel |
assets/main.css | CSS | @import "@vueform/slider/themes/default.css";
:root {
--slider-connect-bg: #3b82f6;
--slider-tooltip-bg: #3b82f6;
--slider-handle-ring-color: #3b82f630;
}
img {
@apply inline-block;
}
input[type="number"],
input[type="text"] {
@apply w-full border shadow-sm px-3 py-2 rounded-lg;
}
label {
@apply text-sm ... | zernonia/vista | 107 | Add animated subtitle to your video automatically | Vue | zernonia | zernonia | Troop Travel |
components/Completed.vue | Vue | <script setup lang="ts">
import { downloadBlob } from "@/utils/functions";
defineProps({
url: { type: String, default: "" },
});
const emits = defineEmits(["edit"]);
</script>
<template>
<div class="w-max mx-auto my-20">
<h1 class="mb-16">Completed! 🎉</h1>
<Preview :url="url" />
<PreviewControls />... | zernonia/vista | 107 | Add animated subtitle to your video automatically | Vue | zernonia | zernonia | Troop Travel |
components/Edit.vue | Vue | <script setup lang="ts">
import html2canvas from "html2canvas";
import { chunk, toBlob, wait } from "@/utils/functions";
import type { PropType } from "vue";
const props = defineProps({
video: { type: Object as PropType<Blob | File> },
});
const emits = defineEmits(["save", "active", "completed", "error"]);
const {... | zernonia/vista | 107 | Add animated subtitle to your video automatically | Vue | zernonia | zernonia | Troop Travel |
components/Loading.vue | Vue | <template>
<svg class="w-12 h-12 text-blue-500 animate-spin" width="32" height="32" viewBox="0 0 24 24">
<g fill="currentColor">
<path
fill-rule="evenodd"
d="M12 19a7 7 0 1 0 0-14a7 7 0 0 0 0 14Zm0 3c5.523 0 10-4.477 10-10S17.523 2 12 2S2 6.477 2 12s4.477 10 10 10Z"
clip-rule="evenod... | zernonia/vista | 107 | Add animated subtitle to your video automatically | Vue | zernonia | zernonia | Troop Travel |
components/Overlay.vue | Vue | <script setup lang="ts">
import { animate, stagger } from "motion";
const props = defineProps({ active: Boolean });
const { active } = toRefs(props);
const stripCount = 5;
const startAnimation = () => {
animate(".overlay", { display: "block" }, { duration: 0 });
animate(".strip", { width: "100%" }, { delay: stag... | zernonia/vista | 107 | Add animated subtitle to your video automatically | Vue | zernonia | zernonia | Troop Travel |
components/Preview.vue | Vue | <script setup lang="ts">
defineProps({
url: String,
});
const { el, videoWidth, videoHeight, playing } = usePlayback();
const loadedVideo = () => {
videoWidth.value = el.value?.videoWidth ?? 0;
videoHeight.value = el.value?.videoHeight ?? 0;
};
</script>
<template>
<div class="relative w-120 min-h-64 h-min f... | zernonia/vista | 107 | Add animated subtitle to your video automatically | Vue | zernonia | zernonia | Troop Travel |
components/Preview/Controls.vue | Vue | <script setup lang="ts">
import Slider from "@vueform/slider";
const { duration, currentTime, playing } = usePlayback();
const disabledTagName = ["BUTTON", "A", "INPUT"];
onKeyStroke(
" ",
(e) => {
if (
activeElement.value &&
!disabledTagName.includes(activeElement.value?.tagName) &&
!active... | zernonia/vista | 107 | Add animated subtitle to your video automatically | Vue | zernonia | zernonia | Troop Travel |
components/Preview/Text.vue | Vue | <script setup lang="ts">
import type { PropType } from "vue";
import type { Transcribe } from "@/utils/interface";
const props = defineProps({
chunks: Array as PropType<Transcribe[][]>,
});
const { currentTime } = usePlayback();
const { chunks } = toRefs(props);
const { computedStyle, computedHighlightStyle } = use... | zernonia/vista | 107 | Add animated subtitle to your video automatically | Vue | zernonia | zernonia | Troop Travel |
components/Transcribe/Config.vue | Vue | <script setup lang="ts">
import Slider from "@vueform/slider";
const { config } = useConfig();
// @ts-ignore
import { ColorPicker } from "vue3-colorpicker";
// @ts-ignore
import "vue3-colorpicker/style.css";
const { videoWidth, videoHeight, ratio } = usePlayback();
</script>
<template>
<div class="flex flex-col">
... | zernonia/vista | 107 | Add animated subtitle to your video automatically | Vue | zernonia | zernonia | Troop Travel |
components/Transcribe/Subtitle.vue | Vue | <script setup lang="ts">
import type { PropType } from "vue";
import type { Transcribe } from "@/utils/interface";
const props = defineProps({
chunks: { type: Array as PropType<Transcribe[][]>, required: true },
});
const { chunks } = toRefs(props);
const transcribe = useTranscription();
const { currentTime } = use... | zernonia/vista | 107 | Add animated subtitle to your video automatically | Vue | zernonia | zernonia | Troop Travel |
components/User.vue | Vue | <script setup lang="ts">
const user = useSupabaseUser();
</script>
<template>
<div>
<NuxtLink v-if="user" to="/home">
<img
class="rounded-full w-14"
referrerpolicy="no-referrer"
crossorigin="anonymous"
:src="user?.user_metadata?.avatar_url"
:alt="user?.email"
... | zernonia/vista | 107 | Add animated subtitle to your video automatically | Vue | zernonia | zernonia | Troop Travel |
composables/useConfig.ts | TypeScript | export const useConfig = () => {
const defaultConfig = {
style: {
left: 100,
top: 100,
paddingX: 14,
paddingY: 8,
borderRadius: 8,
fontSize: 20,
fontWeight: 500,
backgroundColor: "#3b82f6",
color: "#d1d5db",
},
highlight_style: {
color: "#ffffff"... | zernonia/vista | 107 | Add animated subtitle to your video automatically | Vue | zernonia | zernonia | Troop Travel |
composables/useCustomHead.ts | TypeScript | import { ComputedRef } from "vue";
export const useCustomHead = (
title?: string | ComputedRef<string>,
description?: string | ComputedRef<string>,
image?: string | ComputedRef<string>
) => {
useHead({
title,
meta: [
{
name: "description",
content: description ?? "An app that turn... | zernonia/vista | 107 | Add animated subtitle to your video automatically | Vue | zernonia | zernonia | Troop Travel |
composables/useInMemoryFile.ts | TypeScript | export const useInMemoryFile = () => useState<{ [key: string]: File }>("new-upload", () => ({}));
| zernonia/vista | 107 | Add animated subtitle to your video automatically | Vue | zernonia | zernonia | Troop Travel |
composables/usePlayback.ts | TypeScript | export const usePlayback = () => {
const el = useState<HTMLVideoElement | null>("video-element", () => null);
const videoWidth = useState("video-width", () => 0);
const videoHeight = useState("video-height", () => 0);
const ratio = computed(() => videoWidth.value / 480);
const controls = useMediaControls(el)... | zernonia/vista | 107 | Add animated subtitle to your video automatically | Vue | zernonia | zernonia | Troop Travel |
composables/useSupabase.ts | TypeScript | import { Database } from "~~/utils/database.types";
export const useSupabase = () => useSupabaseClient<Database>();
| zernonia/vista | 107 | Add animated subtitle to your video automatically | Vue | zernonia | zernonia | Troop Travel |
composables/useTranscode.ts | TypeScript | import { createFFmpeg, fetchFile } from "@ffmpeg/ffmpeg";
import { chunk } from "@/utils/functions";
import type { FFmpeg } from "@ffmpeg/ffmpeg";
export const useTranscode = createSharedComposable(() => {
let ffmpeg: FFmpeg;
const message = ref("Starting");
const video = ref<string>();
const progress = ref(0)... | zernonia/vista | 107 | Add animated subtitle to your video automatically | Vue | zernonia | zernonia | Troop Travel |
composables/useTranscription.ts | TypeScript | import { Transcribe } from "~~/utils/interface";
export const useTranscription = () => {
const transcribe = useState<Transcribe[]>("transcribe", () => []);
return transcribe;
};
| zernonia/vista | 107 | Add animated subtitle to your video automatically | Vue | zernonia | zernonia | Troop Travel |
layouts/default.vue | Vue | <script setup lang="ts"></script>
<template>
<div class="bg-white">
<div class="px-12 py-6 max-w-screen-lg mx-auto">
<header class="flex items-center justify-between">
<NuxtLink to="/" class="flex items-center">
<img class="w-12 h-12" src="~~/assets/logo.svg" alt="Vista logo" />
... | zernonia/vista | 107 | Add animated subtitle to your video automatically | Vue | zernonia | zernonia | Troop Travel |
middleware/auth.ts | TypeScript | export default defineNuxtRouteMiddleware((to, _from) => {
const user = useSupabaseUser();
if (!user.value) {
return navigateTo("/login");
}
});
| zernonia/vista | 107 | Add animated subtitle to your video automatically | Vue | zernonia | zernonia | Troop Travel |
nuxt.config.ts | TypeScript | import transformerDirective from "@unocss/transformer-directives";
import { defineNuxtConfig } from "nuxt/config";
// https://v3.nuxtjs.org/api/configuration/nuxt.config
export default defineNuxtConfig({
modules: ["@unocss/nuxt", "@vueuse/nuxt", "@nuxtjs/supabase", "@nuxt/image-edge"],
css: ["@unocss/reset/tailwin... | zernonia/vista | 107 | Add animated subtitle to your video automatically | Vue | zernonia | zernonia | Troop Travel |
pages/create.vue | Vue | <script setup lang="ts">
import { wait } from "@/utils/functions";
const { file, fileName, open } = useFileSystemAccess({
dataType: "Blob",
types: [
{
description: "Videos",
accept: {
"video/*": [".mp4", ".avi", ".wmv"],
},
},
],
excludeAcceptAllOption: true,
});
const user =... | zernonia/vista | 107 | Add animated subtitle to your video automatically | Vue | zernonia | zernonia | Troop Travel |
pages/home.vue | Vue | <script setup lang="ts">
const client = useSupabase();
const { data } = useAsyncData(async () => {
const { data } = await client.from("projects").select("id, title").order("created_at", { ascending: false });
return data;
});
definePageMeta({
middleware: "auth",
});
</script>
<template>
<div class="flex flex... | zernonia/vista | 107 | Add animated subtitle to your video automatically | Vue | zernonia | zernonia | Troop Travel |
pages/index.vue | Vue | <script setup lang="ts">
useCustomHead("Vista | Add animated subtitle to your video automatically");
</script>
<template>
<div>
<div>
<h1 class="mt-40 mb-20 text-6xl leading-tight">
Add animated subtitle <br />
to your video <span class="px-8 pt-2 pb-3 bg-blue-500 rounded-full text-white">a... | zernonia/vista | 107 | Add animated subtitle to your video automatically | Vue | zernonia | zernonia | Troop Travel |
pages/login.vue | Vue | <script setup lang="ts">
import type { Provider } from "@supabase/gotrue-js";
const client = useSupabaseAuthClient();
const user = useSupabaseUser();
const login = async (provider: Provider) => {
const { error } = await client.auth.signInWithOAuth({
provider,
options: {
redirectTo: window.location.orig... | zernonia/vista | 107 | Add animated subtitle to your video automatically | Vue | zernonia | zernonia | Troop Travel |
pages/v/[id].vue | Vue | <script setup lang="ts">
const client = useSupabase();
const inMemoryFile = useInMemoryFile();
const transcribe = useTranscription();
const { config, resetConfig } = useConfig();
const { message, progress, video: renderedResult } = useTranscode();
const channel = client
.channel("public:projects")
.on("postgres_ch... | zernonia/vista | 107 | Add animated subtitle to your video automatically | Vue | zernonia | zernonia | Troop Travel |
server/middleware/headers.ts | TypeScript | export default defineEventHandler((event) => {
event.node.res.setHeader("Cross-Origin-Embedder-Policy", "require-corp");
event.node.res.setHeader("Cross-Origin-Opener-Policy", "same-origin");
});
| zernonia/vista | 107 | Add animated subtitle to your video automatically | Vue | zernonia | zernonia | Troop Travel |
supabase/functions/transcribe-webhook/index.ts | TypeScript | import { serve } from "https://deno.land/std@0.131.0/http/server.ts";
import { createClient } from "https://esm.sh/@supabase/supabase-js@2.2.0";
serve(async (req) => {
try {
if (req.headers.get("Authorization") !== `Bearer ${Deno.env.get("WEBHOOK_KEY")}`) throw Error("Invalid key");
const { transcript_id } ... | zernonia/vista | 107 | Add animated subtitle to your video automatically | Vue | zernonia | zernonia | Troop Travel |
supabase/functions/transcribe/index.ts | TypeScript | import { serve } from "https://deno.land/std@0.131.0/http/server.ts";
import { createClient } from "https://esm.sh/@supabase/supabase-js@2.2.0";
const corsHeaders = {
"Access-Control-Allow-Origin": "*",
"Access-Control-Allow-Headers": "authorization, x-client-info, apikey, content-type",
};
serve(async (req) => {... | zernonia/vista | 107 | Add animated subtitle to your video automatically | Vue | zernonia | zernonia | Troop Travel |
utils/database.types.ts | TypeScript | export type Json =
| string
| number
| boolean
| null
| { [key: string]: Json }
| Json[]
export interface Database {
public: {
Tables: {
projects: {
Row: {
id: string
user_id: string | null
created_at: string | null
video_key: string | null
... | zernonia/vista | 107 | Add animated subtitle to your video automatically | Vue | zernonia | zernonia | Troop Travel |
utils/functions.ts | TypeScript | export const chunk = <T>(array: T[], size: number) =>
Array.from({ length: Math.ceil(array.length / size) }, (value, index) =>
array.slice(index * size, index * size + size)
);
export const wait = (m: number) => new Promise((r) => setTimeout(r, m));
export const toBlob = (canvas: HTMLCanvasElement): Promise<B... | zernonia/vista | 107 | Add animated subtitle to your video automatically | Vue | zernonia | zernonia | Troop Travel |
utils/interface.ts | TypeScript | import { StyleValue } from "nuxt/dist/app/compat/capi";
export interface Transcribe {
text: string;
modified_text?: string;
start: number;
end: number;
confidence: number;
}
export interface Config {
style: StyleValue;
highlight_style: StyleValue;
}
| zernonia/vista | 107 | Add animated subtitle to your video automatically | Vue | zernonia | zernonia | Troop Travel |
app.vue | Vue | <script setup lang="ts">
</script>
<template>
<UiTooltipProvider>
<NuxtLoadingIndicator color="hsl(var(--primary))" />
<NuxtLayout>
<NuxtPage />
</NuxtLayout>
</UiTooltipProvider>
</template>
| zernonia/vue0 | 823 | Vue version open source alternative for v0.dev | Vue | zernonia | zernonia | Troop Travel |
assets/css/tailwind.css | CSS | @tailwind base;
@tailwind components;
@tailwind utilities;
@layer base {
:root {
--background: 0 0% 100%;
--foreground: 222.2 84% 4.9%;
--muted: 210 40% 96.1%;
--muted-foreground: 215.4 16.3% 46.9%;
--popover: 0 0% 100%;
--popover-foreground: 222.2 84% 4.9%;
--card: 0 0% 100%;
... | zernonia/vue0 | 823 | Vue version open source alternative for v0.dev | Vue | zernonia | zernonia | Troop Travel |
components/DialogAction.vue | Vue | <script setup lang="ts">
defineProps<{
title?: string
description?: string
}>()
</script>
<template>
<UiDialog>
<UiDialogTrigger v-if="$slots.default" as-child>
<slot />
</UiDialogTrigger>
<UiDialogContent>
<UiDialogHeader v-if="title || description">
<UiDialogTitle v-if="title">... | zernonia/vue0 | 823 | Vue version open source alternative for v0.dev | Vue | zernonia | zernonia | Troop Travel |
components/DialogDelete.vue | Vue | <script setup lang="ts">
defineProps<{
title?: string
description?: string
}>()
</script>
<template>
<UiAlertDialog>
<UiAlertDialogTrigger as-child>
<slot />
</UiAlertDialogTrigger>
<UiAlertDialogContent>
<UiAlertDialogHeader>
<UiAlertDialogTitle>{{ title }}</UiAlertDialogTitle>
... | zernonia/vue0 | 823 | Vue version open source alternative for v0.dev | Vue | zernonia | zernonia | Troop Travel |
components/GeneratedList.vue | Vue | <script setup lang="ts">
const props = defineProps<{
data: DBComponent[] | null
}>()
const PAGE_SIZE = 15
const total = computed(() => (props.data?.length ?? 0))
const { currentPage } = useOffsetPagination({
total,
page: 1,
pageSize: PAGE_SIZE,
})
const currentPageData = computed(() => props.data?.slice(((cur... | zernonia/vue0 | 823 | Vue version open source alternative for v0.dev | Vue | zernonia | zernonia | Troop Travel |
components/Loading.vue | Vue | <script setup lang="ts">
import { cva } from 'class-variance-authority'
import { Loader2 } from 'lucide-vue-next'
defineProps<{
size?: NonNullable<Parameters<typeof loaderVariants>[0]>['size']
}>()
const loaderVariants = cva(
'animate-spin',
{
variants: {
size: {
default: 'h-6 w-6',
sm... | zernonia/vue0 | 823 | Vue version open source alternative for v0.dev | Vue | zernonia | zernonia | Troop Travel |
components/Logo.vue | Vue | <script setup lang="ts">
</script>
<template>
<svg width="100%" height="100%" viewBox="0 0 197 197" fill="none" xmlns="http://www.w3.org/2000/svg">
<path class="scale-100 group-hover:scale-125 origin-center transition duration-500" d="M159 85.5C159 119.466 131.466 147 97.5 147C63.5345 147 36 119.466 36 85.5C36 5... | zernonia/vue0 | 823 | Vue version open source alternative for v0.dev | Vue | zernonia | zernonia | Troop Travel |
components/OgImage/Generated.vue | Vue | <script setup lang="ts">
withDefaults(defineProps<{
title?: string
avatarUrl?: string
imageUrl?: string
}>(), {
title: 'title',
})
</script>
<template>
<div class="relative h-full w-full flex items-center justify-center bg-slate-100">
<div class="flex items-center justify-center w-full h-full">
<im... | zernonia/vue0 | 823 | Vue version open source alternative for v0.dev | Vue | zernonia | zernonia | Troop Travel |
components/Output.client.vue | Vue | <!-- eslint-disable vue/one-component-per-file -->
<script setup lang="ts">
import { computed, defineComponent, ref, watch } from 'vue'
import { compileScript, parse } from '@vue/compiler-sfc'
import * as Icon from 'lucide-vue-next'
import { useToast } from '@/components/ui/toast'
const props = defineProps<{
sfcStri... | zernonia/vue0 | 823 | Vue version open source alternative for v0.dev | Vue | zernonia | zernonia | Troop Travel |
components/OutputCode.client.vue | Vue | <script setup lang="ts">
import { getHighlighter } from 'shikiji'
const props = defineProps<{
sfcString: string
}>()
const highlighter = await getHighlighter({
langs: ['vue'],
themes: [
{
name: 'my-theme',
settings: [
{
scope: 'string',
settings: {
foregro... | zernonia/vue0 | 823 | Vue version open source alternative for v0.dev | Vue | zernonia | zernonia | Troop Travel |
components/OutputWrapper.vue | Vue | <script setup lang="ts">
</script>
<template>
<NuxtErrorBoundary>
<Suspense>
<slot />
<template #fallback>
<p> loading...</p>
</template>
</Suspense>
<template #error="{ error }">
<p>An error occurred: {{ error }}</p>
</template>
</NuxtErrorBoundary>
</template>
| zernonia/vue0 | 823 | Vue version open source alternative for v0.dev | Vue | zernonia | zernonia | Troop Travel |
components/PromptInput.vue | Vue | <script setup lang="ts">
import { SparklesIcon } from 'lucide-vue-next'
const props = defineProps<{
modelValue?: string
loading?: boolean
disabled?: boolean
placeholder?: string
}>()
const emits = defineEmits<{
'update:modelValue': [payload: string]
'submit': [prompt: string]
}>()
const modelValue = useV... | zernonia/vue0 | 823 | Vue version open source alternative for v0.dev | Vue | zernonia | zernonia | Troop Travel |
components/UserMenu.vue | Vue | <script setup lang="ts">
import { Bug, GalleryThumbnails, Github, LogOut, Menu, MessageCircleQuestion } from 'lucide-vue-next'
const openaiKey = useOpenAIKey()
const { loggedIn, user, clear } = useUserSession()
</script>
<template>
<UiDropdownMenu>
<UiDropdownMenuTrigger as-child>
<UiButton class="relativ... | zernonia/vue0 | 823 | Vue version open source alternative for v0.dev | Vue | zernonia | zernonia | Troop Travel |
components/ui/accordion/Accordion.vue | Vue | <script setup lang="ts">
import {
AccordionRoot,
type AccordionRootEmits,
type AccordionRootProps,
useEmitAsProps,
} from 'radix-vue'
const props = defineProps<AccordionRootProps>()
const emits = defineEmits<AccordionRootEmits>()
</script>
<template>
<AccordionRoot v-bind="{ ...props, ...useEmitAsProps(emit... | zernonia/vue0 | 823 | Vue version open source alternative for v0.dev | Vue | zernonia | zernonia | Troop Travel |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.