mirror of
https://github.com/pheralb/svgl.git
synced 2025-12-29 08:01:36 +08:00
First commit
This commit is contained in:
+43
-3
@@ -1,7 +1,47 @@
|
||||
import '../styles/globals.css'
|
||||
// 🖤 Next Head ->
|
||||
import Head from "next/head";
|
||||
|
||||
// 🌿 Chakra UI ->
|
||||
import { ChakraProvider } from "@chakra-ui/react";
|
||||
|
||||
// 📦 Components ->
|
||||
import Header from "components/header";
|
||||
import Footer from "components/footer";
|
||||
|
||||
// 💙 Global CSS ->
|
||||
import "styles/globals.css";
|
||||
|
||||
// 🎨 Theme ->
|
||||
import theme from "styles/theme";
|
||||
|
||||
function MyApp({ Component, pageProps }) {
|
||||
return <Component {...pageProps} />
|
||||
return (
|
||||
<>
|
||||
<Head>
|
||||
<title>iconr - Beautiful SVG vector icons</title>
|
||||
<meta name="description" content="SVGs for everyone, totally free" />
|
||||
<meta property="og:type" content="website" />
|
||||
<meta
|
||||
property="og:title"
|
||||
content="iconr - Beautiful SVG vector icons"
|
||||
/>
|
||||
<meta property="og:url" content="https://iconr.vercel.app/" />
|
||||
<meta
|
||||
property="og:description"
|
||||
content="SVGs for everyone, totally free"
|
||||
/>
|
||||
<meta property="og:image" content="images/banner.png" />
|
||||
<meta name="keywords" content="svg,vector,logo,logos,download" />
|
||||
<meta content="#16161a" name="theme-color" />
|
||||
<link rel="icon" href="images/logo.png" />
|
||||
</Head>
|
||||
<ChakraProvider theme={theme}>
|
||||
<Header />
|
||||
<Component {...pageProps} />
|
||||
<Footer />
|
||||
</ChakraProvider>
|
||||
</>
|
||||
);
|
||||
}
|
||||
|
||||
export default MyApp
|
||||
export default MyApp;
|
||||
|
||||
@@ -1,5 +0,0 @@
|
||||
// Next.js API route support: https://nextjs.org/docs/api-routes/introduction
|
||||
|
||||
export default function handler(req, res) {
|
||||
res.status(200).json({ name: 'John Doe' })
|
||||
}
|
||||
@@ -0,0 +1,23 @@
|
||||
import db from "data/icons";
|
||||
|
||||
export default function handler(req, res) {
|
||||
const { id, q } = req.query;
|
||||
|
||||
// we have an id available
|
||||
if (id) {
|
||||
const item = db.find((item) => item.id === +id);
|
||||
return res.status(200).json(item);
|
||||
}
|
||||
|
||||
// we have a keyword to search for
|
||||
if (q) {
|
||||
const results = db.filter((product) => {
|
||||
const { title } = product;
|
||||
return title.toLowerCase().includes(q.toLowerCase());
|
||||
});
|
||||
return res.status(200).json(results);
|
||||
}
|
||||
|
||||
// we don't have anything
|
||||
res.status(400).json();
|
||||
}
|
||||
+64
-65
@@ -1,69 +1,68 @@
|
||||
import Head from 'next/head'
|
||||
import Image from 'next/image'
|
||||
import styles from '../styles/Home.module.css'
|
||||
import { chakra, Box } from "@chakra-ui/react";
|
||||
import Search from "components/search";
|
||||
import Grid from "components/grid";
|
||||
import Card from "components/card";
|
||||
import Icons from "data/icons";
|
||||
import Show from "animations/show";
|
||||
|
||||
export default function Home() {
|
||||
export default function Index() {
|
||||
return (
|
||||
<div className={styles.container}>
|
||||
<Head>
|
||||
<title>Create Next App</title>
|
||||
<meta name="description" content="Generated by create next app" />
|
||||
<link rel="icon" href="/favicon.ico" />
|
||||
</Head>
|
||||
|
||||
<main className={styles.main}>
|
||||
<h1 className={styles.title}>
|
||||
Welcome to <a href="https://nextjs.org">Next.js!</a>
|
||||
</h1>
|
||||
|
||||
<p className={styles.description}>
|
||||
Get started by editing{' '}
|
||||
<code className={styles.code}>pages/index.js</code>
|
||||
</p>
|
||||
|
||||
<div className={styles.grid}>
|
||||
<a href="https://nextjs.org/docs" className={styles.card}>
|
||||
<h2>Documentation →</h2>
|
||||
<p>Find in-depth information about Next.js features and API.</p>
|
||||
</a>
|
||||
|
||||
<a href="https://nextjs.org/learn" className={styles.card}>
|
||||
<h2>Learn →</h2>
|
||||
<p>Learn about Next.js in an interactive course with quizzes!</p>
|
||||
</a>
|
||||
|
||||
<a
|
||||
href="https://github.com/vercel/next.js/tree/canary/examples"
|
||||
className={styles.card}
|
||||
<>
|
||||
<Box overflow="hidden">
|
||||
<Box mx="auto">
|
||||
<Box
|
||||
pos="relative"
|
||||
pb={{ base: 2, sm: 16, md: 20, lg: 28, xl: 32 }}
|
||||
w="full"
|
||||
border="solid 1px transparent"
|
||||
>
|
||||
<h2>Examples →</h2>
|
||||
<p>Discover and deploy boilerplate example Next.js projects.</p>
|
||||
</a>
|
||||
|
||||
<a
|
||||
href="https://vercel.com/new?utm_source=create-next-app&utm_medium=default-template&utm_campaign=create-next-app"
|
||||
className={styles.card}
|
||||
>
|
||||
<h2>Deploy →</h2>
|
||||
<p>
|
||||
Instantly deploy your Next.js site to a public URL with Vercel.
|
||||
</p>
|
||||
</a>
|
||||
</div>
|
||||
</main>
|
||||
|
||||
<footer className={styles.footer}>
|
||||
<a
|
||||
href="https://vercel.com?utm_source=create-next-app&utm_medium=default-template&utm_campaign=create-next-app"
|
||||
target="_blank"
|
||||
rel="noopener noreferrer"
|
||||
>
|
||||
Powered by{' '}
|
||||
<span className={styles.logo}>
|
||||
<Image src="/vercel.svg" alt="Vercel Logo" width={72} height={16} />
|
||||
</span>
|
||||
</a>
|
||||
</footer>
|
||||
</div>
|
||||
)
|
||||
<Box
|
||||
mt={{ base: "4", md: "8" }}
|
||||
mx="auto"
|
||||
maxW={{ base: "8xl" }}
|
||||
px={{ base: 4, sm: 6, lg: 8 }}
|
||||
>
|
||||
<Box
|
||||
textAlign="center"
|
||||
w={{ base: "full", md: 11 / 12, xl: 8 / 12 }}
|
||||
mx="auto"
|
||||
>
|
||||
<Show delay="0">
|
||||
<chakra.h1
|
||||
fontSize={{ base: "30px", sm: "5xl", md: "6xl" }}
|
||||
letterSpacing="tight"
|
||||
lineHeight="short"
|
||||
fontWeight="extrabold"
|
||||
mb={{ base: 4, md: 8 }}
|
||||
>
|
||||
Beautiful SVG vector icons
|
||||
</chakra.h1>
|
||||
</Show>
|
||||
<Show delay="0.2">
|
||||
<Search />
|
||||
</Show>
|
||||
<Show delay="0.4">
|
||||
<Box mt={{ base: 4, md: 8 }}>
|
||||
<Grid>
|
||||
{Icons.map((link) => (
|
||||
<>
|
||||
<div key={link.id}>
|
||||
<Card
|
||||
title={link.title}
|
||||
url={link.href}
|
||||
icon={link.icon}
|
||||
/>
|
||||
</div>
|
||||
</>
|
||||
))}
|
||||
</Grid>
|
||||
</Box>
|
||||
</Show>
|
||||
</Box>
|
||||
</Box>
|
||||
</Box>
|
||||
</Box>
|
||||
</Box>
|
||||
</>
|
||||
);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user