Skip to content

Commit

Permalink
Merge branch 'vuejs:main' into main
Browse files Browse the repository at this point in the history
  • Loading branch information
jillztom authored Nov 8, 2024
2 parents 19bb74e + f7a57b8 commit c34ee40
Show file tree
Hide file tree
Showing 97 changed files with 5,915 additions and 1,134 deletions.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -110,3 +110,6 @@ src/api/index.json
src/examples/data.json
src/tutorial/data.json
draft.md

# folders created by IDE
.idea
11 changes: 8 additions & 3 deletions .vitepress/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ const nav: ThemeConfig['nav'] = [
text: 'Resources',
items: [
{ text: 'Partners', link: '/partners/' },
{ text: 'Developers', link: '/developers/' },
{ text: 'Themes', link: '/ecosystem/themes' },
{ text: 'UI Components', link: 'https://ui-libs.vercel.app/' },
{
Expand Down Expand Up @@ -125,9 +126,13 @@ const nav: ThemeConfig['nav'] = [
link: '/sponsor/'
},
{
text: 'Partners',
link: '/partners/',
activeMatch: `^/partners/`
text: 'Experts',
badge: { text: 'NEW' },
activeMatch: `^/(partners|developers)/`,
items: [
{ text: 'Partners', link: '/partners/' },
{ text: 'Developers', link: '/developers/', badge: { text: 'NEW' } }
]
}
]

Expand Down
73 changes: 73 additions & 0 deletions .vitepress/theme/components/CallToActionSection.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
<script setup lang="ts">
withDefaults(defineProps<{
title?: string
description?: string
link?: string
linkText?: string
showDivider?: boolean
}>(), {
showDivider: true
})
</script>

<template>
<section class="cta-section">
<div v-if="showDivider" class="cta-divider"></div>
<div class="cta-content">
<h2 v-if="title" class="cta-title">{{ title }}</h2>
<p v-if="description" class="cta-description">{{ description }}</p>
<a v-if="link" :href="link" target="_blank" class="cta-link">{{ linkText }}</a>
<slot></slot>
</div>
</section>
</template>

<style scoped>
.cta-section {
text-align: center;
max-width: 688px;
margin: 0 auto;
}
.cta-divider {
width: 100px;
margin: 0 auto;
border-top: 1px solid var(--vt-c-divider-light);
}
.cta-content {
padding: 28px 28px 96px;
}
.cta-title {
font-size: 34px;
font-weight: 600;
letter-spacing: -0.5px;
line-height: 1.2;
margin: 0.5em 0 1em;
}
.cta-description {
color: var(--vt-c-text-2);
}
.cta-link {
margin-top: 2em;
display: inline-block;
padding: 12px 24px;
background-color: var(--vt-c-bg-mute);
color: var(--vt-c-text-code);
font-weight: 600;
border-radius: 6px;
text-decoration: none;
transition: background-color 0.5s, color 0.5s;
}
.cta-link:hover {
background-color: var(--vt-c-gray-light-4);
}
.dark .cta-link:hover {
background-color: var(--vt-c-gray-dark-3);
}
</style>
105 changes: 105 additions & 0 deletions .vitepress/theme/components/CardList.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,105 @@
<script setup lang="ts">
import { computed, onMounted, ref, shallowRef } from 'vue'
const props = withDefaults(
defineProps<{
items: Array<any>
filter?: (item: any) => boolean
cardComponent: any
showLinkToAll?: boolean
shuffleItems?: boolean
browseLinkText?: string
browseLinkUrl?: string
splitBy?: string
}>(),
{
showLinkToAll: false,
shuffleItems: false,
splitBy: 'platinum'
}
)
const isMounted = ref(false)
const items = shallowRef([...props.items])
const filteredItems = computed(() =>
props.filter ? items.value.filter(props.filter) : items.value
)
onMounted(() => {
isMounted.value = true
items.value = processItems([...items.value], props.splitBy, props.shuffleItems)
})
function processItems(items: Array<any>, splitBy: string, shouldShuffle: boolean) {
const splitItems = items.filter(item => item[splitBy])
const otherItems = items.filter(item => !item[splitBy])
if (shouldShuffle) {
shuffleArray(splitItems)
shuffleArray(otherItems)
}
return [...splitItems, ...otherItems]
}
function shuffleArray(array: Array<any>) {
for (let i = array.length - 1; i > 0; i--) {
const j = Math.floor(Math.random() * (i + 1)); // don't remove semicolon
[array[i], array[j]] = [array[j], array[i]]
}
}
</script>

<template>
<div v-show="isMounted" class="card-list">
<!-- to skip SSG since the partners are shuffled -->
<ClientOnly>
<component
:is="cardComponent"
v-for="item in filteredItems"
:key="item.id || item.name"
:data="item"
/>
</ClientOnly>

<a
v-if="showLinkToAll && filteredItems.length % 2"
:href="browseLinkUrl"
class="browse-all-link"
>
{{ browseLinkText }}
</a>
</div>
</template>

<style scoped>
.card-list {
display: flex;
flex-wrap: wrap;
justify-content: space-between;
}
.browse-all-link {
display: block;
width: 48.5%;
margin-bottom: 36px;
padding-top: 240px;
font-size: 1.2em;
text-align: center;
color: var(--vt-c-text-2);
border: 1px solid var(--vt-c-divider-light);
border-radius: 4px;
transition: color 0.5s ease;
}
.browse-all-link:hover {
color: var(--vt-c-text-1);
}
@media (max-width: 768px) {
.browse-all-link {
display: none;
}
}
</style>
7 changes: 7 additions & 0 deletions .vitepress/theme/components/Home.vue
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,13 @@ onMounted(load)
<span>{{ description }}</span>
</template>
</section>
<section v-else id="special-sponsor">
<span>
<a href="/sponsor/#tier-benefits">
Special Sponsor slot is now vacant - Inquire now
</a>
</span>
</section>

<section id="highlights" class="vt-box-container">
<div class="vt-box">
Expand Down
63 changes: 63 additions & 0 deletions .vitepress/theme/components/PageHero.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
<template>
<div class="page-hero">
<h1 class="page-hero__title">
<slot name="title" />
</h1>
<p class="page-hero__lead">
<slot name="lead" />
</p>
</div>
</template>

<style scoped>
.page-hero {
padding: 48px 24px;
text-align: center;
margin: 0 auto;
max-width: 688px;
}
.page-hero__title,
.page-hero__lead,
.page-hero :deep(.link) {
transition: color 0.25s;
}
.page-hero__title {
line-height: 32px;
font-size: 32px;
font-weight: 500;
margin-bottom: 0.3em;
}
.page-hero__lead {
padding-top: 8px;
font-size: 16px;
font-weight: 500;
color: var(--vt-c-text-2);
}
.page-hero__lead a {
color: var(--vt-c-brand);
}
.page-hero :deep(.link) {
color: var(--vt-c-brand);
}
.page-hero :deep(.link:hover) {
color: var(--vt-c-brand-dark);
}
/* Media Queries */
@media (min-width: 768px) {
.page-hero {
padding: 64px 32px;
}
.page-hero__title {
line-height: 40px;
font-size: 40px;
}
}
</style>
Loading

0 comments on commit c34ee40

Please sign in to comment.