pref: colorful card
This commit is contained in:
@@ -0,0 +1,26 @@
|
||||
export const colors = [
|
||||
"blue", // #0000FF
|
||||
"indigo", // #4B0082
|
||||
"violet", // #EE82EE
|
||||
"purple", // #800080
|
||||
"fuchsia", // #FF00FF
|
||||
"pink", // #FFC0CB
|
||||
"rose", // #FF007F
|
||||
"amber", // #FFBF00
|
||||
"yellow", // #FFFF00
|
||||
"lime", // #00FF00
|
||||
"green", // #008000
|
||||
"emerald", // #50C878
|
||||
"teal", // #008080
|
||||
"cyan", // #00FFFF
|
||||
"sky", // #87CEEB
|
||||
"slate", // #708090
|
||||
"gray", // #808080
|
||||
"zinc", // #A0A0A0
|
||||
"neutral", // #828282
|
||||
"stone", // #D2B48C
|
||||
"red", // #FF0000
|
||||
"orange", // #FFA500
|
||||
] as const
|
||||
|
||||
export type Color = typeof colors[number]
|
||||
+15
-3
@@ -14,11 +14,13 @@ const Time = {
|
||||
export const originSources = {
|
||||
"v2ex": {
|
||||
name: "V2EX",
|
||||
color: "slate",
|
||||
home: "https://v2ex.com/",
|
||||
},
|
||||
"coolapk": {
|
||||
name: "酷安",
|
||||
type: "hottest",
|
||||
color: "green",
|
||||
home: "https://coolapk.com",
|
||||
},
|
||||
"wallstreetcn": {
|
||||
@@ -29,10 +31,12 @@ export const originSources = {
|
||||
},
|
||||
"sputniknewscn": {
|
||||
name: "俄罗斯卫星通讯社",
|
||||
color: "yellow",
|
||||
home: "https://sputniknews.cn",
|
||||
},
|
||||
"cankaoxiaoxi": {
|
||||
name: "参考消息",
|
||||
color: "red",
|
||||
interval: Time.Common,
|
||||
home: "https://china.cankaoxiaoxi.com",
|
||||
},
|
||||
@@ -48,6 +52,7 @@ export const originSources = {
|
||||
"douyin": {
|
||||
name: "抖音",
|
||||
type: "hottest",
|
||||
color: "gray",
|
||||
home: "https://www.douyin.com",
|
||||
},
|
||||
"hupu": {
|
||||
@@ -63,6 +68,7 @@ export const originSources = {
|
||||
name: "微博",
|
||||
title: "实时热搜",
|
||||
type: "hottest",
|
||||
color: "red",
|
||||
interval: Time.Realtime,
|
||||
home: "https://weibo.com",
|
||||
},
|
||||
@@ -73,6 +79,7 @@ export const originSources = {
|
||||
"zaobao": {
|
||||
name: "联合早报",
|
||||
interval: Time.Common,
|
||||
color: "red",
|
||||
home: "https://www.zaobao.com",
|
||||
},
|
||||
"thepaper": {
|
||||
@@ -83,10 +90,12 @@ export const originSources = {
|
||||
"toutiao": {
|
||||
name: "今日头条",
|
||||
type: "hottest",
|
||||
color: "red",
|
||||
home: "https://www.toutiao.com",
|
||||
},
|
||||
"ithome": {
|
||||
name: "IT之家",
|
||||
color: "red",
|
||||
home: "https://www.ithome.com",
|
||||
},
|
||||
} as const satisfies Record<string, OriginSource>
|
||||
@@ -103,14 +112,16 @@ function genSources() {
|
||||
redirect: `${id}-${subId}`,
|
||||
name: source.name,
|
||||
type: source.type,
|
||||
interval: source.interval,
|
||||
color: source.color ?? "blue",
|
||||
interval: source.interval ?? Time.Default,
|
||||
...subSource,
|
||||
}] as [any, Source])
|
||||
}
|
||||
_.push([`${id}-${subId}`, {
|
||||
name: source.name,
|
||||
type: source.type,
|
||||
interval: source.interval,
|
||||
color: source.color ?? "blue",
|
||||
interval: source.interval ?? Time.Default,
|
||||
...subSource,
|
||||
}] as [any, Source])
|
||||
})
|
||||
@@ -118,7 +129,8 @@ function genSources() {
|
||||
_.push([id, {
|
||||
name: source.name,
|
||||
type: source.type,
|
||||
interval: source.interval,
|
||||
color: source.color ?? "blue",
|
||||
interval: source.interval ?? Time.Default,
|
||||
title: source.title,
|
||||
}])
|
||||
}
|
||||
|
||||
+4
-1
@@ -1,3 +1,4 @@
|
||||
import type { Color } from "./colors"
|
||||
import type { sectionIds } from "./data"
|
||||
import type { originSources } from "./sources"
|
||||
|
||||
@@ -26,6 +27,7 @@ export interface OriginSource {
|
||||
*/
|
||||
type?: "hottest" | "latest"
|
||||
home: string
|
||||
color?: Color
|
||||
sub?: Record<string, {
|
||||
title: string
|
||||
/**
|
||||
@@ -40,7 +42,8 @@ export interface Source {
|
||||
name: string
|
||||
title?: string
|
||||
type?: "hottest" | "latest"
|
||||
interval?: number
|
||||
color: Color
|
||||
interval: number
|
||||
redirect?: SourceID
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user