-
Notifications
You must be signed in to change notification settings - Fork 17
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #211 from vuejs-translations/sync
Sync with upstream
- Loading branch information
Showing
196 changed files
with
10,212 additions
and
1,928 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -111,3 +111,6 @@ src/api/index.json | |
src/examples/data.json | ||
src/tutorial/data.json | ||
draft.md | ||
|
||
# folders created by IDE | ||
.idea |
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 @@ | ||
package-manager-strict=false |
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 @@ | ||
*.vue |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
if (location.search.includes('?uwu')) { | ||
document.documentElement.classList.add('uwu') | ||
} |
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,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> |
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,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> |
Oops, something went wrong.