-
{{ item.title }}
-
- - 疑似來自有中資背景公司
-
-
-
{{ new Date(item.date).toLocaleString() }}
- 類似新聞:
-
+
+
{{ item.title }}
+
+ - 疑似來自有中資背景公司
+
+
+
+ {{ new Date(item.date).toLocaleString() }}
+
+
+
+
+
+
+
+
-
\ No newline at end of file
+
+ 類似新聞:
+
+
+
diff --git a/pages/app/index.vue b/pages/app/index.vue
index 3797085..f55129b 100644
--- a/pages/app/index.vue
+++ b/pages/app/index.vue
@@ -1,3 +1,3 @@
- The "For you page"
-
\ No newline at end of file
+
The "For you page"
+
diff --git a/pages/app/news/[provider]/[slug].vue b/pages/app/news/[provider]/[slug].vue
index 5939319..c3995b0 100644
--- a/pages/app/news/[provider]/[slug].vue
+++ b/pages/app/news/[provider]/[slug].vue
@@ -4,6 +4,4 @@ const route = useRoute();
const provider = route.params.provider;
const slug = route.params.slug;
-
-
-
\ No newline at end of file
+
diff --git a/pages/sources.vue b/pages/sources.vue
index e525fc6..eb8e7f4 100644
--- a/pages/sources.vue
+++ b/pages/sources.vue
@@ -1,4 +1 @@
-
- 1. Yahoo RSS Api
- 2. Google News Search
-
\ No newline at end of file
+
1. Yahoo RSS Api 2. Google News Search
diff --git a/pages/system/login.vue b/pages/system/login.vue
index 50e0466..08b9e29 100644
--- a/pages/system/login.vue
+++ b/pages/system/login.vue
@@ -33,11 +33,11 @@
\ No newline at end of file
+
diff --git a/server/api/rss/google.ts b/server/api/rss/google.ts
index 76ab1af..17d686f 100644
--- a/server/api/rss/google.ts
+++ b/server/api/rss/google.ts
@@ -1,29 +1,30 @@
-import Parser from 'rss-parser'
-import { HTMLToJSON } from 'html-to-json-parser';
-
+import Parser from "rss-parser";
+import { HTMLToJSON } from "html-to-json-parser";
export default defineEventHandler(async (event) => {
let array = [];
- const parser = new Parser()
+ const parser = new Parser();
try {
- const feed = await parser.parseURL('https://news.google.com/rss?&hl=zh-TW&gl=TW&ceid=TW:zh-Hant')
+ const feed = await parser.parseURL(
+ "https://news.google.com/rss?&hl=zh-TW&gl=TW&ceid=TW:zh-Hant",
+ );
feed.items.forEach(async (item) => {
- const rawRelatedNews = await HTMLToJSON(item.content, true)
- const relatedNews = JSON.parse(rawRelatedNews.replace("ol", ""))
- array.push({
- title: item.title,
- link: item.link,
- date: item.pubDate,
- content: relatedNews
- });
- console.log(item.title);
- })
+ const rawRelatedNews = await HTMLToJSON(item.content, true);
+ const relatedNews = JSON.parse(rawRelatedNews.replace("ol", ""));
+ array.push({
+ title: item.title,
+ link: item.link,
+ date: item.pubDate,
+ content: relatedNews,
+ });
+ console.log(item.title);
+ });
return array;
} catch (error) {
- console.error('Error fetching RSS:', error)
+ console.error("Error fetching RSS:", error);
throw createError({
statusCode: 500,
- message: 'Failed to fetch RSS feed'
- })
+ message: "Failed to fetch RSS feed",
+ });
}
-})
\ No newline at end of file
+});
diff --git a/server/routes/find/newsOrg.ts b/server/routes/find/newsOrg.ts
index 704f9a6..21030a3 100644
--- a/server/routes/find/newsOrg.ts
+++ b/server/routes/find/newsOrg.ts
@@ -1,5 +1,5 @@
export default defineEventHandler(async (event) => {
- const query = getQuery(event)
- const name = query.name
+ const query = getQuery(event);
+ const name = query.name;
return name;
-})
\ No newline at end of file
+});
diff --git a/styles/main.css b/styles/main.css
index bf53037..bcf1953 100644
--- a/styles/main.css
+++ b/styles/main.css
@@ -13,6 +13,32 @@
body {
font-family: "Noto Sans TC Variable", "Fira Sans", sans-serif;
}
+ :root {
+ --background: bg-black;
+ --foreground: 0 0% 98%;
+ --card: 0 0% 3.9%;
+ --card-foreground: 0 0% 98%;
+ --popover: 0 0% 3.9%;
+ --popover-foreground: 0 0% 98%;
+ --primary: 0 0% 98%;
+ --primary-foreground: 0 0% 9%;
+ --secondary: 0 0% 14.9%;
+ --secondary-foreground: 0 0% 98%;
+ --muted: 0 0% 14.9%;
+ --muted-foreground: 0 0% 63.9%;
+ --accent: 0 0% 14.9%;
+ --accent-foreground: 0 0% 98%;
+ --destructive: 0 62.8% 30.6%;
+ --destructive-foreground: 0 0% 98%;
+ --border: 0 0% 14.9%;
+ --input: 0 0% 14.9%;
+ --ring: 0 0% 83.1%;
+ --chart-1: 220 70% 50%;
+ --chart-2: 160 60% 45%;
+ --chart-3: 30 80% 55%;
+ --chart-4: 280 65% 60%;
+ --chart-5: 340 75% 55%;
+ }
}
@font-face {
diff --git a/tailwind.config.js b/tailwind.config.js
index d9e0450..d959d3d 100644
--- a/tailwind.config.js
+++ b/tailwind.config.js
@@ -1,14 +1,62 @@
/** @type {import('tailwindcss').Config} */
module.exports = {
+ darkMode: ["class"],
content: [],
theme: {
extend: {
backgroundColor: {
page: "#000000",
},
+ borderRadius: {
+ lg: "var(--radius)",
+ md: "calc(var(--radius) - 2px)",
+ sm: "calc(var(--radius) - 4px)",
+ },
+ colors: {
+ background: "hsl(var(--background))",
+ foreground: "hsl(var(--foreground))",
+ card: {
+ DEFAULT: "hsl(var(--card))",
+ foreground: "hsl(var(--card-foreground))",
+ },
+ popover: {
+ DEFAULT: "hsl(var(--popover))",
+ foreground: "hsl(var(--popover-foreground))",
+ },
+ primary: {
+ DEFAULT: "hsl(var(--primary))",
+ foreground: "hsl(var(--primary-foreground))",
+ },
+ secondary: {
+ DEFAULT: "hsl(var(--secondary))",
+ foreground: "hsl(var(--secondary-foreground))",
+ },
+ muted: {
+ DEFAULT: "hsl(var(--muted))",
+ foreground: "hsl(var(--muted-foreground))",
+ },
+ accent: {
+ DEFAULT: "hsl(var(--accent))",
+ foreground: "hsl(var(--accent-foreground))",
+ },
+ destructive: {
+ DEFAULT: "hsl(var(--destructive))",
+ foreground: "hsl(var(--destructive-foreground))",
+ },
+ border: "hsl(var(--border))",
+ input: "hsl(var(--input))",
+ ring: "hsl(var(--ring))",
+ chart: {
+ 1: "hsl(var(--chart-1))",
+ 2: "hsl(var(--chart-2))",
+ 3: "hsl(var(--chart-3))",
+ 4: "hsl(var(--chart-4))",
+ 5: "hsl(var(--chart-5))",
+ },
+ },
},
},
- plugins: [],
+ plugins: [require("tailwindcss-animate")],
corePlugins: {
preflight: true,
},