Skip to content

Commit

Permalink
Add git-skyline model extension
Browse files Browse the repository at this point in the history
  • Loading branch information
HuakunShen committed May 28, 2024
1 parent a956101 commit 9d5e8f1
Show file tree
Hide file tree
Showing 154 changed files with 4,282 additions and 2 deletions.
Binary file removed ci/bun.lockb
Binary file not shown.
4 changes: 3 additions & 1 deletion extension-templates/jarvis-ext-astro/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
{
"$schema": "https://extensions.jarvis.huakun.tech/schema.json",
"name": "jarvis-ext-astro",
"type": "module",
"version": "0.0.1",
"jarvis": {},
"scripts": {
"dev": "astro dev",
"start": "astro dev",
Expand Down Expand Up @@ -29,4 +31,4 @@
"@iconify/vue": "^4.1.2",
"typescript": "^5.4.5"
}
}
}
2 changes: 2 additions & 0 deletions extension-templates/jarvis-ext-nuxt/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
{
"$schema": "https://extensions.jarvis.huakun.tech/schema.json",
"name": "jarvis-ext-nuxt",
"private": true,
"type": "module",
"jarvis": {},
"scripts": {
"build": "nuxt generate",
"dev": "nuxt dev",
Expand Down
2 changes: 2 additions & 0 deletions extension-templates/jarvis-ext-react/package.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
{
"$schema": "https://extensions.jarvis.huakun.tech/schema.json",
"name": "jarvis-ext-react",
"private": true,
"version": "0.0.0",
"type": "module",
"jarvis": {},
"scripts": {
"dev": "vite",
"build": "tsc && vite build",
Expand Down
2 changes: 2 additions & 0 deletions extension-templates/jarvis-ext-svelte/package.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
{
"$schema": "https://extensions.jarvis.huakun.tech/schema.json",
"name": "jarvis-ext-svelte",
"private": true,
"version": "0.0.0",
"type": "module",
"jarvis": {},
"scripts": {
"dev": "vite",
"build": "vite build",
Expand Down
2 changes: 2 additions & 0 deletions extension-templates/jarvis-ext-vue/package.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
{
"$schema": "https://extensions.jarvis.huakun.tech/schema.json",
"name": "jarvis-ext-vue",
"private": true,
"version": "0.0.0",
"type": "module",
"jarvis": {},
"scripts": {
"dev": "vite",
"build": "vue-tsc && vite build",
Expand Down
24 changes: 24 additions & 0 deletions extensions/git-skyline/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# Logs
logs
*.log
npm-debug.log*
yarn-debug.log*
yarn-error.log*
pnpm-debug.log*
lerna-debug.log*

node_modules
dist
dist-ssr
*.local

# Editor directories and files
.vscode/*
!.vscode/extensions.json
.idea
.DS_Store
*.suo
*.ntvs*
*.njsproj
*.sln
*.sw?
9 changes: 9 additions & 0 deletions extensions/git-skyline/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# Vue 3 + TypeScript + Vite

This template should help get you started developing with Vue 3 and TypeScript in Vite. The template uses Vue 3 `<script setup>` SFCs, check out the [script setup docs](https://v3.vuejs.org/api/sfc-script-setup.html#sfc-script-setup) to learn more.

## Recommended Setup

- [VS Code](https://code.visualstudio.com/) + [Vue - Official](https://marketplace.visualstudio.com/items?itemName=Vue.volar) (previously Volar) and disable Vetur

- Use [vue-tsc](https://github.com/vuejs/language-tools/tree/master/packages/tsc) for performing the same type checking from the command line, or for generating d.ts files for SFCs.
16 changes: 16 additions & 0 deletions extensions/git-skyline/components.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
{
"$schema": "https://shadcn-vue.com/schema.json",
"style": "new-york",
"typescript": true,
"tailwind": {
"config": "tailwind.config.js",
"css": "src/index.css",
"baseColor": "slate",
"cssVariables": true
},
"framework": "vite",
"aliases": {
"components": "@/components",
"utils": "@/lib/utils"
}
}
13 changes: 13 additions & 0 deletions extensions/git-skyline/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<link rel="icon" type="image/svg+xml" href="/vite.svg" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Vite + Vue + TS</title>
</head>
<body>
<div id="app"></div>
<script type="module" src="/src/main.ts"></script>
</body>
</html>
71 changes: 71 additions & 0 deletions extensions/git-skyline/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
{
"$schema": "https://extensions.jarvis.huakun.tech/schema.json",
"name": "jarvis-ext-git-skyline-3d",
"private": true,
"version": "0.0.0",
"type": "module",
"jarvis": {
"name": "Git Skyline",
"identifier": "tech.huakun.jarvis-ext-git-skyline",
"shortDescription": "Git Skyline 3D Model",
"longDescription": "Display Git Skyline 3D Model",
"icon": {
"icon": "tabler:building-skyscraper",
"type": "iconify"
},
"demoImages": [],
"uiCmds": [
{
"name": "Git Skyline",
"main": "dist",
"window": {
"transparent": true,
"decorations": false
},
"description": "3D Model",
"devMain": "http://localhost:5173",
"cmds": [
{
"type": "text",
"value": "git-skyline"
}
]
}
]
},
"scripts": {
"dev": "vite",
"build": "vue-tsc && vite build",
"preview": "vite preview"
},
"dependencies": {
"@internationalized/date": "^3.5.4",
"@radix-icons/vue": "^1.0.0",
"@vee-validate/zod": "^4.12.8",
"@vueuse/core": "^10.9.0",
"class-variance-authority": "^0.7.0",
"clsx": "^2.1.1",
"jarvis-api": "0.0.2-alpha.6",
"lucide-vue-next": "^0.378.0",
"pinia": "^2.1.7",
"pinia-plugin-persistedstate": "^3.2.1",
"radix-vue": "^1.7.4",
"tailwind-merge": "^2.3.0",
"tailwindcss-animate": "^1.0.7",
"vee-validate": "^4.12.8",
"vue": "^3.4.21",
"vue-router": "4",
"zod": "^3.23.8"
},
"devDependencies": {
"@iconify-json/radix-icons": "^1.1.14",
"@iconify/vue": "^4.1.2",
"@types/node": "^20.12.11",
"@vitejs/plugin-vue": "^5.0.4",
"autoprefixer": "^10.4.19",
"tailwindcss": "^3.4.3",
"typescript": "^5.2.2",
"vite": "^5.2.0",
"vue-tsc": "^2.0.6"
}
}
1 change: 1 addition & 0 deletions extensions/git-skyline/public/vite.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
24 changes: 24 additions & 0 deletions extensions/git-skyline/src/App.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
<script setup lang="ts">
import { useColorMode } from "@vueuse/core";
import { onMounted } from "vue";
import { window } from "jarvis-api/ui";
import Toaster from "@/components/ui/toast/Toaster.vue";
useColorMode();
onMounted(() => {
document.addEventListener("keydown", (e) => {
if (e.key === "Escape") {
window.destroyWindow();
}
});
document.addEventListener("dblclick", () => {
window.destroyWindow();
});
});
</script>

<template>
<Toaster />
<RouterView />
</template>
49 changes: 49 additions & 0 deletions extensions/git-skyline/src/Main.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
<script setup lang="ts">
import { onMounted, ref } from "vue";
import ContextMenu from "./components/context-menu.vue";
import { useAppState } from "./lib/store";
import { router } from "./lib/router";
import { window } from "jarvis-api/ui";
import { cn } from "@/lib/utils";
import Card from "./components/ui/card/Card.vue";
const appState = useAppState();
const showInstructions = ref(true);
onMounted(() => {
if (!appState.gitSkylineUrl) {
router.push("/setting");
}
document.addEventListener("keydown", (e) => {
if (e.key === "Escape") {
window.destroyWindow();
}
});
setTimeout(() => {
showInstructions.value = false;
}, 5000);
});
</script>
<template>
<div class="h-screen w-full absolute z-0">
<iframe :src="appState.gitSkylineUrl" width="100%" height="100%" frameBorder="0" class="grow" />
</div>
<div class="h-screen flex flex-col">
<div :class="cn('h-32 z-50')" data-tauri-drag-region>
<Card v-if="showInstructions" class="w-full h-full flex justify-center items-center">
<h1 class="text-3xl z-0 select-none">
Left Click and Drag this region to move this window
</h1>
</Card>
</div>
<div class="grow"></div>
<div :class="cn('h-32 z-50')" data-tauri-drag-region>
<Card v-if="showInstructions" class="w-full h-full flex flex-col justify-center items-center">
<h1 class="text-3xl z-0 select-none">Right Click on This Region to Go To Settings</h1>
<h1 class="text-3xl z-0 select-none">Press Escape To Close Window</h1>
<ContextMenu />
</Card>
</div>
</div>
</template>
104 changes: 104 additions & 0 deletions extensions/git-skyline/src/SettingPage.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,104 @@
<script setup lang="ts">
import * as z from "zod";
import { onMounted, ref } from "vue";
import { Input } from "@/components/ui/input";
import { Label } from "@/components/ui/label";
import { Button } from "@/components/ui/button";
import { toast } from "@/components/ui/toast";
import { InfoIcon } from "lucide-vue-next";
import { window } from "jarvis-api/ui";
import { Popover, PopoverContent, PopoverTrigger } from "@/components/ui/popover";
import {
Card,
CardContent,
CardDescription,
CardFooter,
CardHeader,
CardTitle,
} from "@/components/ui/card";
import { useAppState } from "./lib/store";
import { router } from "./lib/router";
onMounted(() => {
document.addEventListener("keydown", (e) => {
if (e.key === "Escape") {
window.destroyWindow();
}
});
});
const appState = useAppState();
function onSubmit(e: Event) {
e.preventDefault();
}
const url = ref("");
function updateUrl() {
const parse = z.string().url().safeParse(url.value);
if (parse.error) {
toast({
title: "Fail to Set URL",
description: parse.error.toString(),
variant: "destructive",
});
} else {
appState.setUrl(url.value);
toast({
title: "URL Set",
});
router.push("/");
}
}
</script>

<template>
<div
class="h-screen flex items-center justify-center bg-background/50 rounded-lg"
data-tauri-drag-region
>
<Card data-tauri-drag-region>
<form @submit="onSubmit">
<CardHeader>
<CardTitle>Setting</CardTitle>
<CardDescription>Set Your GitHub Username or Git Skyline iframe URL</CardDescription>
</CardHeader>
<CardContent>
<div class="grid items-center w-full gap-4">
<div class="flex flex-col space-y-1.5">
<Label for="url">Git Skyline URL</Label>
<Input
id="url"
placeholder="Git Skyline URL"
v-model="url"
:default-value="appState.gitSkylineUrl"
/>
</div>
<div class="text-sm text-muted-foreground flex items-center space-x-2">
Go To <Button class="px-1" variant="link">https://git-skyline.huakun.tech</Button> to
Generate a URL
<Popover>
<PopoverTrigger><InfoIcon class="w-5 h-5" /></PopoverTrigger>
<PopoverContent>
<span class="">
Go to
<Button class="px-1" variant="link">https://git-skyline.huakun.tech</Button>,
enter your Username. A 3D model will be generated. Click on
<strong>Embed Page</strong> button in the top right corner to generate a embed
URL, and paste it here.
</span>
</PopoverContent>
</Popover>
</div>
</div>
</CardContent>
<CardFooter>
<div class="flex flex-col space-y-3 w-full">
<Button @click="updateUrl" type="submit">Update</Button>
<router-link to="/" class="w-full">
<Button class="w-full">Go Back to Git Skyline</Button>
</router-link>
</div>
</CardFooter>
</form>
</Card>
</div>
</template>
1 change: 1 addition & 0 deletions extensions/git-skyline/src/assets/vue.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading

0 comments on commit 9d5e8f1

Please sign in to comment.