mirror of
https://github.com/DiscordFactory/website-documentation.git
synced 2026-01-14 17:34:22 +01:00
🚧 Work in progress
This commit is contained in:
174
src/components/Documentation.vue
Normal file
174
src/components/Documentation.vue
Normal file
@@ -0,0 +1,174 @@
|
|||||||
|
<!-- This example requires Tailwind CSS v2.0+ -->
|
||||||
|
<template>
|
||||||
|
<div class="sm:fixed z-40 top-0 left-0 sm:pt-[64px] h-screen flex overflow-hidden bg-gray-100">
|
||||||
|
<TransitionRoot as="template" :show="sidebarOpen">
|
||||||
|
<Dialog
|
||||||
|
as="div"
|
||||||
|
class="fixed inset-0 flex z-40 md:hidden"
|
||||||
|
@close="sidebarOpen = false">
|
||||||
|
<TransitionChild
|
||||||
|
as="template"
|
||||||
|
enter="transition-opacity ease-linear duration-300"
|
||||||
|
enter-from="opacity-0"
|
||||||
|
enter-to="opacity-100"
|
||||||
|
leave="transition-opacity ease-linear duration-300"
|
||||||
|
leave-from="opacity-100"
|
||||||
|
leave-to="opacity-0">
|
||||||
|
<DialogOverlay class="fixed inset-0 bg-gray-600 bg-opacity-75" />
|
||||||
|
</TransitionChild>
|
||||||
|
<TransitionChild
|
||||||
|
as="template"
|
||||||
|
enter="transition ease-in-out duration-300 transform"
|
||||||
|
enter-from="-translate-x-full"
|
||||||
|
enter-to="translate-x-0"
|
||||||
|
leave="transition ease-in-out duration-300 transform"
|
||||||
|
leave-from="translate-x-0"
|
||||||
|
leave-to="-translate-x-full">
|
||||||
|
<div class="relative flex-1 flex flex-col max-w-xs w-full bg-white">
|
||||||
|
<TransitionChild
|
||||||
|
as="template"
|
||||||
|
enter="ease-in-out duration-300"
|
||||||
|
enter-from="opacity-0"
|
||||||
|
enter-to="opacity-100"
|
||||||
|
leave="ease-in-out duration-300"
|
||||||
|
leave-from="opacity-100"
|
||||||
|
leave-to="opacity-0">
|
||||||
|
<div class="absolute top-0 right-0 -mr-12 pt-2">
|
||||||
|
<button
|
||||||
|
type="button"
|
||||||
|
class="ml-1 flex items-center justify-center h-10 w-10 rounded-full focus:outline-none focus:ring-2 focus:ring-inset focus:ring-white"
|
||||||
|
@click="sidebarOpen = false">
|
||||||
|
<span class="sr-only">Close sidebar</span>
|
||||||
|
<XIcon class="h-6 w-6 text-white" aria-hidden="true" />
|
||||||
|
</button>
|
||||||
|
</div>
|
||||||
|
</TransitionChild>
|
||||||
|
<div class="flex-1 h-0 pt-5 pb-4 overflow-y-auto">
|
||||||
|
<div class="flex-shrink-0 flex items-center px-4">
|
||||||
|
<img
|
||||||
|
class="h-8 w-auto"
|
||||||
|
src="https://tailwindui.com/img/logos/workflow-logo-indigo-600-mark-gray-800-text.svg"
|
||||||
|
alt="Workflow" />
|
||||||
|
</div>
|
||||||
|
<nav class="mt-5 px-2 space-y-2">
|
||||||
|
<template v-for="item in documentation">
|
||||||
|
<div v-if="item.isMenu">
|
||||||
|
<p>{{ item.label }}</p>
|
||||||
|
<router-link
|
||||||
|
v-for="link in item.child"
|
||||||
|
:key="link.label"
|
||||||
|
:to="link.href"
|
||||||
|
class="text-gray-600 hover:bg-gray-50 hover:text-gray-900 group flex items-center px-2 py-2 text-base font-medium rounded-md">
|
||||||
|
{{ link.label }}
|
||||||
|
</router-link>
|
||||||
|
</div>
|
||||||
|
<router-link
|
||||||
|
v-else
|
||||||
|
:key="item.name"
|
||||||
|
:to="item.href"
|
||||||
|
:class="[item.current ? 'bg-gray-100 text-gray-900' : 'text-gray-600 hover:bg-gray-50 hover:text-gray-900', 'group flex items-center px-2 py-2 text-base font-medium rounded-md']">
|
||||||
|
{{ item.label }}
|
||||||
|
</router-link>
|
||||||
|
</template>
|
||||||
|
</nav>
|
||||||
|
</div>
|
||||||
|
<div class="flex-shrink-0 flex border-t border-gray-200 p-4">
|
||||||
|
<a href="#" class="flex-shrink-0 group block">
|
||||||
|
<div class="flex items-center">
|
||||||
|
<div>
|
||||||
|
<img class="inline-block h-10 w-10 rounded-full" src="https://images.unsplash.com/photo-1472099645785-5658abf4ff4e?ixlib=rb-1.2.1&ixid=eyJhcHBfaWQiOjEyMDd9&auto=format&fit=facearea&facepad=2&w=256&h=256&q=80" alt="" />
|
||||||
|
</div>
|
||||||
|
<div class="ml-3">
|
||||||
|
<p class="text-base font-medium text-gray-700 group-hover:text-gray-900">
|
||||||
|
Tom Cook
|
||||||
|
</p>
|
||||||
|
<p class="text-sm font-medium text-gray-500 group-hover:text-gray-700">
|
||||||
|
View profile
|
||||||
|
</p>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</a>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</TransitionChild>
|
||||||
|
<div class="flex-shrink-0 w-14">
|
||||||
|
<!-- Force sidebar to shrink to fit close icon -->
|
||||||
|
</div>
|
||||||
|
</Dialog>
|
||||||
|
</TransitionRoot>
|
||||||
|
|
||||||
|
<!-- Static sidebar for desktop -->
|
||||||
|
<div class="hidden md:flex md:flex-shrink-0">
|
||||||
|
<div class="flex flex-col w-64">
|
||||||
|
<!-- Sidebar component, swap this element with another sidebar if you like -->
|
||||||
|
<div class="flex-1 flex flex-col min-h-0 border-r border-gray-200 dark:border-gray-700 bg-white dark:bg-gray-900 transition duration-300">
|
||||||
|
<div class="flex-1 flex flex-col pt-5 pb-4 overflow-y-auto">
|
||||||
|
<nav class="mt-5 flex-1 px-2">
|
||||||
|
<template v-for="item in documentation">
|
||||||
|
<div v-if="item.isMenu">
|
||||||
|
<p class="text-blue-900 dark:text-gray-600 font-bold">{{ item.label }}</p>
|
||||||
|
<router-link
|
||||||
|
v-for="link in item.child"
|
||||||
|
:key="link.label"
|
||||||
|
:to="link.href"
|
||||||
|
class="text-gray-600 dark:text-gray-200 hover:bg-gray-50 dark:hover:bg-gray-800 hover:text-gray-900 dark:hover:text-gray-100 transition duration-200 group flex items-center px-2 py-2 text-base font-medium rounded-md">
|
||||||
|
{{ link.label }}
|
||||||
|
</router-link>
|
||||||
|
</div>
|
||||||
|
<router-link
|
||||||
|
v-else
|
||||||
|
:key="item.name"
|
||||||
|
:to="item.href"
|
||||||
|
:class="[item.current ? 'bg-gray-100 text-gray-900' : 'text-gray-600 hover:bg-gray-50 hover:text-gray-900', 'group flex items-center px-2 py-2 text-base font-medium rounded-md']">
|
||||||
|
{{ item.label }}
|
||||||
|
</router-link>
|
||||||
|
</template>
|
||||||
|
</nav>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="flex flex-col w-0 flex-1 overflow-hidden">
|
||||||
|
<div class="md:hidden pl-1 pt-1 sm:pl-3 sm:pt-3">
|
||||||
|
<button type="button" class="-ml-0.5 -mt-0.5 h-12 w-12 inline-flex items-center justify-center rounded-md text-gray-500 hover:text-gray-900 focus:outline-none focus:ring-2 focus:ring-inset focus:ring-indigo-500" @click="sidebarOpen = true">
|
||||||
|
<span class="sr-only">Open sidebar</span>
|
||||||
|
<MenuIcon class="h-6 w-6" aria-hidden="true" />
|
||||||
|
</button>
|
||||||
|
</div>
|
||||||
|
<main class="flex-1 relative z-0 overflow-y-auto focus:outline-none">
|
||||||
|
<div class="py-6">
|
||||||
|
<div class="max-w-7xl mx-auto px-4 sm:px-6 md:px-8">
|
||||||
|
<h1 class="text-2xl font-semibold text-gray-900">Dashboard</h1>
|
||||||
|
</div>
|
||||||
|
<div class="max-w-7xl mx-auto px-4 sm:px-6 md:px-8">
|
||||||
|
<!-- Replace with your content -->
|
||||||
|
<div class="py-4">
|
||||||
|
<div class="border-4 border-dashed border-gray-200 rounded-lg h-96" />
|
||||||
|
</div>
|
||||||
|
<!-- /End replace -->
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</main>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script setup lang="ts">
|
||||||
|
import { ref } from 'vue'
|
||||||
|
import { Dialog, DialogOverlay, TransitionChild, TransitionRoot } from '@headlessui/vue'
|
||||||
|
import { documentation } from '../utils/Navigation'
|
||||||
|
import {
|
||||||
|
CalendarIcon,
|
||||||
|
ChartBarIcon,
|
||||||
|
FolderIcon,
|
||||||
|
HomeIcon,
|
||||||
|
InboxIcon,
|
||||||
|
MenuIcon,
|
||||||
|
UsersIcon,
|
||||||
|
XIcon,
|
||||||
|
} from '@heroicons/vue/outline'
|
||||||
|
|
||||||
|
console.log(documentation)
|
||||||
|
|
||||||
|
const sidebarOpen = ref(false)
|
||||||
|
</script>
|
||||||
@@ -1,6 +1,6 @@
|
|||||||
<!-- This example requires Tailwind CSS v2.0+ -->
|
<!-- This example requires Tailwind CSS v2.0+ -->
|
||||||
<template>
|
<template>
|
||||||
<Disclosure as="nav" class="fixed top-0 left-0 w-screen bg-white dark:bg-gray-900 transition duration-200 shadow" v-slot="{ open }">
|
<Disclosure as="nav" class="fixed z-50 top-0 left-0 w-screen bg-white dark:bg-gray-900 transition duration-200 shadow" v-slot="{ open }">
|
||||||
<div class="max-w-7xl mx-auto px-2 sm:px-6 lg:px-8">
|
<div class="max-w-7xl mx-auto px-2 sm:px-6 lg:px-8">
|
||||||
<div class="relative flex justify-between h-16">
|
<div class="relative flex justify-between h-16">
|
||||||
<div class="absolute inset-y-0 left-0 flex items-center sm:hidden">
|
<div class="absolute inset-y-0 left-0 flex items-center sm:hidden">
|
||||||
|
|||||||
@@ -4,12 +4,14 @@ import { createApp } from 'vue'
|
|||||||
import App from './templates/layouts/Base.vue'
|
import App from './templates/layouts/Base.vue'
|
||||||
import { createRouter, createWebHistory } from 'vue-router'
|
import { createRouter, createWebHistory } from 'vue-router'
|
||||||
import Default from './templates/modules/default/Routes'
|
import Default from './templates/modules/default/Routes'
|
||||||
|
import Documentation from './templates/modules/documentation/Routes'
|
||||||
import Error from './templates/modules/default/Error.vue'
|
import Error from './templates/modules/default/Error.vue'
|
||||||
|
|
||||||
const router = createRouter({
|
const router = createRouter({
|
||||||
history: createWebHistory(),
|
history: createWebHistory(),
|
||||||
routes: [
|
routes: [
|
||||||
...Default,
|
...Default,
|
||||||
|
...Documentation,
|
||||||
{ path: '/:pathMatch(.*)*', component: Error }
|
{ path: '/:pathMatch(.*)*', component: Error }
|
||||||
]
|
]
|
||||||
})
|
})
|
||||||
|
|||||||
@@ -3,7 +3,6 @@ import Home from './Home.vue'
|
|||||||
|
|
||||||
const routes: RouteRecordRaw[] = [
|
const routes: RouteRecordRaw[] = [
|
||||||
{ path: '/', component: Home },
|
{ path: '/', component: Home },
|
||||||
{ path: '/documentation', component: Home }
|
|
||||||
]
|
]
|
||||||
|
|
||||||
export default routes
|
export default routes
|
||||||
8
src/templates/modules/documentation/Routes.ts
Normal file
8
src/templates/modules/documentation/Routes.ts
Normal file
@@ -0,0 +1,8 @@
|
|||||||
|
import { RouteRecordRaw } from 'vue-router'
|
||||||
|
import Index from './index.vue'
|
||||||
|
|
||||||
|
const routes: RouteRecordRaw[] = [
|
||||||
|
{ path: '/documentation', component: Index },
|
||||||
|
]
|
||||||
|
|
||||||
|
export default routes
|
||||||
14
src/templates/modules/documentation/index.vue
Normal file
14
src/templates/modules/documentation/index.vue
Normal file
@@ -0,0 +1,14 @@
|
|||||||
|
<template>
|
||||||
|
<Documentation>
|
||||||
|
dd
|
||||||
|
</Documentation>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script setup lang="ts">
|
||||||
|
import Documentation from '../../../components/Documentation.vue'
|
||||||
|
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style>
|
||||||
|
|
||||||
|
</style>
|
||||||
@@ -1,5 +1,6 @@
|
|||||||
import { NavbarLink } from '../types'
|
import { NavbarLink } from '../types'
|
||||||
import { github, twitter } from './Icons'
|
import { github, twitter } from './Icons'
|
||||||
|
import { CalendarIcon, ChartBarIcon, FolderIcon, HomeIcon, InboxIcon, UsersIcon } from '@heroicons/vue/outline'
|
||||||
|
|
||||||
export const links: NavbarLink[] = [
|
export const links: NavbarLink[] = [
|
||||||
{ label: 'Home', path: '/', local: true },
|
{ label: 'Home', path: '/', local: true },
|
||||||
@@ -10,4 +11,14 @@ export const links: NavbarLink[] = [
|
|||||||
export const socials = [
|
export const socials = [
|
||||||
twitter,
|
twitter,
|
||||||
github,
|
github,
|
||||||
]
|
]
|
||||||
|
|
||||||
|
export const documentation = [
|
||||||
|
{
|
||||||
|
label: 'Basic',
|
||||||
|
isMenu: true,
|
||||||
|
child: [
|
||||||
|
{ label: 'Getting starting', href: '/documentation/getting-starting', isMenu: true },
|
||||||
|
]
|
||||||
|
},
|
||||||
|
]
|
||||||
|
|||||||
Reference in New Issue
Block a user