Skip to content

Commit

Permalink
feat:提取常量
Browse files Browse the repository at this point in the history
  • Loading branch information
Tinie13 committed Apr 29, 2024
1 parent eafb437 commit ce166d1
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 26 deletions.
31 changes: 5 additions & 26 deletions src/components/home/HomeCardPlayer.astro
Original file line number Diff line number Diff line change
@@ -1,29 +1,8 @@
---
import Pause from "../icon/Pause.astro";
import { useTranslations } from "@i18n/util";
import { MEDIARESOURCE } from "src/consts";
const t = useTranslations(Astro);
const mediaResource = [
{
src: "https://cloud.video.taobao.com/vod/play/REFkazc0bXZaVE82emRHbklyTEdsNjFUYnBNSkd6cmpoU0U5cG9KRWtZQzZQZWw1SnpKVVVCTlh4OVFON0V5UUVMUDduY1RJak82VE1sdXdHTjNOaHc9PQ",
description: "Nacos |手动部署 Derby 数据库",
cover:'https://img.alicdn.com/imgextra/i2/O1CN01mZMLGh1WIsTB2WOEB_!!6000000002766-0-tps-2516-1282.jpg'
},
{
src: "https://cloud.video.taobao.com/vod/play/REFkazc0bXZaVE82emRHbklyTEdsMWppZ21TWGh4TDE/U2FmT3I2OU9yZTZQZWw1SnpKVVVCTlh4OVFON0V5UUVMUDduY1RJak82VE1sdXdHTjNOaHc9PQ",
description: "Nacos |手动部署 MySQL 数据库",
cover:'https://img.alicdn.com/imgextra/i2/O1CN01S9Q8mE1FJvunXlzc2_!!6000000000467-0-tps-2296-1164.jpg'
},
{
src: "https://cloud.video.taobao.com/vod/play/REFkazc0bXZaVE82emRHbklyTEdsMERLOHRmWmdQR1Ywcjl5dlM2Nk1YSzZQZWw1SnpKVVVCTlh4OVFON0V5UUVMUDduY1RJak82VE1sdXdHTjNOaHc9PQ",
description:"Nacos|Docker 部署 Derby 和 MySQL 数据库",
cover:"https://img.alicdn.com/imgextra/i2/O1CN01MOLx6f1k1qMPncU8j_!!6000000004624-0-tps-2552-1158.jpg"
},
{
src: "https://cloud.video.taobao.com/vod/play/REFkazc0bXZaVE82emRHbklyTEdsNFFUMXFoNnp2NXBPaEFUNFNDYUVRRzZQZWw1SnpKVVVCTlh4OVFON0V5UUVMUDduY1RJak82VE1sdXdHTjNOaHc9PQ",
description:"Nacos |入门样例",
cover:"https://img.alicdn.com/imgextra/i1/O1CN01fkLmjc1n7HuqYQst1_!!6000000005042-0-tps-2300-1166.jpg",
},
];
---

Expand All @@ -38,8 +17,8 @@ const mediaResource = [
>
<div class="media-container h-[23rem] w-fit flex flex-nowrap justify-start ">
{
mediaResource.map((item, index) => {
const { src, description,cover } = item;
MEDIARESOURCE.map((item, index) => {
const { src,cover } = item;
return (
<>
<input
Expand Down Expand Up @@ -98,8 +77,8 @@ const mediaResource = [

<div class="mobile-bottom-media-card hidden w-full flex flex-col">
{
mediaResource.map((item, index) => {
const { src, description,cover } = item;
MEDIARESOURCE.map((item, index) => {
const { src,cover } = item;
return (
<div class="mobile-card h-[14rem] w-full overflow-hidden flex flex-col justify-between cursor-pointer rounded-3xl mb-4">
<video controls poster={cover} class=' h-full rounded-3xl object-cover' >
Expand Down
18 changes: 18 additions & 0 deletions src/consts.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,24 @@ export const TOPBAR = {
link: 'https://nacos.io/blog/nacos-gvr7dx_awbbpb_sdtk4vkbson424zn/?source=blog_article',
target: '_blank'
}
export const MEDIARESOURCE = [
{
src: "https://cloud.video.taobao.com/vod/play/REFkazc0bXZaVE82emRHbklyTEdsNjFUYnBNSkd6cmpoU0U5cG9KRWtZQzZQZWw1SnpKVVVCTlh4OVFON0V5UUVMUDduY1RJak82VE1sdXdHTjNOaHc9PQ",
cover:'https://img.alicdn.com/imgextra/i2/O1CN01mZMLGh1WIsTB2WOEB_!!6000000002766-0-tps-2516-1282.jpg'
},
{
src: "https://cloud.video.taobao.com/vod/play/REFkazc0bXZaVE82emRHbklyTEdsMWppZ21TWGh4TDE/U2FmT3I2OU9yZTZQZWw1SnpKVVVCTlh4OVFON0V5UUVMUDduY1RJak82VE1sdXdHTjNOaHc9PQ",
cover:'https://img.alicdn.com/imgextra/i2/O1CN01S9Q8mE1FJvunXlzc2_!!6000000000467-0-tps-2296-1164.jpg'
},
{
src: "https://cloud.video.taobao.com/vod/play/REFkazc0bXZaVE82emRHbklyTEdsMERLOHRmWmdQR1Ywcjl5dlM2Nk1YSzZQZWw1SnpKVVVCTlh4OVFON0V5UUVMUDduY1RJak82VE1sdXdHTjNOaHc9PQ",
cover:"https://img.alicdn.com/imgextra/i2/O1CN01MOLx6f1k1qMPncU8j_!!6000000004624-0-tps-2552-1158.jpg"
},
{
src: "https://cloud.video.taobao.com/vod/play/REFkazc0bXZaVE82emRHbklyTEdsNFFUMXFoNnp2NXBPaEFUNFNDYUVRRzZQZWw1SnpKVVVCTlh4OVFON0V5UUVMUDduY1RJak82VE1sdXdHTjNOaHc9PQ",
cover:"https://img.alicdn.com/imgextra/i1/O1CN01fkLmjc1n7HuqYQst1_!!6000000005042-0-tps-2300-1166.jpg",
},
];

// 文档根据版本区分的提示banner
export const DOCS_BANNER = {
Expand Down

0 comments on commit ce166d1

Please sign in to comment.