Skip to content

Commit

Permalink
feat: finished the styling
Browse files Browse the repository at this point in the history
  • Loading branch information
JimmyLv committed Feb 26, 2023
1 parent 6d48148 commit 191a9e9
Show file tree
Hide file tree
Showing 8 changed files with 34 additions and 27 deletions.
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
# [TechCrunchSummary.com](https://www.techcrunchsummary.com/)
# [b.jimmylv.cn](https://b.jimmylv.cn/)

This project summarizes TechCrunch articles for you using AI.
This project summarizes 哔哩哔哩 videos for you using AI.

[![TechCrunch Summary Tool](./public/screenshot.png)](https://www.techcrunchsummary.com)
[![哔哩哔哩视频总结工具](./public/screenshot.png)](https://b.jimmylv.cn)

## How it works

Expand Down
8 changes: 4 additions & 4 deletions components/Footer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ export default function Footer() {
href="https://openai.com/"
target="_blank"
rel="noreferrer"
className="font-bold underline-offset-2 transition hover:text-slate-100 hover:underline"
className="font-bold underline-offset-2 transition hover:text-pink-400 hover:underline"
>
OpenAI{" "}
</a>
Expand All @@ -18,7 +18,7 @@ export default function Footer() {
href="https://vercel.com/"
target="_blank"
rel="noreferrer"
className="font-bold underline-offset-2 transition hover:text-slate-100 hover:underline"
className="font-bold underline-offset-2 transition hover:text-pink-400 hover:underline"
>
Vercel Edge Functions.
</a>
Expand All @@ -31,7 +31,7 @@ export default function Footer() {
>
<svg
aria-hidden="true"
className="h-6 w-6 fill-slate-400 transition group-hover:fill-slate-100"
className="h-6 w-6 fill-slate-400 transition group-hover:fill-pink-400"
>
<path d="M8.29 20.251c7.547 0 11.675-6.253 11.675-11.675 0-.178 0-.355-.012-.53A8.348 8.348 0 0 0 22 5.92a8.19 8.19 0 0 1-2.357.646 4.118 4.118 0 0 0 1.804-2.27 8.224 8.224 0 0 1-2.605.996 4.107 4.107 0 0 0-6.993 3.743 11.65 11.65 0 0 1-8.457-4.287 4.106 4.106 0 0 0 1.27 5.477A4.073 4.073 0 0 1 2.8 9.713v.052a4.105 4.105 0 0 0 3.292 4.022 4.093 4.093 0 0 1-1.853.07 4.108 4.108 0 0 0 3.834 2.85A8.233 8.233 0 0 1 2 18.407a11.615 11.615 0 0 0 6.29 1.84" />
</svg>
Expand All @@ -43,7 +43,7 @@ export default function Footer() {
>
<svg
aria-hidden="true"
className="h-6 w-6 fill-slate-400 transition group-hover:fill-slate-100"
className="h-6 w-6 fill-slate-400 transition group-hover:fill-pink-400"
>
<path d="M12 2C6.477 2 2 6.484 2 12.017c0 4.425 2.865 8.18 6.839 9.504.5.092.682-.217.682-.483 0-.237-.008-.868-.013-1.703-2.782.605-3.369-1.343-3.369-1.343-.454-1.158-1.11-1.466-1.11-1.466-.908-.62.069-.608.069-.608 1.003.07 1.531 1.032 1.531 1.032.892 1.53 2.341 1.088 2.91.832.092-.647.35-1.088.636-1.338-2.22-.253-4.555-1.113-4.555-4.951 0-1.093.39-1.988 1.029-2.688-.103-.253-.446-1.272.098-2.65 0 0 .84-.27 2.75 1.026A9.564 9.564 0 0 1 12 6.844a9.59 9.59 0 0 1 2.504.337c1.909-1.296 2.747-1.027 2.747-1.027.546 1.379.202 2.398.1 2.651.64.7 1.028 1.595 1.028 2.688 0 3.848-2.339 4.695-4.566 4.943.359.309.678.92.678 1.855 0 1.338-.012 2.419-.012 2.747 0 .268.18.58.688.482A10.02 10.02 0 0 0 22 12.017C22 6.484 17.522 2 12 2Z" />
</svg>
Expand Down
6 changes: 3 additions & 3 deletions components/Header.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,15 +10,15 @@ export default function Header() {
<div className="flex items-center justify-between px-3 sm:px-3">
<a
className="flex items-center space-x-3"
href="https://www.techcrunchsummary.com"
href="https://b.jimmylv.cn"
>
<Image src="/edit.png" alt="logo" width={34} height={34} />
<h2 className={clsx("text-lg sm:text-3xl", poppins.className)}>
<span className="text-green-500">TechCrunch</span> summarizer
<span className="text-pink-400 ">哔哩哔哩</span> 视频总结器
</h2>
</a>
<a
href="https://github.com/Nutlope/news-summarizer"
href="https://github.com/JimmyLv/chat-bilibili-video"
rel="noreferrer noopener"
target="_blank"
className=""
Expand Down
2 changes: 1 addition & 1 deletion components/SquigglyLines.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ export default function SquigglyLines() {
<svg
aria-hidden="true"
viewBox="0 0 401 42"
className="absolute top-2/3 left-0 h-[0.48em] w-full fill-green-300/70"
className="absolute top-2/3 left-0 h-[0.48em] w-full fill-pink-400/70"
preserveAspectRatio="none"
>
<path d="M203.371.916c-26.013-2.078-76.686 1.963-124.73 9.946L67.3 12.749C35.421 18.062 18.2 21.766 6.004 25.934 1.244 27.561.828 27.778.874 28.61c.07 1.214.828 1.121 9.595-1.176 9.072-2.377 17.15-3.92 39.246-7.496C123.565 7.986 157.869 4.492 195.942 5.046c7.461.108 19.25 1.696 19.17 2.582-.107 1.183-7.874 4.31-25.75 10.366-21.992 7.45-35.43 12.534-36.701 13.884-2.173 2.308-.202 4.407 4.442 4.734 2.654.187 3.263.157 15.593-.78 35.401-2.686 57.944-3.488 88.365-3.143 46.327.526 75.721 2.23 130.788 7.584 19.787 1.924 20.814 1.98 24.557 1.332l.066-.011c1.201-.203 1.53-1.825.399-2.335-2.911-1.31-4.893-1.604-22.048-3.261-57.509-5.556-87.871-7.36-132.059-7.842-23.239-.254-33.617-.116-50.627.674-11.629.54-42.371 2.494-46.696 2.967-2.359.259 8.133-3.625 26.504-9.81 23.239-7.825 27.934-10.149 28.304-14.005.417-4.348-3.529-6-16.878-7.066Z" />
Expand Down
2 changes: 1 addition & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

27 changes: 17 additions & 10 deletions pages/[...slug].tsx
Original file line number Diff line number Diff line change
Expand Up @@ -35,13 +35,13 @@ export const Home: NextPage = () => {
setSummary("");
if (url) {
if (!url.includes("techcrunch.com")) {
toast.error("Please enter a valid TechCrunch article");
toast.error("Please enter a valid 哔哩哔哩 article");
return;
}
setCurArticle(url);
} else {
if (!curArticle.includes("techcrunch.com")) {
toast.error("Please enter a valid TechCrunch article");
toast.error("Please enter a valid 哔哩哔哩 article");
return;
}
router.replace(curUrl);
Expand Down Expand Up @@ -81,7 +81,7 @@ export const Home: NextPage = () => {
return (
<div className="mx-auto flex min-h-screen max-w-5xl flex-col pt-8 sm:pt-12">
<Head>
<title>TechCrunch Summarizer</title>
<title>哔哩哔哩视频一键总结</title>
<link rel="icon" href="/favicon.ico" />
</Head>
<Header />
Expand All @@ -92,38 +92,45 @@ export const Home: NextPage = () => {
className="mx-auto mb-5 hidden max-w-fit rounded-full border border-gray-800 px-4 py-1 text-gray-500 transition duration-300 ease-in-out hover:scale-105 hover:border-gray-700 md:block"
href="https://twitter.com/nutlope/status/1622988173155368960"
>
You can also go to a Techcrunch article and add "summary" after
"techcrunch" in the URL
You can also go to a Bilibili video and change the suffix "
<span className="text-pink-400">.com</span>" into "
<span className="text-sky-400">jimmylv.cn</span>" in the URL.
<br />
e.g. www.bilibili.
<span className="text-pink-400 line-through">com</span>
/video/BV1k84y1e7fW 👉 www.bilibili.
<span className="text-sky-400 underline">jimmylv.cn</span>
/video/BV1k84y1e7fW
</a>
<h1 className="max-w-5xl text-center text-4xl font-bold sm:text-7xl">
Summarize any{" "}
<span className="relative whitespace-nowrap text-[#3290EE]">
<SquigglyLines />
<span className="relative text-green-500">TechCrunch</span>
<span className="relative text-pink-400 ">哔哩哔哩</span>
</span>{" "}
article with AI
</h1>
<p className="mt-10 text-center text-lg text-gray-500 sm:text-2xl">
Copy and paste any <span className="text-green-500">TechCrunch </span>
Copy and paste any <span className="text-pink-400 ">哔哩哔哩 </span>
article link below.
</p>
<input
type="text"
value={curArticle}
onChange={(e) => setCurArticle(e.target.value)}
className="mx-auto mt-10 w-full rounded-lg border border-gray-500 bg-black p-3 outline-1 outline-white sm:mt-7 sm:w-3/4"
className="mx-auto mt-10 w-full appearance-none rounded-lg rounded-md border bg-transparent py-2 pl-2 text-sm leading-6 text-slate-900 shadow-sm ring-1 ring-slate-200 placeholder:text-slate-400 focus:outline-none focus:ring-2 focus:ring-blue-500 dark:text-slate-100 dark:ring-0 dark:placeholder:text-slate-500 dark:focus:ring-2"
/>
{!loading && (
<button
className="z-10 mx-auto mt-7 w-3/4 rounded-2xl border-gray-500 bg-green-500 p-3 text-lg font-medium transition hover:bg-green-400 sm:mt-10 sm:w-1/3"
className="z-10 mx-auto mt-7 w-3/4 rounded-2xl border-gray-500 bg-sky-400 p-3 text-lg font-medium text-white transition hover:bg-sky-500 sm:mt-10 sm:w-1/3"
onClick={() => generateSummary()}
>
Summarize
</button>
)}
{loading && (
<button
className="z-10 mx-auto mt-7 w-3/4 cursor-not-allowed rounded-2xl border-gray-500 bg-green-500 p-3 text-lg font-medium transition hover:bg-green-400 sm:mt-10 sm:w-1/3"
className="z-10 mx-auto mt-7 w-3/4 cursor-not-allowed rounded-2xl border-gray-500 bg-sky-400 p-3 text-lg font-medium transition hover:bg-sky-500 sm:mt-10 sm:w-1/3"
disabled
>
<div className="flex items-center justify-center text-white">
Expand Down
8 changes: 4 additions & 4 deletions pages/_document.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@ import Document, { Head, Html, Main, NextScript } from "next/document";

class MyDocument extends Document {
render() {
let description = "Summarize TechCrunch articles in seconds.";
let ogimage = "https://www.techcrunchsummary.com/og-image.png";
let description = "Summarize 哔哩哔哩 articles in seconds.";
let ogimage = "https://b.jimmylv.cn/og-image.png";
let sitename = "techcrunchsummary.com";
let title = "TechCrunch Summarizer";
let title = "哔哩哔哩 Summarizer";

return (
<Html lang="en">
Expand All @@ -21,7 +21,7 @@ class MyDocument extends Document {
<meta property="og:image" content={ogimage} />
<meta name="twitter:image" content={ogimage} />
</Head>
<body className="bg-black text-white">
<body className="bg-white text-gray-700">
<Main />
<NextScript />
</body>
Expand Down
2 changes: 1 addition & 1 deletion styles/globals.css
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,5 @@
@tailwind utilities;

::selection {
background: #22c55a;
background: #fc8bab;
}

0 comments on commit 191a9e9

Please sign in to comment.