Skip to content

Commit ba152ca

Browse files
improve mobile and light theme
1 parent 9d4b45e commit ba152ca

File tree

5 files changed

+30
-22
lines changed

5 files changed

+30
-22
lines changed

.gitignore

-3
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,3 @@ next-env.d.ts
2929

3030
# next-sitemap
3131
public/sitemap*.xml
32-
33-
# Cloudflare
34-
.worker-next

app/(home)/page.tsx

+7-6
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,9 @@ import tauriSpectaLogo from "../../public/images/tauri-specta-logo.png";
99
export default function HomePage() {
1010
return (
1111
<div className="w-full h-full flex flex-col items-center justify-center">
12-
<main className="px-4 lg:px-12 flex flex-col lg:flex-row justify-center items-center h-full gap-16">
12+
<main className="px-4 lg:px-12 grid grid-flow-row lg:grid-flow-col justify-center items-center h-full gap-16">
1313
<div className="flex flex-col gap-4">
14-
<h1 className="text-6xl lg:text-8xl">specta-rs</h1>
14+
<h1 className="text-6xl lg:text-8xl hidden sm:block">specta-rs</h1>
1515
<h2 className="text-3xl lg:text-4xl">
1616
Rust crates for building better web apps
1717
</h2>
@@ -60,7 +60,6 @@ export default function HomePage() {
6060
logoHref={tauriSpectaLogo.src}
6161
logoAlt="Tauri Specta Logo"
6262
githubHref="https://github.com/specta-rs/tauri-specta"
63-
// packageManagerHref="https://docs.rs/tauri-specta"
6463
documentationHref="/docs/tauri-specta"
6564
packageManagerHref="https://crates.io/crates/rspc"
6665
>
@@ -85,7 +84,7 @@ function HeroItem(
8584
}>,
8685
) {
8786
return (
88-
<div className="bg-[#171717] rounded-lg flex flex-row items-center p-6 gap-4 lg:p-8 lg:gap-8 focus-visible:scale-105 shadow">
87+
<div className="bg-neutral-50 dark:bg-[#171717] rounded-lg flex flex-row items-center py-6 px-3 md:px-6 gap-4 md:gap-8 lg:p-8 focus-visible:scale-105 shadow">
8988
{props.logoHref && (
9089
<Image
9190
src={props.logoHref}
@@ -99,11 +98,11 @@ function HeroItem(
9998

10099
<div className="flex flex-col flex-1 gap-2">
101100
<h2 className="text-xl lg:text-3xl tracking-tight">{props.name}</h2>
102-
<p className="text-slate-200 font-semibold text-sm lg:text-base">
101+
<p className="text-slate-800 dark:text-slate-200 font-semibold text-sm lg:text-base">
103102
{props.children}
104103
</p>
105104

106-
<div className="flex space-x-3">
105+
<div className="flex space-x-3 md:space-x-3 justify-between md:justify-start">
107106
{props.githubHref ? (
108107
<a href={props.githubHref} className="hover:underline">
109108
GitHub
@@ -116,6 +115,8 @@ function HeroItem(
116115
</Link>
117116
) : null}
118117

118+
{/* <div className="flex-1" /> */}
119+
119120
{props.packageManagerHref ? (
120121
<a href={props.packageManagerHref} className="hover:underline">
121122
{props.packageManager || "crates.io"}

app/global.css

+14-5
Original file line numberDiff line numberDiff line change
@@ -3,15 +3,24 @@
33
@tailwind utilities;
44

55
body {
6+
font-family: "Raleway", sans-serif;
7+
font-optical-sizing: auto;
8+
font-weight: 600;
9+
font-style: normal;
10+
}
11+
12+
.dark body {
613
background-image: linear-gradient(to bottom, transparent 90%, #171717 10%),
714
linear-gradient(to right, #171717 90%, #2e2e2e 10%);
8-
915
background-size:
1016
5px 5px,
1117
5px 5px;
18+
}
1219

13-
font-family: "Raleway", sans-serif;
14-
font-optical-sizing: auto;
15-
font-weight: 600;
16-
font-style: normal;
20+
.light body {
21+
background-image: linear-gradient(to bottom, transparent 90%, #a1a1aa 10%),
22+
linear-gradient(to right, #f4f4f5 90%, #a1a1aa 10%);
23+
background-size:
24+
5px 5px,
25+
5px 5px;
1726
}

app/layout.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ const inter = Inter({
99
});
1010

1111
export const metadata: Metadata = {
12-
metadataBase: new URL(process.env?.VERCEL_BRANCH_URL || "https://specta.dev"),
12+
metadataBase: new URL("https://specta.dev"),
1313
title: "specta-rs",
1414
description: "Rust crates for building better web apps",
1515
authors: [

tailwind.config.js

+8-7
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,16 @@
1-
import { createPreset } from 'fumadocs-ui/tailwind-plugin';
1+
import { createPreset } from "fumadocs-ui/tailwind-plugin";
22

33
/** @type {import('tailwindcss').Config} */
44
const config = {
55
content: [
6-
'./components/**/*.{ts,tsx}',
7-
'./app/**/*.{ts,tsx}',
8-
'./content/**/*.{md,mdx}',
9-
'./mdx-components.{ts,tsx}',
10-
'./node_modules/fumadocs-ui/dist/**/*.js',
6+
"./components/**/*.{ts,tsx}",
7+
"./app/**/*.{ts,tsx}",
8+
"./content/**/*.{md,mdx}",
9+
"./mdx-components.{ts,tsx}",
10+
"./node_modules/fumadocs-ui/dist/**/*.js",
1111
],
12+
darkMode: "class",
1213
presets: [createPreset()],
1314
};
1415

15-
export default config;
16+
export default config;

0 commit comments

Comments
 (0)