22 lines
2.6 KiB
TypeScript
22 lines
2.6 KiB
TypeScript
import type { CSSProperties } from 'react'
|
|
import { ARTICLE_LABEL } from '@nalssigak/shared/lib'
|
|
|
|
const SHARED = new Set(['bear', 'bike', 'bronze', 'camping', 'carwash', 'chimaek', 'cloud', 'coldwind', 'delivery', 'dog', 'garden', 'glasses', 'gold', 'hiking', 'iced_hot', 'jjamppong', 'laundry', 'letter', 'makeup', 'makgeolli', 'maple', 'moon', 'muggy', 'naengmyeon', 'photo', 'picnic', 'rabbit', 'rain', 'running', 'silver', 'snow', 'stars', 'sun_cloud', 'sun', 'sunset', 'taxi', 'umbrella', 'vent', 'walk', 'yajang', 'baseball', 'study', 'netflix', 'chestnut', 'peanut', 'tangerine', 'sweet_potato', 'fallen_leaf', 'kimchi', 'apple', 'mask', 'golf', 'jipkok', 'fishing', 'drive', 'kite', 'waterplay', 'riverwind', 'trot', 'pajeon', 'bingsu', 'blanket', 'indoordry', 'flower', 'bungeoppang', 'singing_rain', 'hangang', 'themepark', 'date', 'frizz', 'boiler', 'sunscreen', 'mosquito', 'tennis', 'hyodo', 'thanks', 'gift', 'party', 'game', 'selfie', 'sentimental', 'ginkgo', 'top', 'contact'])
|
|
const OWN = new Set(['fireworks', 'bulb', 'calendar', 'thermo', 'sheaf', 'popup', 'exhibition', 'concert', 'crystal_ball', 'yin_yang', 'tshirt', 'clapper', 'speech', 'droplet', 'leaf', 'rainbow', 'milky_way', 'shooting_star', 'alarm_clock', 'check_mark_button', 'sparkles', 'warning', 'locked', 'money_bag', 'red_heart', 'briefcase', 'spiral_calendar', 'two_hearts', 'sunrise', 'candy', 'lollipop', 'spider', 'spider_web', 'bat', 'ghost', 'skull', 'jack_o_lantern', 'pepero_choco', 'pepero_almond', 'pepero_strawberry', 'pepero_nude', 'pepero_pair', 'pepero_bundle', 'pepero_box', 'pepero_basket', 'xmas_candy_cane', 'xmas_ornament', 'xmas_gingerbread', 'xmas_santa_hat', 'xmas_stocking', 'xmas_wreath', 'xmas_santa', 'christmas_tree', 'pear', 'dango', 'moon_viewing', 'full_moon'])
|
|
|
|
/** 아이콘 이름 → 파일 경로 (공용 public/icons, B 전용 public/b/icons). 'none'(데이터 없는 칸)은 그림 없음 */
|
|
export function iconSrc(name: string) {
|
|
if (name === 'none') return null
|
|
if (OWN.has(name)) return `/b/icons/${name}.png`
|
|
return `/icons/${SHARED.has(name) ? name : 'sun_cloud'}.png`
|
|
}
|
|
|
|
export const fall = (d: string, f = '4.8s') => ({ '--d': d, '--f': f }) as CSSProperties
|
|
|
|
export const ARTICLE_CAT: Record<number, [string, string]> = { 1: [ARTICLE_LABEL[1], 'text-[#1f9d62]'], 2: [ARTICLE_LABEL[2], 'text-[#7a5cd6]'], 3: [ARTICLE_LABEL[3], 'text-(--orange)'] }
|
|
|
|
/** 아래 창이 다 올라오는 시간(.b-sheet 0.26s). 무거운 일은 이 뒤로 미뤄 올라오는 동안 버벅이지 않게 */
|
|
export const SHEET_OPEN_MS = 280
|
|
/** 아래 창이 내려가며 닫히는 시간(.b-sheet-closing 0.2s). 이 뒤에 실제로 닫는다 */
|
|
export const SHEET_CLOSE_MS = 200
|