diff --git a/.eslintignore b/.eslintignore new file mode 100644 index 0000000..3897265 --- /dev/null +++ b/.eslintignore @@ -0,0 +1,13 @@ +.DS_Store +node_modules +/build +/.svelte-kit +/package +.env +.env.* +!.env.example + +# Ignore files for PNPM, NPM and YARN +pnpm-lock.yaml +package-lock.json +yarn.lock diff --git a/.eslintrc.cjs b/.eslintrc.cjs new file mode 100644 index 0000000..eaf19f5 --- /dev/null +++ b/.eslintrc.cjs @@ -0,0 +1,20 @@ +module.exports = { + root: true, + parser: '@typescript-eslint/parser', + extends: ['eslint:recommended', 'plugin:@typescript-eslint/recommended', 'prettier'], + plugins: ['svelte3', '@typescript-eslint'], + ignorePatterns: ['*.cjs'], + overrides: [{ files: ['*.svelte'], processor: 'svelte3/svelte3' }], + settings: { + 'svelte3/typescript': () => require('typescript') + }, + parserOptions: { + sourceType: 'module', + ecmaVersion: 2020 + }, + env: { + browser: true, + es2017: true, + node: true + } +}; diff --git a/.eslintrc.json b/.eslintrc.json deleted file mode 100644 index 957cd15..0000000 --- a/.eslintrc.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "extends": ["next/core-web-vitals"] -} diff --git a/.github/FUNDING.yml b/.github/FUNDING.yml new file mode 100644 index 0000000..9217f21 --- /dev/null +++ b/.github/FUNDING.yml @@ -0,0 +1 @@ +github: pheralb \ No newline at end of file diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..0006a4b --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,26 @@ +name: πŸ› οΈ Check + +on: + push: + branches: + - main + pull_request: + branches: + - main + +jobs: + svelte-check: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + + - name: Setup Node.js 18.x + uses: actions/setup-node@v3 + with: + node-version: 18.x + + - name: Install dependencies + run: npm install + + - name: Run typecheck + run: npm run check diff --git a/.gitignore b/.gitignore index a5b11df..cbe253f 100644 --- a/.gitignore +++ b/.gitignore @@ -1,48 +1,22 @@ -# dependencies -> -/node_modules -/.pnp -.pnp.js +# Dependencies +node_modules package-lock.json - -# testing -> -/coverage - -# next.js -> -/.next/ -/out/ - -# production -> -/build - -# misc -> -.DS_Store -*.pem - -# debug -> -npm-debug.log* -yarn-debug.log* -yarn-error.log* -.pnpm-debug.log* - -# local env files -> -.env*.local - -# vercel -> -.vercel - -# typescript -> -*.tsbuildinfo - -# PWA files -> -**/public/sw.js -**/public/workbox-*.js -**/public/worker-*.js -**/public/sw.js.map -**/public/workbox-*.js.map -**/public/worker-*.js.map - -# SWC files -> -.swc - -# PNPM files -> pnpm-lock.yaml +yarn.lock + +# Folders +/.svelte-kit +/build +/package + +# Logs +.DS_Store + +# Environment variables +.env +.env.* +!.env.example + +# Vite files +vite.config.js.timestamp-* +vite.config.ts.timestamp-* diff --git a/.npmrc b/.npmrc new file mode 100644 index 0000000..b6f27f1 --- /dev/null +++ b/.npmrc @@ -0,0 +1 @@ +engine-strict=true diff --git a/.nvmrc b/.nvmrc deleted file mode 100644 index 0a2cd98..0000000 --- a/.nvmrc +++ /dev/null @@ -1 +0,0 @@ -v16.15.1 \ No newline at end of file diff --git a/.prettierignore b/.prettierignore new file mode 100644 index 0000000..3897265 --- /dev/null +++ b/.prettierignore @@ -0,0 +1,13 @@ +.DS_Store +node_modules +/build +/.svelte-kit +/package +.env +.env.* +!.env.example + +# Ignore files for PNPM, NPM and YARN +pnpm-lock.yaml +package-lock.json +yarn.lock diff --git a/.prettierrc b/.prettierrc new file mode 100644 index 0000000..206e042 --- /dev/null +++ b/.prettierrc @@ -0,0 +1,9 @@ +{ + "useTabs": false, + "singleQuote": true, + "trailingComma": "none", + "printWidth": 100, + "plugins": ["prettier-plugin-svelte"], + "pluginSearchDirs": ["."], + "overrides": [{ "files": "*.svelte", "options": { "parser": "svelte" } }] +} diff --git a/.vscode/extensions.json b/.vscode/extensions.json new file mode 100644 index 0000000..df699b9 --- /dev/null +++ b/.vscode/extensions.json @@ -0,0 +1,3 @@ +{ + "recommendations": ["esbenp.prettier-vscode", "dbaeumer.vscode-eslint", "svelte.svelte-vscode"] +} diff --git a/.vscode/settings.json b/.vscode/settings.json new file mode 100644 index 0000000..02fc543 --- /dev/null +++ b/.vscode/settings.json @@ -0,0 +1,8 @@ +{ + "editor.codeActionsOnSave": { + "source.fixAll.eslint": true + }, + "editor.defaultFormatter": "esbenp.prettier-vscode", + "editor.formatOnSave": true, + "tailwindCSS.experimental.classRegex": [["[\"'`]([^\"'`]*).*?[\"'`]"]] +} diff --git a/LICENSE b/LICENSE index e4d73d5..5a24d8e 100644 --- a/LICENSE +++ b/LICENSE @@ -1,6 +1,6 @@ MIT License -Copyright (c) 2022 Pablo HernΓ‘ndez +Copyright (c) 2022 Pablo Hdez Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal @@ -18,4 +18,4 @@ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. \ No newline at end of file +SOFTWARE. diff --git a/README.md b/README.md index cb6c3d0..bf7bebc 100644 --- a/README.md +++ b/README.md @@ -1,108 +1,103 @@ -

- - SVGL Banner - +

+ + + +

+
+ +
+ + Discover + +  β—  + + Submit logo + +  β—  + + Stack + +  β—  + + Contributing + +
+

-## πŸ“¦ Packages: +
-- ⚑️ [Nextjs](https://nextjs.org/) - The React Framework for Production. -- βš’οΈ [React 18](https://reactjs.org/) - A JavaScript library for building user interfaces. -- πŸ’™ [Typescript](https://www.typescriptlang.org/) - A superset of JavaScript. -- βœ… [Vitest](https://vitest.dev/) - A blazing fast unit test framework. -- πŸ’… [Chakra UI](https://chakra-ui.com/) - Create accessible React apps with speed. -- πŸ’₯ [Framer Motion](https://www.framer.com/motion/) - Production-ready motion library. -- πŸ’– [Phosphor Icons](https://phosphoricons.com/) - A flexible icon family for everyone. -- ⬇️ [Next-PWA](https://github.com/shadowwalker/next-pwa) - Zero config PWA plugin for Next.js, with workbox. +[![GitHub actions](https://img.shields.io/endpoint.svg?url=https%3A%2F%2Factions-badge.atrox.dev%2Fpheralb%2Fsvgl%2Fbadge%3Fref%3Dmain&style=flat)](https://actions-badge.atrox.dev/pheralb/svgl/goto?ref=main) +![GitHub stars](https://img.shields.io/github/stars/pheralb/svgl) +![GitHub issues](https://img.shields.io/github/issues/pheralb/svgl) +![GitHub forks](https://img.shields.io/github/forks/pheralb/svgl) +![GitHub license](https://img.shields.io/github/license/pheralb/svgl) +![GitHub PRs](https://img.shields.io/github/issues-pr/pheralb/svgl) -## πŸš€ Getting started: +
-You need: +## πŸ› οΈ Stack -- [Node.js 16+ (recommend: 16.15.1 LTS)](https://nodejs.org/en/) -- [Git](https://git-scm.com/book/en/v2/Getting-Started-Installing-Git) +- [**Sveltekit**](https://kit.svelte.dev/) - Web development, streamlined. +- [**Typescript**](https://www.typescriptlang.org/) - JavaScript with syntax for types. +- [**Tailwindcss**](https://tailwindcss.com/) - A utility-first CSS framework for rapidly building custom designs. +- [**Prettier**](https://prettier.io/) + [prettier-plugin-tailwindcss](https://github.com/tailwindlabs/prettier-plugin-tailwindcss) - An opinionated code formatter. +- [**phosphor-svelte**](https://github.com/haruaki07/phosphor-svelte) - A clean and friendly icon family for Svelte. +- [**Vitest**](https://vitest.dev/) - Blazing Fast Unit Test Framework. -1. Clone the repository: +## πŸš€ Getting Started + +You will need: + +- [Node.js 16+ (recommended 18 LTS)](https://nodejs.org/en/). +- [Git](https://git-scm.com/). + +1. Clone or [fork](https://github.com/pheralb/svgl/fork) this repository: ```bash -git@github.com:pheralb/svgl.git +git clone git@github.com:pheralb/svgl.git ``` -2. Install dependencies: +2. Install dependencies with your favorite package manager: ```bash +# with npm: npm install -# or + +# with pnpm: +pnpm install + +# with ultra: +ultra install + +# with yarn: yarn install ``` -3. Run: +3. Go to the [**`static/library`**](https://github.com/pheralb/svgl/blob/main/static/library) folder and add your `.svg` logo. Remember to optimize SVG for web use, you can use [SVGOMG](https://jakearchibald.github.io/svgomg/). -```bash -npm run dev -# or -yarn dev -``` - -4. Test & Build: - -```bash -npm run ready -# or -yarn ready -``` - -Open [localhost:3000](localhost:3000) with your browser to see the result. - -## πŸ€” Can I add my logo? - -Yes! Here is a guide for you πŸ₯³: - -1. [Fork the repository](https://github.com/pheralb/svgl/fork). - -2. Clone the forked repository: - -```bash -git@github.com:YOUR_USERNAME/svgl.git -``` - -3. Add the **.svg** logo here: [`/public/library`](https://github.com/pheralb/svgl/tree/main/public/library). - -4. Add your logo information here following the structure: [`/data/svgs.json`](https://github.com/pheralb/svgl/blob/main/data/svgs.json). +4. Go to the [**`src/data/svgs.ts`**](https://github.com/pheralb/svgl/blob/main/src/data/svgs.ts) and add the information about your logo, following the structure: ```json { "id": 1, - "slug": "/library/your_logo.svg", - "title": "Logo Title", - "category": "Logo Category", - "url": "Your Website / app url" -} + "title": "Title", + "category": "Category", + "route": "/library/your_logo.svg", + "url": "Website" +}, ``` -5. Create a commit and push: +And create a pull request with your logo πŸš€. -```bash -git add . -git commit -m "πŸ₯° Added my logo" -git push origin main -``` +## ✌️ Contributing -6. Create a pull request with your changes and πŸ₯³ ready. + + + -## πŸš‚ Api endpoints: +

-```bash -- /api/all: returns all the logos. -- /api/search?id=2: returns the logo with id 2. -- /api/search?q=logo: returns the logo with query. -``` - -## βš’οΈ Shortcuts: - -- ⭐ SVG Library: [/public/library/](https://github.com/pheralb/svgl/tree/main/public/library). -- ✍️ SVG JSON logos: [/data/](https://github.com/pheralb/svgl/tree/main/data). - -## πŸ”‘ License: +## πŸ”‘ License - [MIT](https://github.com/pheralb/svgl/blob/main/LICENSE). diff --git a/data/svgs.json b/data/svgs.json deleted file mode 100644 index f1e5d8f..0000000 --- a/data/svgs.json +++ /dev/null @@ -1,1010 +0,0 @@ -[ - { - "id": 1, - "slug": "/library/discord.svg", - "title": "Discord", - "category": "Software", - "url": "https://discord.com/" - }, - { - "id": 2, - "slug": "/library/github.svg", - "title": "Github", - "category": "Software", - "url": "https://github.com/" - }, - { - "id": 3, - "slug": "/library/preact.svg", - "title": "Preact", - "category": "Library", - "url": "https://preactjs.com/" - }, - { - "id": 4, - "slug": "/library/react.svg", - "title": "React", - "category": "Library", - "url": "https://reactjs.org/" - }, - { - "id": 5, - "slug": "/library/vercel.svg", - "title": "Vercel", - "category": "Hosting", - "url": "https://vercel.com/" - }, - { - "id": 6, - "slug": "/library/svelte.svg", - "title": "Svelte", - "category": "Library", - "url": "https://svelte.dev/" - }, - { - "id": 7, - "slug": "/library/vue.svg", - "title": "Vue", - "category": "Framework", - "url": "https://vuejs.org/" - }, - { - "id": 8, - "slug": "/library/nuxt.svg", - "title": "Nuxt", - "category": "Framework", - "url": "https://nuxtjs.org/" - }, - { - "id": 9, - "slug": "/library/nextjs.svg", - "title": "Nextjs", - "category": "Framework", - "url": "https://nextjs.org/" - }, - { - "id": 10, - "slug": "/library/vscode.svg", - "title": "VSCode", - "category": "Software", - "url": "https://code.visualstudio.com/" - }, - { - "id": 11, - "slug": "/library/jwt.svg", - "title": "JWT", - "category": "Library", - "url": "https://jwt.io/" - }, - { - "id": 12, - "slug": "/library/strapi.svg", - "title": "Strapi", - "category": "CMS", - "url": "https://strapi.io/" - }, - { - "id": 13, - "slug": "/library/figma.svg", - "title": "Figma", - "category": "Software", - "url": "https://www.figma.com/" - }, - { - "id": 14, - "slug": "/library/spotify.svg", - "title": "Spotify", - "category": "Software", - "url": "https://www.spotify.com/" - }, - { - "id": 15, - "slug": "/library/postman.svg", - "title": "Postman", - "category": "Software", - "url": "https://www.getpostman.com/" - }, - { - "id": 16, - "slug": "/library/algolia.svg", - "title": "Algolia", - "category": "Library", - "url": "https://www.algolia.com/" - }, - { - "id": 17, - "slug": "/library/bootstrap.svg", - "title": "Bootstrap", - "category": "Framework", - "url": "https://getbootstrap.com/" - }, - { - "id": 18, - "slug": "/library/firebase.svg", - "title": "Firebase", - "category": "Hosting", - "url": "https://firebase.google.com/" - }, - { - "id": 19, - "slug": "/library/supabase.svg", - "title": "Supabase", - "category": "Database", - "url": "https://supabase.com/" - }, - { - "id": 20, - "slug": "/library/vitejs.svg", - "title": "Vite.js", - "category": "Compiler", - "url": "https://vitejs.dev" - }, - { - "id": 21, - "slug": "/library/facebook.svg", - "title": "Facebook", - "category": "Social", - "url": "https://www.facebook.com/" - }, - { - "id": 22, - "slug": "/library/twitter.svg", - "title": "Twitter", - "category": "Social", - "url": "https://twitter.com/" - }, - { - "id": 23, - "slug": "/library/nodejs.svg", - "title": "Node.js", - "category": "Library", - "url": "https://nodejs.org/" - }, - { - "id": 24, - "slug": "/library/esbuild.svg", - "title": "Esbuild", - "category": "Compiler", - "url": "https://esbuild.github.io/" - }, - { - "id": 25, - "slug": "/library/deno.svg", - "title": "Deno", - "category": "Library", - "url": "https://deno.land/" - }, - { - "id": 26, - "slug": "/library/gatsby.svg", - "title": "Gatsby", - "category": "Framework", - "url": "https://www.gatsbyjs.org/" - }, - { - "id": 27, - "slug": "/library/npm.svg", - "title": "NPM", - "category": "Software", - "url": "https://www.npmjs.com/" - }, - { - "id": 28, - "slug": "/library/homebrew.svg", - "title": "Homebrew", - "category": "Software", - "url": "https://brew.sh/" - }, - { - "id": 29, - "slug": "/library/sublimetext.svg", - "title": "Sublime Text", - "category": "Software", - "url": "https://www.sublimetext.com/" - }, - { - "id": 30, - "slug": "/library/turborepo.svg", - "title": "TurboRepo", - "category": "Library", - "url": "https://turborepo.org/" - }, - { - "id": 31, - "slug": "/library/tailwindcss.svg", - "title": "Tailwind CSS", - "category": "Framework", - "url": "https://tailwindcss.com/" - }, - { - "id": 32, - "slug": "/library/styledcomponents.svg", - "title": "Styled Components", - "category": "Library", - "url": "https://styled-components.com/" - }, - { - "id": 33, - "slug": "/library/angular.svg", - "title": "Angular", - "category": "Framework", - "url": "https://angular.io/" - }, - { - "id": 34, - "slug": "/library/blitzjs.svg", - "title": "Blitz", - "category": "Framework", - "url": "https://blitzjs.com/" - }, - { - "id": 35, - "slug": "/library/lit.svg", - "title": "Lit", - "category": "Library", - "url": "https://lit.dev/" - }, - { - "id": 36, - "slug": "/library/atom.svg", - "title": "Atom", - "category": "Software", - "url": "https://atom.io/" - }, - { - "id": 37, - "slug": "/library/youtube.svg", - "title": "YouTube", - "category": "Social", - "url": "https://www.youtube.com/" - }, - { - "id": 38, - "slug": "/library/astro.svg", - "title": "Astro", - "category": "Framework", - "url": "https://astro.build/" - }, - { - "id": 39, - "slug": "/library/google.svg", - "title": "Google", - "category": "Social", - "url": "https://www.google.com/" - }, - { - "id": 40, - "slug": "/library/framer.svg", - "title": "Framer", - "category": "Software", - "url": "https://framer.com/" - }, - { - "id": 41, - "slug": "/library/netflix.svg", - "title": "Netflix", - "category": "Entertainment", - "url": "https://www.netflix.com/" - }, - { - "id": 42, - "slug": "/library/firefox.svg", - "title": "Firefox", - "category": "Software", - "url": "https://www.mozilla.org/en-US/firefox/" - }, - { - "id": 43, - "slug": "/library/linkedin.svg", - "title": "LinkedIn", - "category": "Social", - "url": "https://www.linkedin.com/" - }, - { - "id": 44, - "slug": "/library/telegram.svg", - "title": "Telegram", - "category": "Social", - "url": "https://web.telegram.org/" - }, - { - "id": 45, - "slug": "/library/whatsapp.svg", - "title": "WhatsApp", - "category": "Social", - "url": "https://web.whatsapp.com/" - }, - { - "id": 46, - "slug": "/library/headlessui.svg", - "title": "Headless UI", - "category": "Library", - "url": "https://headlessui.dev/" - }, - { - "id": 47, - "slug": "/library/kotlin.svg", - "title": "Kotlin", - "category": "Language", - "url": "https://kotlinlang.org/" - }, - { - "id": 48, - "slug": "/library/vitest.svg", - "title": "Vitest", - "category": "Framework", - "url": "https://vitest.dev/" - }, - { - "id": 49, - "slug": "/library/storybook.svg", - "title": "Storybook", - "category": "Software", - "url": "https://storybook.js.org/" - }, - { - "id": 50, - "slug": "/library/netlify.svg", - "title": "Netlify", - "category": "Hosting", - "url": "https://www.netlify.com/" - }, - { - "id": 51, - "slug": "/library/solidjs.svg", - "title": "Solidjs", - "category": "Framework", - "url": "https://www.solidjs.com/" - }, - { - "id": 52, - "slug": "/library/mongodb.svg", - "title": "MongoDB", - "category": "Database", - "url": "https://www.mongodb.com/" - }, - { - "id": 53, - "slug": "/library/babel.svg", - "title": "Babel", - "category": "Compiler", - "url": "https://babeljs.io" - }, - { - "id": 54, - "slug": "/library/moon.svg", - "title": "Moon", - "category": "Framework", - "url": "https://moonjs.org/" - }, - { - "id": 55, - "slug": "/library/payload.svg", - "title": "Payload CMS", - "category": "CMS", - "url": "https://payloadcms.com" - }, - { - "id": 56, - "slug": "/library/fly.svg", - "title": "Fly", - "category": "Hosting", - "url": "https://fly.io" - }, - { - "id": 57, - "slug": "/library/learnthis.svg", - "title": "LearnThis", - "category": "Education", - "url": "https://learnthisacademy.com" - }, - { - "id": 58, - "slug": "/library/speackme.svg", - "title": "Speack.me", - "category": "Social", - "url": "https://speack.me" - }, - { - "id": 59, - "slug": "/library/chakra-ui.svg", - "title": "Chakra UI", - "category": "Library", - "url": "https://chakra-ui.com" - }, - { - "id": 60, - "slug": "/library/expressjs.svg", - "title": "Express.js", - "category": "Framework", - "url": "https://expressjs.com" - }, - { - "id": 61, - "slug": "/library/fastify.svg", - "title": "Fastify", - "category": "Framework", - "url": "https://www.fastify.io" - }, - { - "id": 62, - "slug": "/library/javascript.svg", - "title": "JavaScript", - "category": "Language", - "url": "https://developer.mozilla.org/docs/Web/JavaScript" - }, - { - "id": 63, - "slug": "/library/jquery.svg", - "title": "jQuery", - "category": "Language", - "url": "https://jquery.com" - }, - { - "id": 64, - "slug": "/library/rapidapi.svg", - "title": "Rapid API", - "category": "Software", - "url": "https://rapidapi.com" - }, - { - "id": 65, - "slug": "/library/typescript.svg", - "title": "TypeScript", - "category": "Language", - "url": "https://www.typescriptlang.org" - }, - { - "id": 66, - "slug": "/library/bun.svg", - "title": "Bun", - "category": "Library", - "url": "https://bun.sh" - }, - { - "id": 67, - "slug": "/library/twilio.svg", - "title": "Twilio", - "category": "Software", - "url": "https://twilio.com" - }, - { - "id": 68, - "slug": "/library/arc.svg", - "title": "Arc", - "category": "Software", - "url": "https://arc.dev" - }, - { - "id": 69, - "slug": "/library/qwik.svg", - "title": "Qwik", - "category": "Framework", - "url": "https://qwik.builder.io/" - }, - { - "id": 70, - "slug": "/library/authy.svg", - "title": "Authy", - "category": "Software", - "url": "https://authy.com/" - }, - { - "id": 71, - "slug": "/library/notion.svg", - "title": "Notion", - "category": "Software", - "url": "https://notion.so/" - }, - { - "id": 72, - "slug": "/library/nestjs.svg", - "title": "NestJS", - "category": "Framework", - "url": "https://nestjs.com/" - }, - { - "id": 73, - "slug": "/library/copilot.svg", - "title": "Github Copilot", - "category": "Software", - "url": "https://github.com/features/copilot" - }, - { - "id": 74, - "slug": "/library/railway.svg", - "title": "Railway", - "category": "Software", - "url": "https://railway.app/" - }, - { - "id": 75, - "slug": "/library/docusaurus.svg", - "title": "Docusaurus", - "category": "Software", - "url": "https://docusaurus.io/" - }, - { - "id": 76, - "slug": "/library/twitch.svg", - "title": "Twitch", - "category": "Entertainment", - "url": "https://twitch.tv" - }, - { - "id": 77, - "slug": "/library/godaddy.svg", - "title": "GoDaddy", - "category": "Hosting", - "url": "https://www.godaddy.com/" - }, - { - "id": 78, - "slug": "/library/udemy.svg", - "title": "Udemy", - "category": "Education", - "url": "https://www.udemy.com/" - }, - { - "id": 79, - "slug": "/library/graphql.svg", - "title": "GraphQL", - "category": "Language", - "url": "https://graphql.org/" - }, - { - "id": 80, - "slug": "/library/gitlab.svg", - "title": "GitLab", - "category": "Software", - "url": "https://gitlab.com/" - }, - { - "id": 81, - "slug": "/library/prisma.svg", - "title": "Prisma", - "category": "Software", - "url": "https://prisma.io/" - }, - { - "id": 82, - "slug": "/library/golang.svg", - "title": "Go", - "category": "Language", - "url": "https://go.dev/" - }, - { - "id": 83, - "slug": "/library/platzi.svg", - "title": "Platzi", - "category": "Education", - "url": "https://platzi.com/" - }, - { - "id": 84, - "slug": "/library/coursera.svg", - "title": "Coursera", - "category": "Education", - "url": "https://www.coursera.org/" - }, - { - "id": 85, - "slug": "/library/udacity.svg", - "title": "Udacity", - "category": "Education", - "url": "https://www.udacity.com/" - }, - { - "id": 86, - "slug": "/library/kubernetes.svg", - "title": "Kubernetes", - "category": "Software", - "url": "https://kubernetes.io/" - }, - { - "id": 87, - "slug": "/library/docker.svg", - "title": "Docker", - "category": "Software", - "url": "https://www.docker.com/" - }, - { - "id": 88, - "slug": "/library/aws.svg", - "title": "Amazon Web Services", - "category": "Software", - "url": "https://aws.amazon.com/" - }, - { - "id": 89, - "slug": "/library/azure.svg", - "title": "Microsoft Azure", - "category": "Software", - "url": "https://azure.microsoft.com/" - }, - { - "id": 90, - "slug": "/library/heroku.svg", - "title": "Heroku", - "category": "Software", - "url": "https://www.heroku.com/" - }, - { - "id": 91, - "slug": "/library/jetbrains.svg", - "title": "JetBrains", - "category": "Software", - "url": "https://www.jetbrains.com/" - }, - { - "id": 92, - "slug": "/library/rider.svg", - "title": "JetBrains Rider", - "category": "Software", - "url": "https://www.jetbrains.com/rider/" - }, - { - "id": 93, - "slug": "/library/planetscale.svg", - "title": "PlanetScale", - "category": "Database", - "url": "https://planetscale.com/" - }, - { - "id": 94, - "slug": "/library/playwright.svg", - "title": "Playwright", - "category": "Framework", - "url": "https://playwright.dev/" - }, - { - "id": 95, - "slug": "/library/atlassian.svg", - "title": "Atlassian", - "category": "Software", - "url": "https://www.atlassian.com/" - }, - { - "id": 96, - "slug": "/library/discourse.svg", - "title": "Discourse", - "category": "Software", - "url": "https://discourse.org/" - }, - { - "id": 97, - "slug": "/library/ember.svg", - "title": "Ember", - "category": "Framework", - "url": "https://emberjs.com/" - }, - { - "id": 98, - "slug": "/library/expo.svg", - "title": "Expo", - "category": "Software", - "url": "https://expo.dev/" - }, - { - "id": 99, - "slug": "/library/flutter.svg", - "title": "Flutter", - "category": "Framework", - "url": "https://flutter.dev/" - }, - { - "id": 100, - "slug": "/library/fresh.svg", - "title": "Fresh", - "category": "Framework", - "url": "https://fresh.deno.dev/" - }, - { - "id": 101, - "slug": "/library/git.svg", - "title": "Git", - "category": "Software", - "url": "https://git-scm.com/" - }, - { - "id": 102, - "slug": "/library/hostgator.svg", - "title": "Hostgator", - "category": "Hosting", - "url": "https://www.hostgator.com/" - }, - { - "id": 103, - "slug": "/library/intellijidea.svg", - "title": "IntelliJ IDEA", - "category": "Software", - "url": "https://www.jetbrains.com/idea/" - }, - { - "id": 104, - "slug": "/library/jasmine.svg", - "title": "Jasmine", - "category": "Framework", - "url": "https://jasmine.github.io/" - }, - { - "id": 105, - "slug": "/library/java.svg", - "title": "Java", - "category": "Language", - "url": "https://www.java.com/" - }, - { - "id": 106, - "slug": "/library/jest.svg", - "title": "Jest", - "category": "Framework", - "url": "https://jestjs.io/" - }, - { - "id": 107, - "slug": "/library/jetbrainsSolid.svg", - "title": "JetBrains", - "category": "Software", - "url": "https://www.jetbrains.com/" - }, - { - "id": 108, - "slug": "/library/krakenjs.svg", - "title": "KrakenJS", - "category": "Framework", - "url": "https://krakenjs.com/" - }, - { - "id": 109, - "slug": "/library/laravel.svg", - "title": "Laravel", - "category": "Framework", - "url": "https://laravel.com/" - }, - { - "id": 110, - "slug": "/library/mariadb.svg", - "title": "MariaDB", - "category": "Database", - "url": "https://mariadb.org/" - }, - { - "id": 111, - "slug": "/library/materialui.svg", - "title": "Material UI", - "category": "Framework", - "url": "https://mui.com/" - }, - { - "id": 112, - "slug": "/library/mysql.svg", - "title": "MySQL", - "category": "Database", - "url": "https://www.mysql.com/" - }, - { - "id": 113, - "slug": "/library/parcel.svg", - "title": "Parcel", - "category": "Compiler", - "url": "https://parceljs.org/" - }, - { - "id": 114, - "slug": "/library/pm2.svg", - "title": "PM2", - "category": "Framework", - "url": "https://pm2.io/" - }, - { - "id": 115, - "slug": "/library/postgresql.svg", - "title": "PostgreSQL", - "category": "Database", - "url": "https://www.postgresql.org/" - }, - { - "id": 116, - "slug": "/library/reactquery.svg", - "title": "React Query", - "category": "Framework", - "url": "https://tanstack.com/query/v4" - }, - { - "id": 117, - "slug": "/library/redis.svg", - "title": "Redis", - "category": "Database", - "url": "https://redis.io/" - }, - { - "id": 118, - "slug": "/library/redwoodjs.svg", - "title": "RedwoodJS", - "category": "Framework", - "url": "https://redwoodjs.com/" - }, - { - "id": 119, - "slug": "/library/ruby.svg", - "title": "Ruby", - "category": "Language", - "url": "https://www.ruby-lang.org/" - }, - { - "id": 120, - "slug": "/library/scala.svg", - "title": "Scala", - "category": "Language", - "url": "https://www.scala-lang.org/" - }, - { - "id": 121, - "slug": "/library/sequelize.svg", - "title": "Sequelize", - "category": "Framework", - "url": "https://sequelize.org/" - }, - { - "id": 122, - "slug": "/library/spinnaker.svg", - "title": "Spinnaker", - "category": "Software", - "url": "https://spinnaker.io/" - }, - { - "id": 123, - "slug": "/library/sqlite.svg", - "title": "SQLite", - "category": "Database", - "url": "https://www.sqlite.org/" - }, - { - "id": 124, - "slug": "/library/swagger.svg", - "title": "Swagger", - "category": "Software", - "url": "https://swagger.io/" - }, - { - "id": 125, - "slug": "/library/swift.svg", - "title": "Swift", - "category": "Language", - "url": "https://swift.org/" - }, - { - "id": 126, - "slug": "/library/testinglibrary.svg", - "title": "Testing Library", - "category": "Framework", - "url": "https://testing-library.com/" - }, - { - "id": 127, - "slug": "/library/typeorm.svg", - "title": "TypeORM", - "category": "Database", - "url": "https://typeorm.io/" - }, - { - "id": 128, - "slug": "/library/unity.svg", - "title": "Unity", - "category": "Software", - "url": "https://unity.com/" - }, - { - "id": 129, - "slug": "/library/vim.svg", - "title": "Vim", - "category": "Software", - "url": "https://www.vim.org/" - }, - { - "id": 130, - "slug": "/library/wmr.svg", - "title": "WMR", - "category": "Compiler", - "url": "https://wmr.dev/" - }, - { - "id": 131, - "slug": "/library/openbootcamp.svg", - "title": "OpenBootcamp", - "category": "Education", - "url": "https://open-bootcamp.com/" - }, - { - "id": 132, - "slug": "/library/digitalocean.svg", - "title": "Digital Ocean", - "category": "Software", - "url": "https://www.digitalocean.com/" - }, - { - "id": 133, - "slug": "/library/disneyplus.svg", - "title": "Disney+", - "category": "Entertainment", - "url": "https://www.disneyplus.com/" - }, - { - "id": 134, - "slug": "/library/reactrouter.svg", - "title": "React Router", - "category": "Library", - "url": "https://reactrouter.com/en/main" - }, - { - "id": 135, - "slug": "/library/gdsc.svg", - "title": "Google Student Developer Club", - "category": "Google", - "url": "https://gdsc.community.dev/" - }, - { - "id": 136, - "slug": "/library/brave.svg", - "title": "Brave Browser", - "category": "Browser", - "url": "https://brave.com/" - }, - { - "id": 137, - "slug": "/library/eclipse.svg", - "title": "Eclipse IDE", - "category": "IDE", - "url": "https://www.eclipse.org/" - }, - { - "id": 138, - "slug": "/library/html5.svg", - "title": "HTML5", - "category": "Language", - "url": "https://es.wikipedia.org/wiki/HTML5" - }, - { - "id": 139, - "slug": "/library/css.svg", - "title": "CSS", - "category": "Language", - "url": "https://es.wikipedia.org/wiki/CSS" - }, - { - "id": 140, - "slug": "/library/midudev.svg", - "title": "midudev", - "category": "Education", - "url": "https://midu.dev" - }, - { - "id": 141, - "slug": "/library/apple.svg", - "title": "Apple", - "category": "Software", - "url": "https://www.apple.com" - }, - { - "id": 142, - "slug": "/library/android.svg", - "title": "Android", - "category": "Software", - "url": "https://www.android.com/" - }, - { - "id": 143, - "slug": "/library/windows.svg", - "title": "Windows", - "category": "Software", - "url": "https://www.microsoft.com/windows" - }, - { - "id": 144, - "slug": "/library/python.svg", - "title": "Python", - "category": "Language", - "url": "https://www.python.org/" - } -] \ No newline at end of file diff --git a/next-env.d.ts b/next-env.d.ts deleted file mode 100644 index 4f11a03..0000000 --- a/next-env.d.ts +++ /dev/null @@ -1,5 +0,0 @@ -/// -/// - -// NOTE: This file should not be edited -// see https://nextjs.org/docs/basic-features/typescript for more information. diff --git a/next-seo.config.ts b/next-seo.config.ts deleted file mode 100644 index a2e4c89..0000000 --- a/next-seo.config.ts +++ /dev/null @@ -1,57 +0,0 @@ -export default { - title: "A beautiful library with SVG logos", - titleTemplate: "%s - Svgl", - description: "Svgl is a library of free and open source SVG logos.", - defaultTitle: "svgl", - additionalLinkTags: [ - { - rel: "icon", - href: "/icons/icon.ico", - }, - { - rel: "apple-touch-icon", - href: "/icons/apple-touch-icon-180x180.png", - sizes: "180x180", - }, - { - rel: "apple-touch-icon", - href: "/icons/apple-touch-icon-152x152.png", - sizes: "152x152", - }, - { - rel: "apple-touch-icon", - href: "/icons/apple-touch-icon-114x114.png", - sizes: "114x114", - }, - { - rel: "manifest", - href: "/manifest.json", - }, - { - rel: "preload", - href: "/fonts/Inter-Regular.woff2", - as: "font", - type: "font/woff2", - crossOrigin: "anonymous", - }, - ], - openGraph: { - site_name: "Svgl", - url: "https://svgl.vercel.app/", - type: "website", - locale: "en_IE", - images: [ - { - url: "/images/banner.png", - width: 1920, - height: 1080, - type: "image/png", - } - ], - }, - twitter: { - handle: "@pheralb_", - site: "@pheralb_", - cardType: "summary_large_image", - }, -}; diff --git a/next.config.js b/next.config.js deleted file mode 100644 index 9fbf65a..0000000 --- a/next.config.js +++ /dev/null @@ -1,14 +0,0 @@ -/** @type {import('next').NextConfig} */ -const withPWA = require("next-pwa"); - -const nextConfig = withPWA({ - reactStrictMode: true, - pwa: { - dest: "public", - register: true, - skipWaiting: true, - disable: process.env.NODE_ENV === "development", - }, -}); - -module.exports = nextConfig; diff --git a/package.json b/package.json index c37aee3..fe2dcf3 100644 --- a/package.json +++ b/package.json @@ -1,10 +1,11 @@ { "name": "svgl", - "version": "2.0.1", + "author": "@pheralb_", + "version": "3.0.0", "description": "A beautiful library with SVG logos.", "private": true, - "author": "@pheralb_", "license": "MIT", + "type": "module", "keywords": [ "svgs", "logos", @@ -12,45 +13,41 @@ "library" ], "scripts": { - "dev": "next dev", - "build": "next build", - "start": "next start", - "lint": "next lint", - "test": "vitest", - "ready": "vitest && next build" + "dev": "vite dev", + "host": "vite dev --host", + "build": "vite build", + "preview": "vite preview", + "check": "svelte-kit sync && svelte-check --tsconfig ./tsconfig.json", + "check:watch": "svelte-kit sync && svelte-check --tsconfig ./tsconfig.json --watch", + "test:unit": "vitest", + "lint": "prettier --plugin-search-dir . --check . && eslint .", + "format": "prettier --plugin-search-dir . --write ." }, "dependencies": { - "@chakra-ui/react": "2.2.4", - "@emotion/react": "11.10.0", - "@emotion/styled": "11.10.0", - "@uiball/loaders": "1.2.6", - "canvas-confetti": "1.5.1", "downloadjs": "1.4.7", - "framer-motion": "6.5.1", - "next": "12.2.3", - "next-pwa": "5.5.4", - "next-seo": "5.5.0", - "nextjs-progressbar": "0.0.14", - "phosphor-react": "1.4.1", - "react": "18.2.0", - "react-dom": "18.2.0", - "react-hot-toast": "2.3.0", - "react-hotkeys-hook": "3.4.7", - "swr": "1.3.0" + "svelte-french-toast": "1.0.3" }, "devDependencies": { - "@testing-library/jest-dom": "5.16.4", - "@testing-library/react": "13.3.0", - "@types/canvas-confetti": "1.4.3", + "@sveltejs/adapter-auto": "2.0.0", + "@sveltejs/kit": "1.11.0", "@types/downloadjs": "1.4.3", - "@types/node": "18.6.3", - "@types/react": "18.0.15", - "@types/react-dom": "18.0.6", - "@vitejs/plugin-react": "2.0.0", - "eslint": "8.21.0", - "eslint-config-next": "12.2.3", - "jsdom": "20.0.0", - "typescript": "4.7.4", - "vitest": "0.20.2" + "@typescript-eslint/eslint-plugin": "5.55.0", + "@typescript-eslint/parser": "5.55.0", + "autoprefixer": "10.4.14", + "eslint": "8.36.0", + "eslint-config-prettier": "8.7.0", + "eslint-plugin-svelte3": "4.0.0", + "phosphor-svelte": "1.2.1", + "postcss": "8.4.21", + "prettier": "2.8.4", + "prettier-plugin-svelte": "2.9.0", + "prettier-plugin-tailwindcss": "0.2.4", + "svelte": "3.56.0", + "svelte-check": "3.1.4", + "tailwindcss": "3.2.7", + "tslib": "2.5.0", + "typescript": "4.9.5", + "vite": "4.1.4", + "vitest": "0.29.2" } } diff --git a/postcss.config.cjs b/postcss.config.cjs new file mode 100644 index 0000000..33ad091 --- /dev/null +++ b/postcss.config.cjs @@ -0,0 +1,6 @@ +module.exports = { + plugins: { + tailwindcss: {}, + autoprefixer: {}, + }, +} diff --git a/prettier.config.cjs b/prettier.config.cjs new file mode 100644 index 0000000..eb095cf --- /dev/null +++ b/prettier.config.cjs @@ -0,0 +1,4 @@ +/** @type {import("prettier").Config} */ +module.exports = { + plugins: [require.resolve('prettier-plugin-tailwindcss')] +}; diff --git a/public/fonts/Inter-Regular.woff2 b/public/fonts/Inter-Regular.woff2 deleted file mode 100644 index 6c2b689..0000000 Binary files a/public/fonts/Inter-Regular.woff2 and /dev/null differ diff --git a/public/fonts/Inter-SemiBold.woff2 b/public/fonts/Inter-SemiBold.woff2 deleted file mode 100644 index 611e90c..0000000 Binary files a/public/fonts/Inter-SemiBold.woff2 and /dev/null differ diff --git a/public/icons/apple-touch-icon-114x114.png b/public/icons/apple-touch-icon-114x114.png deleted file mode 100644 index af5a4c6..0000000 Binary files a/public/icons/apple-touch-icon-114x114.png and /dev/null differ diff --git a/public/icons/apple-touch-icon-152x152.png b/public/icons/apple-touch-icon-152x152.png deleted file mode 100644 index f564ff0..0000000 Binary files a/public/icons/apple-touch-icon-152x152.png and /dev/null differ diff --git a/public/icons/apple-touch-icon-180x180.png b/public/icons/apple-touch-icon-180x180.png deleted file mode 100644 index e02e55c..0000000 Binary files a/public/icons/apple-touch-icon-180x180.png and /dev/null differ diff --git a/public/icons/icon-192x192.png b/public/icons/icon-192x192.png deleted file mode 100644 index 59e92f9..0000000 Binary files a/public/icons/icon-192x192.png and /dev/null differ diff --git a/public/icons/icon-256x256.png b/public/icons/icon-256x256.png deleted file mode 100644 index 48af2ae..0000000 Binary files a/public/icons/icon-256x256.png and /dev/null differ diff --git a/public/icons/icon-384x384.png b/public/icons/icon-384x384.png deleted file mode 100644 index 88d91c2..0000000 Binary files a/public/icons/icon-384x384.png and /dev/null differ diff --git a/public/icons/icon-512x512.png b/public/icons/icon-512x512.png deleted file mode 100644 index 317de40..0000000 Binary files a/public/icons/icon-512x512.png and /dev/null differ diff --git a/public/icons/icon.ico b/public/icons/icon.ico deleted file mode 100644 index 365b013..0000000 Binary files a/public/icons/icon.ico and /dev/null differ diff --git a/public/icons/logo.png b/public/icons/logo.png deleted file mode 100644 index bac5683..0000000 Binary files a/public/icons/logo.png and /dev/null differ diff --git a/public/icons/maskable_icon.png b/public/icons/maskable_icon.png deleted file mode 100644 index 9137b60..0000000 Binary files a/public/icons/maskable_icon.png and /dev/null differ diff --git a/public/library/nextjs.svg b/public/library/nextjs.svg deleted file mode 100644 index a18312d..0000000 --- a/public/library/nextjs.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/public/library/nuxt.svg b/public/library/nuxt.svg deleted file mode 100644 index cdff626..0000000 --- a/public/library/nuxt.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/public/library/speackme.svg b/public/library/speackme.svg deleted file mode 100644 index dc35fc6..0000000 --- a/public/library/speackme.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/public/library/vscode.svg b/public/library/vscode.svg deleted file mode 100644 index 062b8c9..0000000 --- a/public/library/vscode.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/public/manifest.json b/public/manifest.json deleted file mode 100644 index 6a2f388..0000000 --- a/public/manifest.json +++ /dev/null @@ -1,38 +0,0 @@ -{ - "theme_color": "#4343E5", - "background_color": "#050505", - "display": "minimal-ui", - "scope": "/", - "start_url": "/", - "name": "SVGL", - "short_name": "SVGL", - "description": "Beautiful SVG vector logos", - "icons": [ - { - "src": "/icons/icon-192x192.png", - "sizes": "192x192", - "type": "image/png" - }, - { - "src": "/icons/icon-256x256.png", - "sizes": "256x256", - "type": "image/png" - }, - { - "src": "/icons/icon-384x384.png", - "sizes": "384x384", - "type": "image/png" - }, - { - "src": "/icons/icon-512x512.png", - "sizes": "512x512", - "type": "image/png" - }, - { - "src": "/icons/maskable_icon.png", - "sizes": "196x196", - "type": "image/png", - "purpose": "maskable" - } - ] -} diff --git a/src/_tests_/categories.test.tsx b/src/_tests_/categories.test.tsx deleted file mode 100644 index b9a8974..0000000 --- a/src/_tests_/categories.test.tsx +++ /dev/null @@ -1,13 +0,0 @@ -import React from "react"; -import { test, expect, describe } from "vitest"; -import { render, screen } from "@testing-library/react"; -import "@testing-library/jest-dom"; -import Categories from "@/layout/header/categories"; - -describe("Categories", () => { - test("renders learn react link", () => { - render(); - const showText = screen.getByText(/software/i); - expect(showText).toBeInTheDocument(); - }); -}); diff --git a/src/animations/show.tsx b/src/animations/show.tsx deleted file mode 100644 index 0d8a350..0000000 --- a/src/animations/show.tsx +++ /dev/null @@ -1,24 +0,0 @@ -import React, { FC } from "react"; -import { motion } from "framer-motion"; - -type ShowProps = { - children: React.ReactNode; - delay?: number; -}; - -const Show = ({ children, delay }: ShowProps) => { - return ( - - {children} - - ); -}; - -export default Show; diff --git a/src/animations/tap.tsx b/src/animations/tap.tsx deleted file mode 100644 index e5dd2d6..0000000 --- a/src/animations/tap.tsx +++ /dev/null @@ -1,16 +0,0 @@ -import React from "react"; -import { motion } from "framer-motion"; - -type TapAnimation = { - children: React.ReactNode; -}; - -const Tap = ({ children } : TapAnimation) => { - return ( - - {children} - - ); -}; - -export default Tap; diff --git a/src/app.css b/src/app.css new file mode 100644 index 0000000..2b53307 --- /dev/null +++ b/src/app.css @@ -0,0 +1,31 @@ +@tailwind base; +@tailwind components; +@tailwind utilities; + +@font-face { + font-family: 'General-Sans'; + src: url('/fonts/GeneralSans-Variable.woff2') format('woff2'); + font-weight: 200 700; + font-display: swap; + font-style: normal; +} + +body { + --sb-track-color: #171717; + --sb-thumb-color: #404040; + --sb-size: 10px; + + scrollbar-color: var(--sb-thumb-color) var(--sb-track-color); +} + +body::-webkit-scrollbar { + width: var(--sb-size); +} + +body::-webkit-scrollbar-track { + background: var(--sb-track-color); +} + +body::-webkit-scrollbar-thumb { + background: var(--sb-thumb-color); +} diff --git a/src/app.d.ts b/src/app.d.ts new file mode 100644 index 0000000..899c7e8 --- /dev/null +++ b/src/app.d.ts @@ -0,0 +1,12 @@ +// See https://kit.svelte.dev/docs/types#app +// for information about these interfaces +declare global { + namespace App { + // interface Error {} + // interface Locals {} + // interface PageData {} + // interface Platform {} + } +} + +export {}; diff --git a/src/app.html b/src/app.html new file mode 100644 index 0000000..f3f9eab --- /dev/null +++ b/src/app.html @@ -0,0 +1,33 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + A beautiful library with SVG logos - Svgl + %sveltekit.head% + + +
%sveltekit.body%
+ + diff --git a/src/common/grid.tsx b/src/common/grid.tsx deleted file mode 100644 index 33bf93a..0000000 --- a/src/common/grid.tsx +++ /dev/null @@ -1,13 +0,0 @@ -import React from "react"; -import { LayoutProps } from "@/interfaces/components"; -import { SimpleGrid } from "@chakra-ui/react"; - -const Grid = (props: LayoutProps) => { - return ( - - {props.children} - - ); -}; - -export default Grid; diff --git a/src/common/iconBtn.tsx b/src/common/iconBtn.tsx deleted file mode 100644 index f97c746..0000000 --- a/src/common/iconBtn.tsx +++ /dev/null @@ -1,18 +0,0 @@ -import React from "react"; -import { CustomIconBtnProps } from "@/interfaces/components"; -import { IconButton } from "@chakra-ui/react"; - -const CustomIconBtn = (props: CustomIconBtnProps) => { - return ( - - ); -}; - -export default CustomIconBtn; diff --git a/src/common/link.tsx b/src/common/link.tsx deleted file mode 100644 index bbfacc2..0000000 --- a/src/common/link.tsx +++ /dev/null @@ -1,23 +0,0 @@ -import React from "react"; -import { Link } from "@chakra-ui/react"; -import NextLink from "next/link"; -import { CustomLinkProps } from "@/interfaces/components"; - -const CustomLink = ({ href, children, external, font, mr, ml }: CustomLinkProps) => { - return ( - - - {children} - - - ); -}; - -export default CustomLink; diff --git a/src/components/container.svelte b/src/components/container.svelte new file mode 100644 index 0000000..aa71327 --- /dev/null +++ b/src/components/container.svelte @@ -0,0 +1,3 @@ +
+ +
diff --git a/src/components/error.tsx b/src/components/error.tsx deleted file mode 100644 index a31bf50..0000000 --- a/src/components/error.tsx +++ /dev/null @@ -1,47 +0,0 @@ -import { ErrorProps } from "@/interfaces/components"; -import { - Button, - Center, - Heading, - HStack, - Text, - VStack, -} from "@chakra-ui/react"; -import { ArrowClockwise, ArrowSquareOut, Warning } from "phosphor-react"; -import { useRouter } from "next/router"; -import CustomLink from "@/common/link"; - -const Error = (props: ErrorProps) => { - const router = useRouter(); - - const handleRefresh = () => { - router.reload(); - }; - - return ( -
- - - {props.title} - {props.description} - - - - - - - -
- ); -}; - -export default Error; diff --git a/src/components/grid.svelte b/src/components/grid.svelte new file mode 100644 index 0000000..14f8d22 --- /dev/null +++ b/src/components/grid.svelte @@ -0,0 +1,5 @@ +
+ +
diff --git a/src/components/loading.tsx b/src/components/loading.tsx deleted file mode 100644 index 798b74f..0000000 --- a/src/components/loading.tsx +++ /dev/null @@ -1,16 +0,0 @@ -import { LoadingProps } from "@/interfaces/components"; -import { Center, Spinner, Text, VStack } from "@chakra-ui/react"; -import { LeapFrog } from "@uiball/loaders"; - -const Loading = (props: LoadingProps) => { - return ( -
- - - {props.text} - -
- ); -}; - -export default Loading; diff --git a/src/components/search.svelte b/src/components/search.svelte new file mode 100644 index 0000000..5294003 --- /dev/null +++ b/src/components/search.svelte @@ -0,0 +1,21 @@ + + +
+
+
+ +
+
+ +
diff --git a/src/components/search.tsx b/src/components/search.tsx deleted file mode 100644 index aa3c4d2..0000000 --- a/src/components/search.tsx +++ /dev/null @@ -1,125 +0,0 @@ -import { useEffect, useRef, useState } from "react"; -import { - Input, - Text, - Image, - HStack, - Box, - Center, - Spinner, -} from "@chakra-ui/react"; -import useDebounce from "@/hooks/useDebounce"; -import { SearchProps, SVGCardProps } from "@/interfaces/components"; -import CustomLink from "@/common/link"; -import { getSvgByQuery } from "@/services"; -import CustomIconBtn from "@/common/iconBtn"; -import { Trash } from "phosphor-react"; -import Tap from "@/animations/tap"; - -const Search = ({ availableFocus = false }: SearchProps) => { - const [search, setSearch] = useState(""); - const [empty, setEmpty] = useState(false); - const [results, setResults] = useState([]); - const debouncedSearch = useDebounce(search, 500); - const searchRef = useRef(null); - - useEffect(() => { - if (debouncedSearch) { - fetch(getSvgByQuery + debouncedSearch).then((res) => { - if (res.ok) { - res.json().then((data) => { - setEmpty(data.length === 0); - setResults(data); - }); - } - }); - } - }, [debouncedSearch]); - - useEffect(() => { - const isFocusAvailable = availableFocus && searchRef.current; - - if (!isFocusAvailable) return; - - const timeoutId = setTimeout(() => { - searchRef.current?.focus(); - }, 100); - - return () => clearTimeout(timeoutId); - }, [availableFocus]); - - const handleFilter = (e: React.ChangeEvent) => { - setEmpty(false); - setSearch(e.target.value); - }; - - const handleClear = () => { - setSearch(""); - setResults([]); - }; - - return ( - <> - - {search && !empty && results.length === 0 && ( - - - - )} - {search && empty && No results found!} - {results && results.length > 0 && ( - <> - - {results.map((item: SVGCardProps) => ( - - - -
- {item.title} -
- {item.title} -
-
-
- ))} -
- - } - onClick={handleClear} - /> - - - )} - - ); -}; - -export default Search; diff --git a/src/components/svgCard.svelte b/src/components/svgCard.svelte new file mode 100644 index 0000000..3f8911e --- /dev/null +++ b/src/components/svgCard.svelte @@ -0,0 +1,82 @@ + + +
+ {svgInfo.title} +
+

{svgInfo.title}

+ {svgInfo.category} +
+
+ + + + + +
+
diff --git a/src/components/svgCard.tsx b/src/components/svgCard.tsx deleted file mode 100644 index 047e2df..0000000 --- a/src/components/svgCard.tsx +++ /dev/null @@ -1,47 +0,0 @@ -import React from "react"; -import { SVGCardProps } from "@/interfaces/components"; -import { - Box, - Center, - Image, - Text, - useColorModeValue, - useDisclosure, -} from "@chakra-ui/react"; -import Tap from "@/animations/tap"; -import CustomLink from "@/common/link"; -import { Smiley } from "phosphor-react"; - -const SVGCard = (props: SVGCardProps) => { - const bg = useColorModeValue("bg.light", "bg.dark"); - const color = useColorModeValue("rgb(0,0,0, .1)", "rgb(255,255,255, .1)"); - return ( - <> - - - -
- {props.title} -
- - {props.title} - -
-
-
- - ); -}; - -export default SVGCard; diff --git a/src/components/svgInfo.tsx b/src/components/svgInfo.tsx deleted file mode 100644 index 6f5d8fc..0000000 --- a/src/components/svgInfo.tsx +++ /dev/null @@ -1,108 +0,0 @@ -import React from "react"; -import { - Button, - Flex, - Heading, - HStack, - Icon, - Image, - Link, -} from "@chakra-ui/react"; -import { ArrowSquareOut, Copy, DownloadSimple } from "phosphor-react"; -import confetti from "canvas-confetti"; -import download from "downloadjs"; -import { toast } from "react-hot-toast"; -import { ToastTheme } from "@/theme/toast"; -import { SVGCardProps } from "@/interfaces/components"; - -// Download SVG => -const downloadSvg = (url?: string) => { - confetti({ - particleCount: 200, - startVelocity: 30, - spread: 300, - gravity: 1.2, - origin: { y: 0 }, - }); - download(url || ""); -}; - - -const MIMETYPE = 'text/plain'; - -// Return content of svg as blob => -const getSvgContent = async (url: string | undefined, isSupported: boolean) => { - const response = await fetch(url || ""); - const content = await response.text(); - - // It was necessary to use blob because in chrome there were issues with the copy to clipboard - const blob = new Blob([content], { type: MIMETYPE }); - return isSupported ? blob : content; -} - -// Copy to clipboard => -const copyToClipboard = async (url?: string) => { - const data = { - [MIMETYPE]: getSvgContent(url, true) - }; - try { - const clipboardItem = new ClipboardItem(data); - await navigator.clipboard.write([clipboardItem]); - } catch (error) { - // This section works as a fallback on Firefox - const content = await getSvgContent(url, false) as string; - await navigator.clipboard.writeText(content); - } - toast("Copied to clipboard", ToastTheme); -}; - -const SVGInfo = (props: SVGCardProps) => { - return ( - - {props.title} - - {props.title} - - - - - - {props.title} website - - - - ); -}; - -export default SVGInfo; diff --git a/src/components/theme.svelte b/src/components/theme.svelte new file mode 100644 index 0000000..d002b2b --- /dev/null +++ b/src/components/theme.svelte @@ -0,0 +1,63 @@ + + + + + + + + diff --git a/src/components/transition.svelte b/src/components/transition.svelte new file mode 100644 index 0000000..4c94fb1 --- /dev/null +++ b/src/components/transition.svelte @@ -0,0 +1,10 @@ + + +{#key pathname} +
+ +
+{/key} diff --git a/src/data/svgs.ts b/src/data/svgs.ts new file mode 100644 index 0000000..bb8e6df --- /dev/null +++ b/src/data/svgs.ts @@ -0,0 +1,1096 @@ +import type { iSVG } from '../types/svg'; + +export const svgs: iSVG[] = [ + { + id: 1, + title: 'Discord', + category: 'Software', + route: '/library/discord.svg', + url: 'https://discord.com/' + }, + { + id: 2, + title: 'Github', + category: 'Software', + route: '/library/github.svg', + url: 'https://github.com/' + }, + { + id: 3, + title: 'Preact', + category: 'Library', + route: '/library/preact.svg', + url: 'https://preactjs.com/' + }, + { + id: 4, + title: 'React', + category: 'Library', + route: '/library/react.svg', + url: 'https://reactjs.org/' + }, + { + id: 5, + title: 'Vercel', + category: 'Hosting', + route: '/library/vercel.svg', + url: 'https://vercel.com/' + }, + { + id: 6, + title: 'Svelte', + category: 'Library', + route: '/library/svelte.svg', + url: 'https://svelte.dev/' + }, + { + id: 7, + title: 'Vue', + category: 'Framework', + route: '/library/vue.svg', + url: 'https://vuejs.org/' + }, + { + id: 8, + title: 'Nuxt', + category: 'Framework', + route: '/library/nuxt.svg', + url: 'https://nuxtjs.org/' + }, + { + id: 9, + title: 'Nextjs', + category: 'Framework', + route: '/library/nextjs.svg', + url: 'https://nextjs.org/' + }, + { + id: 10, + title: 'Visual Studio Code', + category: 'Software', + route: '/library/vscode.svg', + url: 'https://code.visualstudio.com/' + }, + { + id: 11, + title: 'JWT', + category: 'Library', + route: '/library/jwt.svg', + url: 'https://jwt.io/' + }, + { + id: 12, + title: 'Strapi', + category: 'CMS', + route: '/library/strapi.svg', + url: 'https://strapi.io/' + }, + { + id: 13, + title: 'Figma', + category: 'Software', + route: '/library/figma.svg', + url: 'https://www.figma.com/' + }, + { + id: 14, + title: 'Spotify', + category: 'Software', + route: '/library/spotify.svg', + url: 'https://www.spotify.com/' + }, + { + id: 15, + title: 'Postman', + category: 'Software', + route: '/library/postman.svg', + url: 'https://www.getpostman.com/' + }, + { + id: 16, + title: 'Algolia', + category: 'Library', + route: '/library/algolia.svg', + url: 'https://www.algolia.com/' + }, + { + id: 17, + title: 'Bootstrap', + category: 'Framework', + route: '/library/bootstrap.svg', + url: 'https://getbootstrap.com/' + }, + { + id: 18, + title: 'Firebase', + category: 'Hosting', + route: '/library/firebase.svg', + url: 'https://firebase.google.com/' + }, + { + id: 19, + title: 'Supabase', + category: 'Database', + route: '/library/supabase.svg', + url: 'https://supabase.com/' + }, + { + id: 20, + title: 'Vite.js', + category: 'Compiler', + route: '/library/vitejs.svg', + url: 'https://vitejs.dev' + }, + { + id: 21, + title: 'Facebook', + category: 'Social', + route: '/library/facebook.svg', + url: 'https://www.facebook.com/' + }, + { + id: 22, + title: 'Twitter', + category: 'Social', + route: '/library/twitter.svg', + url: 'https://twitter.com/' + }, + { + id: 23, + title: 'Node.js', + category: 'Library', + route: '/library/nodejs.svg', + url: 'https://nodejs.org/' + }, + { + id: 24, + title: 'Esbuild', + category: 'Compiler', + route: '/library/esbuild.svg', + url: 'https://esbuild.github.io/' + }, + { + id: 25, + title: 'Deno', + category: 'Library', + route: '/library/deno.svg', + url: 'https://deno.land/' + }, + { + id: 26, + title: 'Gatsby', + category: 'Framework', + route: '/library/gatsby.svg', + url: 'https://www.gatsbyjs.org/' + }, + { + id: 27, + title: 'NPM', + category: 'Software', + route: '/library/npm.svg', + url: 'https://www.npmjs.com/' + }, + { + id: 28, + title: 'Homebrew', + category: 'Software', + route: '/library/homebrew.svg', + url: 'https://brew.sh/' + }, + { + id: 29, + title: 'Sublime Text', + category: 'Software', + route: '/library/sublimetext.svg', + url: 'https://www.sublimetext.com/' + }, + { + id: 30, + title: 'TurboRepo', + category: 'Library', + route: '/library/turborepo.svg', + url: 'https://turborepo.org/' + }, + { + id: 31, + title: 'Tailwind CSS', + category: 'Framework', + route: '/library/tailwindcss.svg', + url: 'https://tailwindcss.com/' + }, + { + id: 32, + title: 'Styled Components', + category: 'Library', + route: '/library/styledcomponents.svg', + url: 'https://styled-components.com/' + }, + { + id: 33, + title: 'Angular', + category: 'Framework', + route: '/library/angular.svg', + url: 'https://angular.io/' + }, + { + id: 34, + title: 'Blitz', + category: 'Framework', + route: '/library/blitzjs.svg', + url: 'https://blitzjs.com/' + }, + { + id: 35, + title: 'Lit', + category: 'Library', + route: '/library/lit.svg', + url: 'https://lit.dev/' + }, + { + id: 36, + title: 'Atom', + category: 'Software', + route: '/library/atom.svg', + url: 'https://atom.io/' + }, + { + id: 37, + title: 'YouTube', + category: 'Social', + route: '/library/youtube.svg', + url: 'https://www.youtube.com/' + }, + { + id: 38, + title: 'Astro', + category: 'Framework', + route: '/library/astro.svg', + url: 'https://astro.build/' + }, + { + id: 39, + title: 'Google', + category: 'Social', + route: '/library/google.svg', + url: 'https://www.google.com/' + }, + { + id: 40, + title: 'Framer', + category: 'Software', + route: '/library/framer.svg', + url: 'https://framer.com/' + }, + { + id: 41, + title: 'Netflix', + category: 'Entertainment', + route: '/library/netflix.svg', + url: 'https://www.netflix.com/' + }, + { + id: 42, + title: 'Firefox', + category: 'Software', + route: '/library/firefox.svg', + url: 'https://www.mozilla.org/en-US/firefox/' + }, + { + id: 43, + title: 'LinkedIn', + category: 'Social', + route: '/library/linkedin.svg', + url: 'https://www.linkedin.com/' + }, + { + id: 44, + title: 'Telegram', + category: 'Social', + route: '/library/telegram.svg', + url: 'https://web.telegram.org/' + }, + { + id: 45, + title: 'WhatsApp', + category: 'Social', + route: '/library/whatsapp.svg', + url: 'https://web.whatsapp.com/' + }, + { + id: 46, + title: 'Headless UI', + category: 'Library', + route: '/library/headlessui.svg', + url: 'https://headlessui.dev/' + }, + { + id: 47, + title: 'Kotlin', + category: 'Language', + route: '/library/kotlin.svg', + url: 'https://kotlinlang.org/' + }, + { + id: 48, + title: 'Vitest', + category: 'Framework', + route: '/library/vitest.svg', + url: 'https://vitest.dev/' + }, + { + id: 49, + title: 'Storybook', + category: 'Software', + route: '/library/storybook.svg', + url: 'https://storybook.js.org/' + }, + { + id: 50, + title: 'Netlify', + category: 'Hosting', + route: '/library/netlify.svg', + url: 'https://www.netlify.com/' + }, + { + id: 51, + title: 'Solidjs', + category: 'Framework', + route: '/library/solidjs.svg', + url: 'https://www.solidjs.com/' + }, + { + id: 52, + title: 'MongoDB', + category: 'Database', + route: '/library/mongodb.svg', + url: 'https://www.mongodb.com/' + }, + { + id: 53, + title: 'Babel', + category: 'Compiler', + route: '/library/babel.svg', + url: 'https://babeljs.io' + }, + { + id: 54, + title: 'Moon', + category: 'Framework', + route: '/library/moon.svg', + url: 'https://moonjs.org/' + }, + { + id: 55, + title: 'Payload CMS', + category: 'CMS', + route: '/library/payload.svg', + url: 'https://payloadcms.com' + }, + { + id: 56, + title: 'Fly', + category: 'Hosting', + route: '/library/fly.svg', + url: 'https://fly.io' + }, + { + id: 57, + title: 'LearnThis', + category: 'Education', + route: '/library/learnthis.svg', + url: 'https://learnthisacademy.com' + }, + { + id: 58, + title: 'Visual Studio', + category: 'Software', + route: '/library/visual-studio.svg', + url: 'https://visualstudio.microsoft.com' + }, + { + id: 59, + title: 'Chakra UI', + category: 'Library', + route: '/library/chakra-ui.svg', + url: 'https://chakra-ui.com' + }, + { + id: 60, + title: 'Express.js', + category: 'Framework', + route: '/library/expressjs.svg', + url: 'https://expressjs.com' + }, + { + id: 61, + title: 'Fastify', + category: 'Framework', + route: '/library/fastify.svg', + url: 'https://www.fastify.io' + }, + { + id: 62, + title: 'JavaScript', + category: 'Language', + route: '/library/javascript.svg', + url: 'https://developer.mozilla.org/docs/Web/JavaScript' + }, + { + id: 63, + title: 'jQuery', + category: 'Language', + route: '/library/jquery.svg', + url: 'https://jquery.com' + }, + { + id: 64, + title: 'Rapid API', + category: 'Software', + route: '/library/rapidapi.svg', + url: 'https://rapidapi.com' + }, + { + id: 65, + title: 'TypeScript', + category: 'Language', + route: '/library/typescript.svg', + url: 'https://www.typescriptlang.org' + }, + { + id: 66, + title: 'Bun', + category: 'Library', + route: '/library/bun.svg', + url: 'https://bun.sh' + }, + { + id: 67, + title: 'Twilio', + category: 'Software', + route: '/library/twilio.svg', + url: 'https://twilio.com' + }, + { + id: 68, + title: 'Arc', + category: 'Software', + route: '/library/arc.svg', + url: 'https://arc.dev' + }, + { + id: 69, + title: 'Qwik', + category: 'Framework', + route: '/library/qwik.svg', + url: 'https://qwik.builder.io/' + }, + { + id: 70, + title: 'Authy', + category: 'Software', + route: '/library/authy.svg', + url: 'https://authy.com/' + }, + { + id: 71, + title: 'Notion', + category: 'Software', + route: '/library/notion.svg', + url: 'https://notion.so/' + }, + { + id: 72, + title: 'NestJS', + category: 'Framework', + route: '/library/nestjs.svg', + url: 'https://nestjs.com/' + }, + { + id: 73, + title: 'Github Copilot', + category: 'Software', + route: '/library/copilot.svg', + url: 'https://github.com/features/copilot' + }, + { + id: 74, + title: 'Railway', + category: 'Software', + route: '/library/railway.svg', + url: 'https://railway.app/' + }, + { + id: 75, + title: 'Docusaurus', + category: 'Software', + route: '/library/docusaurus.svg', + url: 'https://docusaurus.io/' + }, + { + id: 76, + title: 'Twitch', + category: 'Entertainment', + route: '/library/twitch.svg', + url: 'https://twitch.tv' + }, + { + id: 77, + title: 'GoDaddy', + category: 'Hosting', + route: '/library/godaddy.svg', + url: 'https://www.godaddy.com/' + }, + { + id: 78, + title: 'Udemy', + category: 'Education', + route: '/library/udemy.svg', + url: 'https://www.udemy.com/' + }, + { + id: 79, + title: 'GraphQL', + category: 'Language', + route: '/library/graphql.svg', + url: 'https://graphql.org/' + }, + { + id: 80, + title: 'GitLab', + category: 'Software', + route: '/library/gitlab.svg', + url: 'https://gitlab.com/' + }, + { + id: 81, + title: 'Prisma', + category: 'Software', + route: '/library/prisma.svg', + url: 'https://prisma.io/' + }, + { + id: 82, + title: 'Go', + category: 'Language', + route: '/library/golang.svg', + url: 'https://go.dev/' + }, + { + id: 83, + title: 'Platzi', + category: 'Education', + route: '/library/platzi.svg', + url: 'https://platzi.com/' + }, + { + id: 84, + title: 'Coursera', + category: 'Education', + route: '/library/coursera.svg', + url: 'https://www.coursera.org/' + }, + { + id: 85, + title: 'Udacity', + category: 'Education', + route: '/library/udacity.svg', + url: 'https://www.udacity.com/' + }, + { + id: 86, + title: 'Kubernetes', + category: 'Software', + route: '/library/kubernetes.svg', + url: 'https://kubernetes.io/' + }, + { + id: 87, + title: 'Docker', + category: 'Software', + route: '/library/docker.svg', + url: 'https://www.docker.com/' + }, + { + id: 88, + title: 'Amazon Web Services', + category: 'Software', + route: '/library/aws.svg', + url: 'https://aws.amazon.com/' + }, + { + id: 89, + title: 'Microsoft Azure', + category: 'Software', + route: '/library/azure.svg', + url: 'https://azure.microsoft.com/' + }, + { + id: 90, + title: 'Heroku', + category: 'Software', + route: '/library/heroku.svg', + url: 'https://www.heroku.com/' + }, + { + id: 91, + title: 'JetBrains', + category: 'Software', + route: '/library/jetbrains.svg', + url: 'https://www.jetbrains.com/' + }, + { + id: 92, + title: 'JetBrains Rider', + category: 'Software', + route: '/library/rider.svg', + url: 'https://www.jetbrains.com/rider/' + }, + { + id: 93, + title: 'PlanetScale', + category: 'Database', + route: '/library/planetscale.svg', + url: 'https://planetscale.com/' + }, + { + id: 94, + title: 'Playwright', + category: 'Framework', + route: '/library/playwright.svg', + url: 'https://playwright.dev/' + }, + { + id: 95, + title: 'Atlassian', + category: 'Software', + route: '/library/atlassian.svg', + url: 'https://www.atlassian.com/' + }, + { + id: 96, + title: 'Discourse', + category: 'Software', + route: '/library/discourse.svg', + url: 'https://discourse.org/' + }, + { + id: 97, + title: 'Ember', + category: 'Framework', + route: '/library/ember.svg', + url: 'https://emberjs.com/' + }, + { + id: 98, + title: 'Expo', + category: 'Software', + route: '/library/expo.svg', + url: 'https://expo.dev/' + }, + { + id: 99, + title: 'Flutter', + category: 'Framework', + route: '/library/flutter.svg', + url: 'https://flutter.dev/' + }, + { + id: 100, + title: 'Fresh', + category: 'Framework', + route: '/library/fresh.svg', + url: 'https://fresh.deno.dev/' + }, + { + id: 101, + title: 'Git', + category: 'Software', + route: '/library/git.svg', + url: 'https://git-scm.com/' + }, + { + id: 102, + title: 'Hostgator', + category: 'Hosting', + route: '/library/hostgator.svg', + url: 'https://www.hostgator.com/' + }, + { + id: 103, + title: 'IntelliJ IDEA', + category: 'Software', + route: '/library/intellijidea.svg', + url: 'https://www.jetbrains.com/idea/' + }, + { + id: 104, + title: 'Jasmine', + category: 'Framework', + route: '/library/jasmine.svg', + url: 'https://jasmine.github.io/' + }, + { + id: 105, + title: 'Java', + category: 'Language', + route: '/library/java.svg', + url: 'https://www.java.com/' + }, + { + id: 106, + title: 'Jest', + category: 'Framework', + route: '/library/jest.svg', + url: 'https://jestjs.io/' + }, + { + id: 107, + title: 'JetBrains', + category: 'Software', + route: '/library/jetbrainsSolid.svg', + url: 'https://www.jetbrains.com/' + }, + { + id: 108, + title: 'KrakenJS', + category: 'Framework', + route: '/library/krakenjs.svg', + url: 'https://krakenjs.com/' + }, + { + id: 109, + title: 'Laravel', + category: 'Framework', + route: '/library/laravel.svg', + url: 'https://laravel.com/' + }, + { + id: 110, + title: 'MariaDB', + category: 'Database', + route: '/library/mariadb.svg', + url: 'https://mariadb.org/' + }, + { + id: 111, + title: 'Material UI', + category: 'Framework', + route: '/library/materialui.svg', + url: 'https://mui.com/' + }, + { + id: 112, + title: 'MySQL', + category: 'Database', + route: '/library/mysql.svg', + url: 'https://www.mysql.com/' + }, + { + id: 113, + title: 'Parcel', + category: 'Compiler', + route: '/library/parcel.svg', + url: 'https://parceljs.org/' + }, + { + id: 114, + title: 'PM2', + category: 'Framework', + route: '/library/pm2.svg', + url: 'https://pm2.io/' + }, + { + id: 115, + title: 'PostgreSQL', + category: 'Database', + route: '/library/postgresql.svg', + url: 'https://www.postgresql.org/' + }, + { + id: 116, + title: 'React Query', + category: 'Framework', + route: '/library/reactquery.svg', + url: 'https://tanstack.com/query/v4' + }, + { + id: 117, + title: 'Redis', + category: 'Database', + route: '/library/redis.svg', + url: 'https://redis.io/' + }, + { + id: 118, + title: 'RedwoodJS', + category: 'Framework', + route: '/library/redwoodjs.svg', + url: 'https://redwoodjs.com/' + }, + { + id: 119, + title: 'Ruby', + category: 'Language', + route: '/library/ruby.svg', + url: 'https://www.ruby-lang.org/' + }, + { + id: 120, + title: 'Scala', + category: 'Language', + route: '/library/scala.svg', + url: 'https://www.scala-lang.org/' + }, + { + id: 121, + title: 'Sequelize', + category: 'Framework', + route: '/library/sequelize.svg', + url: 'https://sequelize.org/' + }, + { + id: 122, + title: 'Spinnaker', + category: 'Software', + route: '/library/spinnaker.svg', + url: 'https://spinnaker.io/' + }, + { + id: 123, + title: 'SQLite', + category: 'Database', + route: '/library/sqlite.svg', + url: 'https://www.sqlite.org/' + }, + { + id: 124, + title: 'Swagger', + category: 'Software', + route: '/library/swagger.svg', + url: 'https://swagger.io/' + }, + { + id: 125, + title: 'Swift', + category: 'Language', + route: '/library/swift.svg', + url: 'https://swift.org/' + }, + { + id: 126, + title: 'Testing Library', + category: 'Framework', + route: '/library/testinglibrary.svg', + url: 'https://testing-library.com/' + }, + { + id: 127, + title: 'TypeORM', + category: 'Database', + route: '/library/typeorm.svg', + url: 'https://typeorm.io/' + }, + { + id: 128, + title: 'Unity', + category: 'Software', + route: '/library/unity.svg', + url: 'https://unity.com/' + }, + { + id: 129, + title: 'Vim', + category: 'Software', + route: '/library/vim.svg', + url: 'https://www.vim.org/' + }, + { + id: 130, + title: 'WMR', + category: 'Compiler', + route: '/library/wmr.svg', + url: 'https://wmr.dev/' + }, + { + id: 131, + title: 'OpenBootcamp', + category: 'Education', + route: '/library/openbootcamp.svg', + url: 'https://open-bootcamp.com/' + }, + { + id: 132, + title: 'Digital Ocean', + category: 'Software', + route: '/library/digitalocean.svg', + url: 'https://www.digitalocean.com/' + }, + { + id: 133, + title: 'Disney+', + category: 'Entertainment', + route: '/library/disneyplus.svg', + url: 'https://www.disneyplus.com/' + }, + { + id: 134, + title: 'React Router', + category: 'Library', + route: '/library/reactrouter.svg', + url: 'https://reactrouter.com/en/main' + }, + { + id: 135, + title: 'Google Student Developer Club', + category: 'Google', + route: '/library/gdsc.svg', + url: 'https://gdsc.community.dev/' + }, + { + id: 136, + title: 'Brave Browser', + category: 'Browser', + route: '/library/brave.svg', + url: 'https://brave.com/' + }, + { + id: 137, + title: 'Eclipse IDE', + category: 'IDE', + route: '/library/eclipse.svg', + url: 'https://www.eclipse.org/' + }, + { + id: 138, + title: 'HTML5', + category: 'Language', + route: '/library/html5.svg', + url: 'https://es.wikipedia.org/wiki/HTML5' + }, + { + id: 139, + title: 'CSS', + category: 'Language', + route: '/library/css.svg', + url: 'https://es.wikipedia.org/wiki/CSS' + }, + { + id: 140, + title: 'midudev', + category: 'Education', + route: '/library/midudev.svg', + url: 'https://midu.dev' + }, + { + id: 141, + title: 'Apple', + category: 'Software', + route: '/library/apple.svg', + url: 'https://www.apple.com' + }, + { + id: 142, + title: 'Android', + category: 'Software', + route: '/library/android.svg', + url: 'https://www.android.com/' + }, + { + id: 143, + title: 'Windows', + category: 'Software', + route: '/library/windows.svg', + url: 'https://www.microsoft.com/windows' + }, + { + id: 144, + title: 'Python', + category: 'Language', + route: '/library/python.svg', + url: 'https://www.python.org/' + }, + { + id: 145, + title: 'Turbopack', + category: 'Software', + route: '/library/turbopack.svg', + url: 'https://turbo.build/' + }, + { + id: 146, + title: 'Builder', + category: 'CMS', + route: '/library/builder.svg', + url: 'https://builder.io/' + }, + { + id: 147, + title: 'Surrealdb', + category: 'Database', + route: '/library/surrealdb.svg', + url: 'https://surrealdb.com/' + }, + { + id: 148, + title: 'Jetbrains Space', + category: 'Software', + route: '/library/jetbrains-space.svg', + url: 'https://www.jetbrains.com/space/' + }, + { + id: 149, + title: 'Gin', + category: 'Framework', + route: '/library/gin.svg', + url: 'https://gin-gonic.com/' + }, + { + id: 150, + title: 'Stimulus', + category: 'Framework', + route: '/library/stimulus.svg', + url: 'https://stimulus.hotwired.dev/' + }, + { + id: 151, + title: 'WindiCSS', + category: 'Framework', + route: '/library/windicss.svg', + url: 'https://windicss.org/' + }, + { + id: 152, + title: 'Mastodon', + category: 'Social', + route: '/library/mastodon.svg', + url: 'https://joinmastodon.org/' + }, + { + id: 153, + title: 'Upstash', + category: 'Database', + route: '/library/upstash.svg', + url: 'https://upstash.com/' + }, + { + id: 154, + title: 'Storyblok', + category: 'CMS', + route: '/library/storyblok.svg', + url: 'https://www.storyblok.com/' + }, + { + id: 155, + title: 'Cloudflare Workers', + category: 'Software', + route: '/library/cloudflare-workers.svg', + url: 'https://workers.cloudflare.com/' + }, + { + id: 156, + title: 'Cloudflare', + category: 'Software', + route: '/library/cloudflare.svg', + url: 'https://www.cloudflare.com/' + } +]; diff --git a/src/hooks/useDebounce.tsx b/src/hooks/useDebounce.tsx deleted file mode 100644 index 27a5bed..0000000 --- a/src/hooks/useDebounce.tsx +++ /dev/null @@ -1,17 +0,0 @@ -import { useEffect, useState } from "react"; - -function useDebounce(value: T, delay?: number): T { - const [debouncedValue, setDebouncedValue] = useState(value); - - useEffect(() => { - const timer = setTimeout(() => setDebouncedValue(value), delay || 500); - - return () => { - clearTimeout(timer); - }; - }, [value, delay]); - - return debouncedValue; -} - -export default useDebounce; diff --git a/src/index.test.ts b/src/index.test.ts new file mode 100644 index 0000000..bf8c590 --- /dev/null +++ b/src/index.test.ts @@ -0,0 +1,14 @@ +import { describe, it, expect } from 'vitest'; +import { svgs } from './data/svgs'; + +describe('Get svgs by category', () => { + it('should have a category named "Social"', () => { + expect(svgs.find((svg) => svg.category === 'Social')).toBeDefined(); + }); +}); + +describe('Get a specific svg', () => { + it('should have a svg named "Discord"', () => { + expect(svgs.find((svg) => svg.title === 'Discord')).toBeDefined(); + }); +}); diff --git a/src/interfaces/components.ts b/src/interfaces/components.ts deleted file mode 100644 index b7c5ea8..0000000 --- a/src/interfaces/components.ts +++ /dev/null @@ -1,48 +0,0 @@ -export interface LayoutProps { - children: React.ReactNode; -} - -export interface CustomLinkProps { - href: string; - children: React.ReactNode; - external?: boolean; - font?: string; - mr?: string; - ml?: string; -} - -export interface CustomIconBtnProps { - title: string; - icon: React.ReactElement; - mr?: string; - ml?: string; - onClick?: () => void; -} - -export interface SVGCardProps { - id: number; - svg: string; - title: string; - slug?: string; - url?: string; -} - -export interface SidebarContentProps { - display?: object; - w?: string; - borderRight?: string; - children?: React.ReactNode; -} - -export interface LoadingProps { - text: string; -} - -export interface ErrorProps { - title: string; - description: string; -} - -export interface SearchProps { - availableFocus?: boolean; -} diff --git a/src/layout/footer/index.tsx b/src/layout/footer/index.tsx deleted file mode 100644 index 93ce43e..0000000 --- a/src/layout/footer/index.tsx +++ /dev/null @@ -1,21 +0,0 @@ -import CustomLink from "@/common/link"; -import { Flex, Heading, HStack, Icon, Text } from "@chakra-ui/react"; -import { RocketLaunch, TwitterLogo } from "phosphor-react"; -import React from "react"; - -type Props = {}; - -const Index = (props: Props) => { - return ( - - - - - Created by Pablo - - - - ); -}; - -export default Index; diff --git a/src/layout/header/categories.tsx b/src/layout/header/categories.tsx deleted file mode 100644 index ed290e4..0000000 --- a/src/layout/header/categories.tsx +++ /dev/null @@ -1,48 +0,0 @@ -import React from "react"; -import useSWR from "swr"; -import { getCategorySvgs } from "@/services"; -import CustomLink from "@/common/link"; -import { Box, useColorModeValue } from "@chakra-ui/react"; -import { RaceBy } from "@uiball/loaders"; -import Tap from "@/animations/tap"; -import { useRouter } from "next/router"; - -const Categories = () => { - const { data, error } = useSWR(getCategorySvgs); - const color = useColorModeValue("rgb(0,0,0, .1)", "rgb(255,255,255, .1)"); - const router = useRouter(); - if (error) return
failed to load
; - if (!data) - return ; - return ( - <> - {data.map((category: string) => ( - - - - {category} - - - - ))} - - ); -}; - -export default Categories; diff --git a/src/layout/header/index.tsx b/src/layout/header/index.tsx deleted file mode 100644 index e8552da..0000000 --- a/src/layout/header/index.tsx +++ /dev/null @@ -1,120 +0,0 @@ -import { - Box, - Flex, - useColorModeValue, - HStack, - Container, - Heading, - Icon, - useDisclosure, - Collapse, -} from '@chakra-ui/react' -import { ArrowSquareOut, MagnifyingGlass, Sticker, X } from 'phosphor-react' -import Theme from './theme' -import Tap from '@/animations/tap' -import Mobile from './mobile' -import { Links } from './links' -import CustomLink from '@/common/link' -import Categories from './categories' -import Search from '@/components/search' -import CustomIconBtn from '@/common/iconBtn' -import { useHotkeys } from 'react-hotkeys-hook' - -const Header = () => { - const bg = useColorModeValue('bg.light', 'bg.dark') - const { isOpen, onToggle } = useDisclosure() - useHotkeys('ctrl+k', (e) => { - e.preventDefault() - onToggle() - }) - return ( - <> - - - - - - - - svgl - - - - - - {Links.map((link) => ( - - - {link.title} - {link.external ? ( - - ) : null} - - - ))} - - - : - } - onClick={onToggle} - /> - - - - - - - - - - - - - - - - - - - - - - - - ) -} - -export default Header diff --git a/src/layout/header/links.ts b/src/layout/header/links.ts deleted file mode 100644 index ffaf4e5..0000000 --- a/src/layout/header/links.ts +++ /dev/null @@ -1,12 +0,0 @@ -export const Links = [ - { - title: "Github", - slug: "https://github.com/pheralb/svgl", - external: true, - }, - { - title: "Twitter", - slug: "https://twitter.com/pheralb_", - external: true, - }, -]; diff --git a/src/layout/header/mobile.tsx b/src/layout/header/mobile.tsx deleted file mode 100644 index 03b8474..0000000 --- a/src/layout/header/mobile.tsx +++ /dev/null @@ -1,59 +0,0 @@ -import CustomLink from "@/common/link"; -import { - Button, - CloseButton, - IconButton, - useColorModeValue, - useDisclosure, - VStack, -} from "@chakra-ui/react"; -import { List } from "phosphor-react"; -import { Links } from "./links"; -import Theme from "./theme"; - -const Mobile = () => { - const bg = useColorModeValue("bg.light", "bg.dark"); - const mobileNav = useDisclosure(); - return ( - <> - - } - onClick={mobileNav.onOpen} - ml="2" - /> - - - {Links.map((link) => ( - - {link.title} - - ))} - - - ); -}; - -export default Mobile; diff --git a/src/layout/header/theme.tsx b/src/layout/header/theme.tsx deleted file mode 100644 index b63f79f..0000000 --- a/src/layout/header/theme.tsx +++ /dev/null @@ -1,31 +0,0 @@ -import React from "react"; -import { AnimatePresence, motion } from "framer-motion"; -import { useColorMode, useColorModeValue } from "@chakra-ui/react"; -import CustomIconBtn from "@/common/iconBtn"; -import { Moon, Sun } from "phosphor-react"; - -const Theme = () => { - const { toggleColorMode } = useColorMode(); - const key = useColorModeValue("light", "dark"); - const icon = useColorModeValue(, ); - - return ( - - - - - - ); -}; - -export default Theme; diff --git a/src/layout/index.tsx b/src/layout/index.tsx deleted file mode 100644 index 5bfae45..0000000 --- a/src/layout/index.tsx +++ /dev/null @@ -1,17 +0,0 @@ -import React from "react"; -import { LayoutProps } from "@/interfaces/components"; -import { Container } from "@chakra-ui/react"; -import Header from "./header"; -import Footer from "./footer"; - -const Index = ({ children }: LayoutProps) => { - return ( - <> -
- {children} -