mirror of
https://gitee.com/element-plus/element-plus.git
synced 2024-12-14 01:11:25 +08:00
46d6240ad6
* docs: parallax layers for home * fix: parallax size to small * fix: parallax size to small * fix: adjust home size
108 lines
2.3 KiB
Vue
108 lines
2.3 KiB
Vue
<script lang="ts" setup>
|
|
import { computed } from 'vue'
|
|
import { useLang } from '../../composables/lang'
|
|
import { sponsors } from '../../../config/sponsors'
|
|
import homeLocale from '../../../i18n/pages/home.json'
|
|
const lang = useLang()
|
|
|
|
const homeLang = computed(() => homeLocale[lang.value])
|
|
const langZhCN = 'zh-CN'
|
|
|
|
const getSponsorName = (sponsor) => {
|
|
if (lang.value === langZhCN) {
|
|
return sponsor.name_cn || sponsor.name
|
|
}
|
|
return sponsor.name
|
|
}
|
|
const getSponsorSlogan = (sponsor) => {
|
|
if (lang.value === langZhCN) {
|
|
return sponsor.slogan_cn || sponsor.slogan
|
|
}
|
|
return sponsor.slogan
|
|
}
|
|
</script>
|
|
|
|
<template>
|
|
<div class="sponsors-container" m="t-9 auto">
|
|
<div class="sponsors-list">
|
|
<a
|
|
v-for="(sponsor, i) in sponsors"
|
|
:key="i"
|
|
:class="['sponsor', sponsor.className]"
|
|
:href="sponsor.url"
|
|
target="_blank"
|
|
>
|
|
<img width="45" :src="sponsor.img" :alt="sponsor.name" />
|
|
<div>
|
|
<p>
|
|
Sponsored by
|
|
<span class="name">{{ getSponsorName(sponsor) }}</span>
|
|
</p>
|
|
<p>{{ getSponsorSlogan(sponsor) }}</p>
|
|
</div>
|
|
</a>
|
|
</div>
|
|
<div class="join">
|
|
<el-tooltip placement="top" :hide-after="1000" :offset="20">
|
|
<template #content>
|
|
{{ homeLang['21'] }}
|
|
<a href="mailto:element-plus@outlook.com" target="_blank">
|
|
element-plus@outlook.com
|
|
</a>
|
|
</template>
|
|
<a href="mailto:element-plus@outlook.com" target="_blank">
|
|
<el-button round>{{ homeLang['20'] }}</el-button>
|
|
</a>
|
|
</el-tooltip>
|
|
</div>
|
|
</div>
|
|
</template>
|
|
|
|
<style lang="scss">
|
|
.home-page {
|
|
.sponsors-container {
|
|
width: 92%;
|
|
.join {
|
|
text-align: center;
|
|
margin: 0 0 50px 0;
|
|
}
|
|
}
|
|
|
|
.sponsors-list {
|
|
display: flex;
|
|
justify-content: center;
|
|
}
|
|
|
|
.sponsor {
|
|
margin: 0 20px 10px;
|
|
display: inline-flex;
|
|
width: 300px;
|
|
height: 100px;
|
|
justify-content: center;
|
|
align-items: center;
|
|
|
|
.name {
|
|
font-weight: bold;
|
|
color: var(--text-color);
|
|
}
|
|
|
|
img {
|
|
margin-right: 20px;
|
|
}
|
|
|
|
div {
|
|
display: flex;
|
|
flex-direction: column;
|
|
justify-content: center;
|
|
}
|
|
|
|
p {
|
|
margin: 0;
|
|
line-height: 1.8;
|
|
color: var(--text-color-light);
|
|
font-size: 12px;
|
|
}
|
|
}
|
|
}
|
|
</style>
|