Skip to content

Commit

Permalink
Update configuration and widget layout
Browse files Browse the repository at this point in the history
  • Loading branch information
bartosz-skejcik committed Jan 8, 2024
1 parent 3b4c960 commit cc1cd96
Show file tree
Hide file tree
Showing 14 changed files with 326 additions and 101 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ yarn-error.log*

# local env files
.env*.local
.env

# vercel
.vercel
Expand Down
60 changes: 38 additions & 22 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,36 +1,52 @@
This is a [Next.js](https://nextjs.org/) project bootstrapped with [`create-next-app`](https://github.com/vercel/next.js/tree/canary/packages/create-next-app).
# New Tab Extension (chromium)

## Description

This project is a new tab extension that enhances the functionality of your browser's new tab page. It allows you to customize the appearance and add useful features to make your browsing experience more productive.

## Getting Started

First, run the development server:
To get started with this project, follow the steps below:

### Prerequisites

- [Node.js](https://nodejs.org) installed on your machine.
- [pnpm](https://pnpm.io) installed on your machine.

### Installation

1. Clone the repository:

```bash
git clone https://github.com/your-username/newtab-extension.git
```

2. Navigate to the project directory:

```bash
npm run dev
# or
yarn dev
# or
pnpm dev
# or
bun dev
```
```bash
cd newtab-extension
```

Open [http://localhost:3000](http://localhost:3000) with your browser to see the result.
3. Install the dependencies:

You can start editing the page by modifying `app/page.tsx`. The page auto-updates as you edit the file.
```bash
pnpm install
```

This project uses [`next/font`](https://nextjs.org/docs/basic-features/font-optimization) to automatically optimize and load Inter, a custom Google Font.
### Usage

## Learn More
1. Load the extension in your browser:

To learn more about Next.js, take a look at the following resources:
- Open your browser and go to the extensions page.
- Enable the developer mode.
- Click on "Load unpacked" and select the `dist` directory in the project.

- [Next.js Documentation](https://nextjs.org/docs) - learn about Next.js features and API.
- [Learn Next.js](https://nextjs.org/learn) - an interactive Next.js tutorial.
2. Enjoy the enhanced new tab experience!

You can check out [the Next.js GitHub repository](https://github.com/vercel/next.js/) - your feedback and contributions are welcome!
## Contributing

## Deploy on Vercel
Contributions are welcome! If you have any ideas, suggestions, or bug reports, please open an issue or submit a pull request.

The easiest way to deploy your Next.js app is to use the [Vercel Platform](https://vercel.com/new?utm_medium=default-template&filter=next.js&utm_source=create-next-app&utm_campaign=create-next-app-readme) from the creators of Next.js.
## License

Check out our [Next.js deployment documentation](https://nextjs.org/docs/deployment) for more details.
This project is licensed under the [MIT License](LICENSE).
2 changes: 1 addition & 1 deletion components/articles/widget.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ function ArticlesWidget({ articles }: Props) {
}, [articles]);

return (
<Card className="flex items-start justify-center col-span-2 row-span-3 py-2">
<Card className="flex items-start justify-center col-span-3 row-span-5 py-2 2xl:row-span-3 2xl:col-span-2">
<CardContent className="w-full space-y-2">
<h3 className="text-lg font-semibold">Most Recent Articles</h3>
{mostRecentArticles.map((article) => (
Expand Down
2 changes: 1 addition & 1 deletion components/atlassian/hall-of-fame/progress-bar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ function ProgressBar({ progress, name, color }: Props) {
"h-2 rounded-full",
`bg-gradient-to-r from-${
color.split("-")[0]
}-600 to-${color.split("-")[0]}-400`
}-600 to-${color.split("-")[0]}-500`
)}
style={{ width: `${progress}%` }}
></div>
Expand Down
22 changes: 22 additions & 0 deletions components/clock/widget.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
import { Card, CardContent } from "@/components/ui/card";

type Props = {};

function ClockWidget({}: Props) {
return (
<Card className="col-span-2 col-start-1 row-span-1 row-start-1 pt-0.5 2xl:pt-3 2xl:row-start-1 bg-background">
<CardContent>
<div className="flex flex-col items-center justify-center h-full grow">
<div className="-mb-1 text-2xl font-semibold 2xl:-mb-0 2xl:text-5xl">
12<span className="animate-pulse">:</span>00
</div>
<div className="font-medium 2xl:text-xl text-muted-foreground">
Monday, 1st January
</div>
</div>
</CardContent>
</Card>
);
}

export default ClockWidget;
10 changes: 7 additions & 3 deletions components/home.tsx
Original file line number Diff line number Diff line change
@@ -1,15 +1,19 @@
import ArticlesWidget from "@/components/articles/widget";
import useArticles from "@/hooks/use-articles";
import SpotifyWidget from "./spotify/widget";
import SpotifyWidget from "@/components/spotify/widget";
import WeatherWidget from "@/components/weather/widget";
import ClockWidget from "@/components/clock/widget";

type Props = {};

function Home({}: Props) {
const { articles, loading } = useArticles();
return (
<main className="grid w-full h-full grid-cols-8 grid-rows-6 gap-5 overflow-y-auto grow">
<SpotifyWidget />
<main className="grid w-full h-full grid-cols-8 grid-rows-6 gap-3 overflow-y-auto 2xl:gap-5 grow">
<WeatherWidget />
{!loading && <ArticlesWidget articles={articles} />}
<ClockWidget />
<SpotifyWidget />
</main>
);
}
Expand Down
18 changes: 7 additions & 11 deletions components/spotify/widget.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,44 +13,40 @@ type Props = {};

function SpotifyWidget({}: Props) {
return (
<Card className="grid grid-cols-1 col-span-2 grid-rows-1 row-span-2 pt-5 rounded-xl">
<Card className="grid grid-cols-1 col-span-2 col-start-1 grid-rows-1 row-span-3 row-start-2 pt-4 2xl:pt-5 2xl:row-span-2 rounded-xl">
<CardContent className="w-full h-full col-span-1 row-span-1">
<div className="flex items-start w-full space-x-4">
<div className="flex-shrink-0">
<Image
alt="Album cover"
className="rounded-lg"
className="object-cover rounded-lg aspect-square"
height={80}
width={80}
src="https://nextui.org/_next/image?url=%2Fimages%2Falbum-cover.png&w=256&q=75"
style={{
aspectRatio: "80/80",
objectFit: "cover",
}}
/>
</div>
<div className="flex items-start justify-between w-full h-full">
<div className="flex flex-col">
<span className="text-lg font-semibold text-foreground">
Daily Mix
</span>
<span className="text-sm text-gray-300">
<span className="text-sm text-muted-foreground">
12 Tracks
</span>
</div>
<Heart className="text-foreground" />
</div>
</div>
<div className="px-4 py-5 mt-4 space-y-3.5 rounded-lg bg-muted w-full">
<div className="w-full bg-gray-700 rounded-full h-1.5">
<div className="px-4 py-3 2xl:py-5 mt-3 2xl:mt-4 space-y-3.5 rounded-lg bg-muted dark:bg-muted/70 w-full">
<div className="w-full bg-muted-foreground/30 rounded-full h-1.5">
<div
className="bg-foreground h-1.5 rounded-full"
className="h-1.5 bg-foreground rounded-full"
style={{
width: "30%",
}}
/>
</div>
<div className="flex items-center justify-between mt-3">
<div className="flex items-center justify-between mt-1 2xl:mt-3">
<span className="text-xs text-muted-foreground">
1:23
</span>
Expand Down
125 changes: 66 additions & 59 deletions components/ui/card.tsx
Original file line number Diff line number Diff line change
@@ -1,79 +1,86 @@
import * as React from "react"
import * as React from "react";

import { cn } from "@/lib/utils"
import { cn } from "@/lib/utils";

const Card = React.forwardRef<
HTMLDivElement,
React.HTMLAttributes<HTMLDivElement>
HTMLDivElement,
React.HTMLAttributes<HTMLDivElement>
>(({ className, ...props }, ref) => (
<div
ref={ref}
className={cn(
"rounded-lg border bg-card text-card-foreground shadow-sm",
className
)}
{...props}
/>
))
Card.displayName = "Card"
<div
ref={ref}
className={cn(
"rounded-lg border bg-card text-card-foreground shadow-sm hover:border-primary transition duration-200",
className
)}
{...props}
/>
));
Card.displayName = "Card";

const CardHeader = React.forwardRef<
HTMLDivElement,
React.HTMLAttributes<HTMLDivElement>
HTMLDivElement,
React.HTMLAttributes<HTMLDivElement>
>(({ className, ...props }, ref) => (
<div
ref={ref}
className={cn("flex flex-col space-y-1.5 p-6", className)}
{...props}
/>
))
CardHeader.displayName = "CardHeader"
<div
ref={ref}
className={cn("flex flex-col space-y-1.5 p-6", className)}
{...props}
/>
));
CardHeader.displayName = "CardHeader";

const CardTitle = React.forwardRef<
HTMLParagraphElement,
React.HTMLAttributes<HTMLHeadingElement>
HTMLParagraphElement,
React.HTMLAttributes<HTMLHeadingElement>
>(({ className, ...props }, ref) => (
<h3
ref={ref}
className={cn(
"text-2xl font-semibold leading-none tracking-tight",
className
)}
{...props}
/>
))
CardTitle.displayName = "CardTitle"
<h3
ref={ref}
className={cn(
"text-2xl font-semibold leading-none tracking-tight",
className
)}
{...props}
/>
));
CardTitle.displayName = "CardTitle";

const CardDescription = React.forwardRef<
HTMLParagraphElement,
React.HTMLAttributes<HTMLParagraphElement>
HTMLParagraphElement,
React.HTMLAttributes<HTMLParagraphElement>
>(({ className, ...props }, ref) => (
<p
ref={ref}
className={cn("text-sm text-muted-foreground", className)}
{...props}
/>
))
CardDescription.displayName = "CardDescription"
<p
ref={ref}
className={cn("text-sm text-muted-foreground", className)}
{...props}
/>
));
CardDescription.displayName = "CardDescription";

const CardContent = React.forwardRef<
HTMLDivElement,
React.HTMLAttributes<HTMLDivElement>
HTMLDivElement,
React.HTMLAttributes<HTMLDivElement>
>(({ className, ...props }, ref) => (
<div ref={ref} className={cn("p-6 pt-0", className)} {...props} />
))
CardContent.displayName = "CardContent"
<div ref={ref} className={cn("p-6 pt-0", className)} {...props} />
));
CardContent.displayName = "CardContent";

const CardFooter = React.forwardRef<
HTMLDivElement,
React.HTMLAttributes<HTMLDivElement>
HTMLDivElement,
React.HTMLAttributes<HTMLDivElement>
>(({ className, ...props }, ref) => (
<div
ref={ref}
className={cn("flex items-center p-6 pt-0", className)}
{...props}
/>
))
CardFooter.displayName = "CardFooter"
<div
ref={ref}
className={cn("flex items-center p-6 pt-0", className)}
{...props}
/>
));
CardFooter.displayName = "CardFooter";

export { Card, CardHeader, CardFooter, CardTitle, CardDescription, CardContent }
export {
Card,
CardHeader,
CardFooter,
CardTitle,
CardDescription,
CardContent,
};
Loading

0 comments on commit cc1cd96

Please sign in to comment.