Skip to content

Commit

Permalink
refactor: extract banners (#74)
Browse files Browse the repository at this point in the history
  • Loading branch information
xiaowangxiaowang256256 authored Mar 13, 2024
1 parent 5cb6036 commit 6d02471
Show file tree
Hide file tree
Showing 2 changed files with 43 additions and 35 deletions.
40 changes: 5 additions & 35 deletions src/components/banner.vue
Original file line number Diff line number Diff line change
@@ -1,48 +1,18 @@
<script setup lang="ts">
import { Menu } from 'floating-vue'
import { banners } from '../utils/banner'
import 'floating-vue/dist/style.css'
</script>

<template>
<div flex="~ row gap-2 wrap" justify-center p2>
<a target="_blank" href="https://github.com/opensource-f2f">
<img
alt="GitHub Org's stars"
src="https://img.shields.io/github/stars/opensource-f2f?style=social"
/>
</a>
<a target="_blank" href="https://twitter.com/osf2f">
<img
alt="Twitter followers"
src="https://img.shields.io/twitter/follow/osf2f?style=social"
/>
</a>
<a
target="_blank"
href="https://www.youtube.com/channel/UCV7Ibg1k_aMSEcDFgJvuvdg"
>
<img
alt="YouTube subscribers"
src="https://img.shields.io/youtube/channel/subscribers/UCV7Ibg1k_aMSEcDFgJvuvdg?style=social"
/>
</a>
<a target="_blank" href="https://feeds.osf2f.net/osf2f.xml">
<img
alt="RSS address"
src="https://img.shields.io/badge/rss-F88900?style=flat&logo=rss&logoColor=white"
/>
</a>
<a
v-for="(item, key) in banners"
:key="key"
target="_blank"
href="https://open.spotify.com/show/48Yeu1L5pTluk1AVc3ShU6"
:href="item.href"
>
<img
alt="Listen on Spotify"
src="https://img.shields.io/badge/spotify-1DB954?style=flat&logo=spotify&logoColor=white"
/>
</a>
<a target="_blank" href="https://music.163.com/#/djradio?id=1001312291">
<img h-20px alt="NetEase Music" src="/static/netease-music.svg" />
<img :alt="item.alt" :src="item.src" h-20px />
</a>

<Menu>
Expand Down
38 changes: 38 additions & 0 deletions src/utils/banner.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
export interface BannerItem {
alt: string
href: string
src: string
}

export const banners: BannerItem[] = [
{
alt: "GitHub Org's stars",
href: 'https://github.com/opensource-f2f',
src: 'https://img.shields.io/github/stars/opensource-f2f?style=social',
},
{
alt: 'Twitter followers',
href: 'https://twitter.com/osf2f',
src: 'https://img.shields.io/twitter/follow/osf2f?style=social',
},
{
alt: 'YouTube subscribers',
href: 'https://www.youtube.com/channel/UCV7Ibg1k_aMSEcDFgJvuvdg',
src: 'https://img.shields.io/youtube/channel/subscribers/UCV7Ibg1k_aMSEcDFgJvuvdg?style=social',
},
{
alt: 'RSS address',
href: 'https://feeds.osf2f.net/osf2f.xml',
src: 'https://img.shields.io/badge/rss-F88900?style=flat&logo=rss&logoColor=white',
},
{
alt: 'Listen on Spotify',
href: 'https://open.spotify.com/show/48Yeu1L5pTluk1AVc3ShU6',
src: 'https://img.shields.io/badge/spotify-1DB954?style=flat&logo=spotify&logoColor=white',
},
{
alt: 'NetEase Music',
href: 'https://music.163.com/#/djradio?id=1001312291',
src: '/static/netease-music.svg',
},
]

0 comments on commit 6d02471

Please sign in to comment.