-
-
Notifications
You must be signed in to change notification settings - Fork 6.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
117 changed files
with
1,363 additions
and
855 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
<script setup lang="ts"> | ||
import { VPHomeSponsors } from 'vitepress/theme' | ||
import { useSponsor } from '../composables/sponsor' | ||
const { data } = useSponsor() | ||
</script> | ||
|
||
<template> | ||
<VPHomeSponsors | ||
v-if="data" | ||
message="Vite is free and open source, made possible by wonderful sponsors." | ||
action-link="https://github.com/sponsors/yyx990803" | ||
:data="data" | ||
/> | ||
</template> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
import { ref, onMounted } from 'vue' | ||
|
||
interface Sponsors { | ||
special: Sponsor[] | ||
platinum: Sponsor[] | ||
platinum_china: Sponsor[] | ||
gold: Sponsor[] | ||
silver: Sponsor[] | ||
bronze: Sponsor[] | ||
} | ||
|
||
interface Sponsor { | ||
name: string | ||
img: string | ||
url: string | ||
} | ||
|
||
// shared data across instances so we load only once. | ||
const data = ref() | ||
|
||
const dataHost = 'https://sponsors.vuejs.org' | ||
const dataUrl = `${dataHost}/vite.json` | ||
|
||
export function useSponsor() { | ||
onMounted(async () => { | ||
if (data.value) { | ||
return | ||
} | ||
|
||
const result = await fetch(dataUrl) | ||
const json = await result.json() | ||
|
||
data.value = mapSponsors(json) | ||
}) | ||
|
||
return { | ||
data | ||
} | ||
} | ||
|
||
function mapSponsors(sponsors: Sponsors) { | ||
return [ | ||
{ | ||
tier: 'Platinum Sponsor', | ||
size: 'big', | ||
items: mapImgPath(sponsors['platinum']) | ||
}, | ||
{ | ||
tier: 'Gold Sponsors', | ||
size: 'medium', | ||
items: mapImgPath(sponsors['gold']) | ||
} | ||
] | ||
} | ||
|
||
function mapImgPath(sponsors: Sponsor[]) { | ||
return sponsors.map((sponsor) => ({ | ||
...sponsor, | ||
img: `${dataHost}/images/${sponsor.img}` | ||
})) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,14 @@ | ||
import { h } from 'vue' | ||
import Theme from 'vitepress/theme' | ||
import SponsorsSidebar from './SponsorsSidebar.vue' | ||
import './styles/vars.css' | ||
import './styles/custom.css' | ||
import HomeSponsors from './components/HomeSponsors.vue' | ||
|
||
export default { | ||
...Theme, | ||
Layout() { | ||
return h(Theme.Layout, null, { | ||
'sidebar-bottom': () => | ||
h('div', { class: 'sponsors sidebar' }, [h(SponsorsSidebar)]) | ||
'home-features-after': () => h(HomeSponsors) | ||
}) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,35 +1,15 @@ | ||
.home-hero .image { | ||
width: 200px; | ||
height: 200px; | ||
} | ||
|
||
.nav-bar .logo { | ||
height: 30px; | ||
margin-right: 2px; | ||
} | ||
|
||
.content img { | ||
border-radius: 10px; | ||
} | ||
|
||
.nav-dropdown-link-item .icon { | ||
display: none; | ||
} | ||
|
||
.custom-block.tip { | ||
border-color: var(--vp-c-brand-light); | ||
} | ||
|
||
.DocSearch { | ||
--docsearch-primary-color: var(--vp-c-brand) !important; | ||
} | ||
@media (min-width: 640px) { | ||
.VPHero .text { | ||
max-width: 592px; | ||
} | ||
|
||
#play-vite-audio { | ||
padding: 0; | ||
margin-left: 5px; | ||
display: inline-flex; | ||
.VPHero .tagline { | ||
max-width: 440px; | ||
} | ||
} | ||
|
||
#play-vite-audio img { | ||
opacity: 0.8; | ||
@media (min-width: 960px) { | ||
.VPHero .tagline { | ||
max-width: 480px; | ||
} | ||
} |
Oops, something went wrong.