improve home page

This commit is contained in:
alice 2024-10-28 20:08:31 +01:00
parent 27a2cdcaeb
commit 08d10184fb
6 changed files with 110 additions and 25 deletions

View file

@ -1,6 +1,6 @@
//import { defineConfig } from "vitepress" //import { defineConfig } from "vitepress"
import { withMermaid } from "vitepress-plugin-mermaid"; import { withMermaid } from "vitepress-plugin-mermaid";
import banner from "vite-plugin-banner" import { tabsMarkdownPlugin } from 'vitepress-plugin-tabs'
// https://vitepress.dev/reference/site-config // https://vitepress.dev/reference/site-config
export default withMermaid({ export default withMermaid({
@ -9,6 +9,12 @@ export default withMermaid({
description: "A reactive UI library for Luau.", description: "A reactive UI library for Luau.",
base: "/vide/", base: "/vide/",
head: [["link", { rel: "icon", href: "/vide/logo.svg" }]], head: [["link", { rel: "icon", href: "/vide/logo.svg" }]],
markdown: {
config(md) {
md.use(tabsMarkdownPlugin)
}
},
themeConfig: { themeConfig: {
logo: "/logo.svg", logo: "/logo.svg",

View file

@ -1,9 +1,13 @@
// .vitepress/theme/index.js // .vitepress/theme/index.js
import DefaultTheme from 'vitepress/theme' import DefaultTheme from 'vitepress/theme'
import layout from './layout.vue' import layout from './layout.vue'
import { enhanceAppWithTabs } from 'vitepress-plugin-tabs/client'
import './vars.css' import './vars.css'
export default { export default {
extends: DefaultTheme, extends: DefaultTheme,
enhanceApp({ app }) {
enhanceAppWithTabs(app)
},
Layout: layout Layout: layout
} }

View file

@ -1,6 +1,6 @@
.banner { .banner {
background-color: var(--vp-button-brand-bg) !important; background-color: var(--vp-button-brand-bg);
color: rgba(255, 255, 255, 100%); color: var(--vp-button-brand-text);
width: 100%; width: 100%;
height: 1.5rem; height: 1.5rem;
text-align: center; text-align: center;
@ -16,42 +16,65 @@
margin-top: 1.5rem; margin-top: 1.5rem;
} }
.plugin-tabs--tab-list {
background-color: var(--vp-c-bg-alt);
}
.VPNavBar.home:not(.top) {
backdrop-filter: blur(0.5rem);
background-color: rgba(255, 255, 255, 0%) !important;
}
.VPNavBar.home > .divider {
opacity: 0;
}
#VPContent.is-home {
background-color: rgba(255, 255, 255, 0%);
background-image: radial-gradient(
var(--vp-c-brand-2), var(--vp-c-bg)
);
}
:root { :root {
--vp-c-brand-1: #3086ff; --vp-c-brand-1: #3086ff;
--vp-c-brand-2: #75aeff;
--vp-button-brand-bg: #3661A2; --vp-button-brand-bg: #3661A2;
--vp-button-brand-hover-bg: #24447F; --vp-button-brand-hover-bg: #24447F;
--vp-button-brand-press-bg: #4896F3; --vp-button-brand-press-bg: #4896F3;
--vp-home-hero-name-color: transparent; --vp-home-hero-name-color: transparent;
--vp-home-hero-name-background: -webkit-linear-gradient(120deg, #3661A2, #4896F3); --vp-home-hero-name-background: -webkit-linear-gradient(120deg, #3661A2, #4896F3);
--vp-home-hero-logo-background: -webkit-linear-gradient(120deg, #3661A2, #4896F3); --vp-home-hero-logo-background: -webkit-linear-gradient(120deg, #3661A2, #4896F3);
--vp-home-hero-image-background-image: linear-gradient( --vp-home-hero-image-background-image: linear-gradient(
135deg, 135deg,
#1D314F 50%, #1D314F 50%,
#2A57A2 50% #2A57A2 50%
); );
--vp-home-hero-image-filter: blur(96px); --vp-home-hero-image-filter: blur(96px);
--vp-c-bg: #f2f5f8; --vp-c-bg: #f2f5f8;
--vp-c-bg-alt: #dfe8f5; --vp-c-bg-alt: #dfe8f5;
--vp-c-bg-elv: #dde7f4; --vp-c-bg-elv: #dde7f4;
--vp-c-bg-soft: #e8f1fe; --vp-c-bg-soft: #e8f1fe;
--vp-c-border: #c0c3c6; --vp-c-border: #c0c3c6;
--vp-c-divider: #dfe2e6; --vp-c-divider: #dfe2e6;
--vp-c-gutter: #dfe2e6; --vp-c-gutter: #dfe2e6;
--vp-plugin-tabs-tab-bg: var(--vp-c-bg);
} }
.dark { .dark {
--vp-c-brand-2: #234782;
--vp-c-bg: #0d131b; --vp-c-bg: #0d131b;
--vp-c-bg-alt: #111720; --vp-c-bg-alt: #111720;
--vp-c-bg-elv: #182231; --vp-c-bg-elv: #182231;
--vp-c-bg-soft: #182231; --vp-c-bg-soft: #182231;
--vp-c-border: #111720; --vp-c-border: #111720;
--vp-c-divider: #181d27; --vp-c-divider: #1d273c;
--vp-c-gutter: #181d27; --vp-c-gutter: #181d27;
--vp-home-hero-image-background-image: linear-gradient( --vp-home-hero-image-background-image: linear-gradient(

View file

@ -1,17 +1,20 @@
--- ---
# https://vitepress.dev/reference/default-theme-home-page # https://vitepress.dev/reference/default-theme-home-page
layout: home layout: home
next:
text: 'Introduction'
link: '/tut/crash-course/1-introduction'
hero: hero:
name: Vide name: Vide
text: "" text: ""
tagline: A reactive UI library for Luau. tagline: A reactive UI and state library for Luau.
image: image:
src: /logo.svg src: /logo.svg
alt: Vide alt: Vide
actions: actions:
- theme: brand - theme: brand
text: Crash Course text: Quick Start
link: /tut/crash-course/1-introduction link: /tut/crash-course/1-introduction
- theme: alt - theme: alt
text: API Reference text: API Reference
@ -21,7 +24,55 @@ features:
- title: Reactively driven - title: Reactively driven
details: Powerful and modern primitives inspired by SolidJS to build fluid UI with little friction details: Powerful and modern primitives inspired by SolidJS to build fluid UI with little friction
- title: Declarative and concise - title: Declarative and concise
details: Syntax built to be minimal while also obvious and easy to understand to anyone details: Syntax built to be minimal and clean while also obvious and easy to understand to anyone
- title: Fully Luau Typecheckable - title: Fully Luau Typecheckable
details: Ensure you write correct code through the Luau typechecking engine. details: Ensure you write correct and robust code through the Luau typechecking engine.
--- ---
## Installation
Vide can be installed through 3 different ways.
:::tabs
== Wally
Add the following line to your `wally.toml` and then re-install your packages
```toml
[dependencies]
vide = centau/vide@0.3.1
```
== Roblox
im so sorry you have to use rojo and build it yourself or ask someone in ross to build a vide rbxm for you :sob:
cen is too busy working on system verilog
:::
## Quick Examples
A simple counter element that counts up when you click on it.
```luau
local vide = require("vide")
local source = vide.source
local create = vide.create
local function Counter()
local count = source(0)
return create "TextButton" {
Size = UDim2.fromOffset(200, 50),
Text = function()
return `count: {count()}`
end,
Activated = function()
count(count() + 1)
end
}
end
return Counter
```

View file

@ -7,6 +7,7 @@
}, },
"devDependencies": { "devDependencies": {
"vitepress": "1.4.1", "vitepress": "1.4.1",
"vitepress-plugin-mermaid": "2.0.17" "vitepress-plugin-mermaid": "2.0.17",
"vitepress-plugin-tabs": "^0.5.0"
} }
} }

View file

@ -1,4 +1,4 @@
<svg width="150" height="88" viewBox="15 7 115 68" fill="none" xmlns="http://www.w3.org/2000/svg"> <svg width="375" height="220" viewBox="15 7 115 68" fill="none" xmlns="http://www.w3.org/2000/svg">
<g filter="url(#filter0_d_1_41)"> <g filter="url(#filter0_d_1_41)">
<g clip-path="url(#clip0_1_41)"> <g clip-path="url(#clip0_1_41)">
<rect x="18" y="12" width="110" height="48" rx="8" fill="url(#paint0_radial_1_41)"/> <rect x="18" y="12" width="110" height="48" rx="8" fill="url(#paint0_radial_1_41)"/>

Before

Width:  |  Height:  |  Size: 5.9 KiB

After

Width:  |  Height:  |  Size: 5.9 KiB

Before After
Before After