switch to vite

the build was not stable enough to be deployed by jenkins otherwise
This commit is contained in:
andrzej 2024-05-25 23:39:41 +02:00
parent 617c158036
commit c8346845e2
38 changed files with 2026 additions and 15548 deletions

21
.eslintrc.cjs Normal file
View File

@ -0,0 +1,21 @@
module.exports = {
root: true,
env: { browser: true, es2020: true },
extends: [
'eslint:recommended',
'plugin:react/recommended',
'plugin:react/jsx-runtime',
'plugin:react-hooks/recommended',
],
ignorePatterns: ['dist', '.eslintrc.cjs'],
parserOptions: { ecmaVersion: 'latest', sourceType: 'module' },
settings: { react: { version: '18.2' } },
plugins: ['react-refresh'],
rules: {
'react/jsx-no-target-blank': 'off',
'react-refresh/only-export-components': [
'warn',
{ allowConstantExport: true },
],
},
}

17
Jenkinsfile vendored
View File

@ -1,17 +0,0 @@
pipeline {
agent any
stages {
stage('build'){
steps{
sh 'npm install'
sh 'npm run build'
}
}
stage('deploy'){
steps{
sshPublisher(publishers: [sshPublisherDesc(configName: 'Demos', transfers: [sshTransfer(cleanRemote: false, excludes: '', execCommand: '', execTimeout: 120000, flatten: false, makeEmptyDirs: false, noDefaultExcludes: false, patternSeparator: '[, ]+', remoteDirectory: 'ssh-uploads/calculator', remoteDirectorySDF: false, removePrefix: '', sourceFiles: 'build/**')], usePromotionTimestamp: false, useWorkspaceInPromotion: false, verbose: false)])
}
}
}
}

View File

@ -1,5 +1,8 @@
# Calculator App
# React + Vite
This is a React project I designed for my [frontend certification]("https://www.freecodecamp.org/certification/fcc60e22726-0a94-4738-8702-3e216d14fdb2/front-end-development-libraries"). It's quite simple, but I was rather pleased with my command routing solution!
This template provides a minimal setup to get React working in Vite with HMR and some ESLint rules.
You can see a live demo [here](https://demos.ajstepien.xyz/calculator/).
Currently, two official plugins are available:
- [@vitejs/plugin-react](https://github.com/vitejs/vite-plugin-react/blob/main/packages/plugin-react/README.md) uses [Babel](https://babeljs.io/) for Fast Refresh
- [@vitejs/plugin-react-swc](https://github.com/vitejs/vite-plugin-react-swc) uses [SWC](https://swc.rs/) for Fast Refresh

View File

@ -1,16 +0,0 @@
{
"files": {
"main.css": "/calculator/static/css/main.6f47ce72.css",
"main.js": "/calculator/static/js/main.decfa636.js",
"static/js/787.5f81c7f8.chunk.js": "/calculator/static/js/787.5f81c7f8.chunk.js",
"static/media/DS-DIGIB.TTF": "/calculator/static/media/DS-DIGIB.81b4bd9230069b72f5e8.TTF",
"index.html": "/calculator/index.html",
"main.6f47ce72.css.map": "/calculator/static/css/main.6f47ce72.css.map",
"main.decfa636.js.map": "/calculator/static/js/main.decfa636.js.map",
"787.5f81c7f8.chunk.js.map": "/calculator/static/js/787.5f81c7f8.chunk.js.map"
},
"entrypoints": [
"static/css/main.6f47ce72.css",
"static/js/main.decfa636.js"
]
}

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.8 KiB

View File

@ -1 +0,0 @@
<!doctype html><html lang="en"><head><meta charset="utf-8"/><link rel="icon" href="/calculator/favicon.ico"/><meta name="viewport" content="width=device-width,initial-scale=1"/><meta name="theme-color" content="#000000"/><meta name="description" content="Web site created using create-react-app"/><link rel="apple-touch-icon" href="/calculator/logo192.png"/><link rel="manifest" href="/calculator/manifest.json"/><title>React App</title><script defer="defer" src="/calculator/static/js/main.decfa636.js"></script><link href="/calculator/static/css/main.6f47ce72.css" rel="stylesheet"></head><body><noscript>You need to enable JavaScript to run this app.</noscript><div id="root"></div><script src="https://cdn.freecodecamp.org/testable-projects-fcc/v1/bundle.js"></script><link rel="preconnect" href="https://fonts.googleapis.com"><link rel="preconnect" href="https://fonts.gstatic.com" crossorigin><link href="https://fonts.googleapis.com/css2?family=Roboto:wght@500&family=VT323&display=swap" rel="stylesheet"></body></html>

Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 9.4 KiB

View File

@ -1,25 +0,0 @@
{
"short_name": "React App",
"name": "Create React App Sample",
"icons": [
{
"src": "favicon.ico",
"sizes": "64x64 32x32 24x24 16x16",
"type": "image/x-icon"
},
{
"src": "logo192.png",
"type": "image/png",
"sizes": "192x192"
},
{
"src": "logo512.png",
"type": "image/png",
"sizes": "512x512"
}
],
"start_url": ".",
"display": "standalone",
"theme_color": "#000000",
"background_color": "#ffffff"
}

View File

@ -1,3 +0,0 @@
# https://www.robotstxt.org/robotstxt.html
User-agent: *
Disallow:

View File

@ -1,2 +0,0 @@
*,:after,:before{box-sizing:border-box}@font-face{font-family:calculator;src:url(/calculator/static/media/DS-DIGIB.81b4bd9230069b72f5e8.TTF)}html{font-size:16px}#calculator{background:#444040;background:linear-gradient(351deg,#444040,#9c9696);border-radius:2rem;margin:auto;padding:1rem;width:550px}#calculator-content{grid-gap:1rem;display:grid;gap:1rem;grid-template-areas:"header header header header" "display display display display" "functions functions functions operators" "numbers numbers numbers operators" "numbers numbers numbers operators" "numbers numbers numbers operators" "numbers numbers numbers operators";grid-template-columns:repeat(4,1fr);grid-template-rows:1fr 1.6fr repeat(5,1fr)}#calculator-content>header{align-self:center;font-family:Roboto,sans-serif;grid-area:header}#calculator-content>header>h1{color:#f0f8ff;font-size:3rem;margin:.5rem auto;opacity:.8}#display-container{align-self:end;background:linear-gradient(351deg,#0f5d35,#c2e4b9);border-radius:.5rem;box-shadow:inset .5rem .5rem 2rem;display:grid;font-family:VT323,monospace;font-size:1rem;grid-area:display;grid-template-areas:"memory" "main" "operator";grid-template-rows:1fr 6fr 1fr;height:9rem;justify-self:end;padding:.5rem;width:100%}.off{filter:brightness(.5)}.off>p{display:none!important}#display-container>p{margin:auto 0;opacity:.8;text-align:right}#display{font-family:calculator;font-size:6rem;grid-area:main}#display,#memory{align-self:center}#memory{grid-area:memory}#operator{align-self:center;grid-area:operator}.num-pad{grid-gap:.2rem;display:grid;gap:.2rem;grid-area:numbers;grid-template-columns:repeat(3,1fr);grid-template-rows:repeat(4,1fr)}.operator-pad{grid-gap:.2rem;display:grid;gap:.2rem;grid-area:operators;grid-template-rows:repeat(3,1fr) 2fr}.function-pad{grid-gap:.2rem;display:grid;gap:.2rem;grid-area:functions;grid-template-columns:repeat(3,1fr)}button{background:linear-gradient(351deg,#5c5c5ce6,#e0e0e0e6);background-blend-mode:multiply;border-radius:1.5rem;font-size:3rem;place-self:stretch}.num-pad>button{background-color:#add8e6}.operator-pad>button{font-size:3.5em}.function-pad>button{font-size:2em}#off{background-color:#ff9b9b}#on{background-color:#cbffa9}#clear{background-color:#ffd6a5}
/*# sourceMappingURL=main.6f47ce72.css.map*/

View File

@ -1 +0,0 @@
{"version":3,"file":"static/css/main.6f47ce72.css","mappings":"AAEA,iBAGI,qBACJ,CAEA,WACI,sBAAuB,CACvB,mEACJ,CAEA,KACI,cACJ,CAEA,YAGI,kBAAyB,CAC7B,kDAAkF,CAE9E,kBAAmB,CAJnB,WAAW,CAGX,YAAa,CAJb,WAMJ,CAEA,oBAaI,aAAQ,CAZR,YAAa,CAYb,QAAQ,CATR,6QAQI,CAVJ,mCAAoC,CACpC,0CAWJ,CAGA,2BAEI,iBAAkB,CAClB,6BAAiC,CAFjC,gBAIJ,CAEA,8BAGI,aAAgB,CAFhB,cAAe,CACf,iBAAkB,CAGlB,UACJ,CAEA,mBAGI,cAAe,CAYf,kDAAkF,CAGlF,mBAAqB,CAErB,iCAAoC,CAdpC,YAAa,CAUb,2BAA+B,CAC/B,cAAe,CAhBf,iBAAkB,CAOlB,8CAIA,CALA,8BAA+B,CAH/B,WAAW,CAFX,gBAAiB,CAiBjB,aAAc,CAdd,UAgBJ,CAEA,KACI,qBACJ,CACA,OACI,sBACJ,CAEA,qBACI,aAAa,CAEb,UAAY,CADZ,gBAEJ,CAEA,SACI,sBAAuB,CACvB,cAAe,CACf,cAGJ,CAEA,iBAJI,iBAQJ,CAJA,QACI,gBAGJ,CAEA,UAEI,iBAAkB,CADlB,kBAGJ,CAMA,SAKI,cAAW,CAHX,YAAa,CAGb,SAAW,CAJX,iBAAkB,CAElB,mCAAoC,CACpC,gCAEJ,CAEA,cAII,cAAW,CAFX,YAAa,CAEb,SAAW,CAHX,mBAAoB,CAEpB,oCAEJ,CAEA,cAII,cAAW,CAFX,YAAa,CAEb,SAAW,CAHX,mBAAoB,CAEpB,mCAEJ,CAIA,OACI,sDAAsF,CACtF,8BAA+B,CAI/B,oBAAqB,CAFrB,cAAe,CACf,kBAEJ,CAEA,gBACI,wBAEJ,CAEA,qBACI,eACJ,CAEA,qBACI,aACJ,CAEA,KACI,wBACJ,CAEA,IACI,wBACJ,CAEA,OACI,wBACJ","sources":["App.css"],"sourcesContent":["\n\n*,\n*::before,\n*::after {\n box-sizing: border-box;\n}\n\n@font-face {\n font-family: calculator;\n src: url(\"DS-DIGIB.TTF\");\n}\n\nhtml{\n font-size: 16px;\n}\n\n#calculator{\n width:550px;\n margin:auto;\n background: rgb(68,64,64);\nbackground: linear-gradient(351deg, rgba(68,64,64,1) 0%, rgba(156,150,150,1) 100%);\n padding: 1rem;\n border-radius: 2rem;\n}\n\n#calculator-content{\n display: grid;\n grid-template-columns: repeat(4,1fr);\n grid-template-rows: 1fr 1.6fr repeat(5,1fr);\n grid-template-areas: \n \"header header header header\"\n \"display display display display\"\n \"functions functions functions operators\"\n \"numbers numbers numbers operators\"\n \"numbers numbers numbers operators\"\n \"numbers numbers numbers operators\"\n \"numbers numbers numbers operators\"\n ;\n gap:1rem;\n}\n\n\n#calculator-content > header{\n grid-area: header;\n align-self: center;\n font-family: 'Roboto', sans-serif;\n \n}\n\n#calculator-content > header > h1{\n font-size: 3rem;\n margin:0.5rem auto;\n color: aliceblue;\n\n opacity: 0.8;\n}\n\n#display-container{\n grid-area: display;\n justify-self: end;\n align-self: end;\n height:9rem;\n width:100%;\n display: grid;\n grid-template-rows: 1fr 6fr 1fr;\n grid-template-areas:\n \"memory\"\n \"main\"\n \"operator\"\n ;\n\n\n background: linear-gradient(351deg, rgba(15,93,53,1) 0%, rgba(194,228,185,1) 100%);\n font-family: 'VT323', monospace; \n font-size: 1rem;\n border-radius: 0.5rem;\n padding:0.5rem;\n box-shadow: 0.5rem 0.5rem 2rem inset;\n}\n\n.off{\n filter: brightness(0.5);\n}\n.off > p{\n display: none !important;\n}\n\n#display-container > p {\n margin:auto 0;\n text-align: right;\n opacity: 0.8;\n}\n\n#display{\n font-family: calculator;\n font-size: 6rem;\n grid-area: main;\n align-self: center;\n\n}\n\n#memory{\n grid-area: memory;\n align-self: center;\n \n}\n\n#operator{\n grid-area: operator;\n align-self: center;\n \n}\n\n\n\n\n\n.num-pad{\n grid-area: numbers;\n display: grid;\n grid-template-columns: repeat(3,1fr);\n grid-template-rows: repeat(4,1fr);\n gap: 0.2rem;\n}\n\n.operator-pad{\n grid-area: operators;\n display: grid;\n grid-template-rows: repeat(3,1fr) 2fr;\n gap: 0.2rem;\n}\n\n.function-pad{\n grid-area: functions;\n display: grid;\n grid-template-columns: repeat(3,1fr);\n gap: 0.2rem;\n}\n\n\n\nbutton{\n background: linear-gradient(351deg, rgba(92,92,92,0.9) 0%, rgba(224,224,224,0.9) 100%);\n background-blend-mode: multiply;\n \n font-size: 3rem;\n place-self: stretch;\n border-radius: 1.5rem;\n}\n\n.num-pad > button{\n background-color: lightblue;\n\n}\n\n.operator-pad > button{\n font-size: 3.5em;\n}\n\n.function-pad > button{\n font-size: 2em;\n}\n\n#off{\n background-color: #FF9B9B;\n}\n\n#on{\n background-color: #CBFFA9;\n}\n\n#clear{\n background-color: #FFD6A5;\n}"],"names":[],"sourceRoot":""}

View File

@ -1,2 +0,0 @@
"use strict";(self.webpackChunkcalculator=self.webpackChunkcalculator||[]).push([[787],{787:(e,t,n)=>{n.r(t),n.d(t,{getCLS:()=>y,getFCP:()=>g,getFID:()=>C,getLCP:()=>P,getTTFB:()=>D});var i,r,a,o,u=function(e,t){return{name:e,value:void 0===t?-1:t,delta:0,entries:[],id:"v2-".concat(Date.now(),"-").concat(Math.floor(8999999999999*Math.random())+1e12)}},c=function(e,t){try{if(PerformanceObserver.supportedEntryTypes.includes(e)){if("first-input"===e&&!("PerformanceEventTiming"in self))return;var n=new PerformanceObserver((function(e){return e.getEntries().map(t)}));return n.observe({type:e,buffered:!0}),n}}catch(e){}},f=function(e,t){var n=function n(i){"pagehide"!==i.type&&"hidden"!==document.visibilityState||(e(i),t&&(removeEventListener("visibilitychange",n,!0),removeEventListener("pagehide",n,!0)))};addEventListener("visibilitychange",n,!0),addEventListener("pagehide",n,!0)},s=function(e){addEventListener("pageshow",(function(t){t.persisted&&e(t)}),!0)},m=function(e,t,n){var i;return function(r){t.value>=0&&(r||n)&&(t.delta=t.value-(i||0),(t.delta||void 0===i)&&(i=t.value,e(t)))}},v=-1,p=function(){return"hidden"===document.visibilityState?0:1/0},d=function(){f((function(e){var t=e.timeStamp;v=t}),!0)},l=function(){return v<0&&(v=p(),d(),s((function(){setTimeout((function(){v=p(),d()}),0)}))),{get firstHiddenTime(){return v}}},g=function(e,t){var n,i=l(),r=u("FCP"),a=function(e){"first-contentful-paint"===e.name&&(f&&f.disconnect(),e.startTime<i.firstHiddenTime&&(r.value=e.startTime,r.entries.push(e),n(!0)))},o=window.performance&&performance.getEntriesByName&&performance.getEntriesByName("first-contentful-paint")[0],f=o?null:c("paint",a);(o||f)&&(n=m(e,r,t),o&&a(o),s((function(i){r=u("FCP"),n=m(e,r,t),requestAnimationFrame((function(){requestAnimationFrame((function(){r.value=performance.now()-i.timeStamp,n(!0)}))}))})))},h=!1,T=-1,y=function(e,t){h||(g((function(e){T=e.value})),h=!0);var n,i=function(t){T>-1&&e(t)},r=u("CLS",0),a=0,o=[],v=function(e){if(!e.hadRecentInput){var t=o[0],i=o[o.length-1];a&&e.startTime-i.startTime<1e3&&e.startTime-t.startTime<5e3?(a+=e.value,o.push(e)):(a=e.value,o=[e]),a>r.value&&(r.value=a,r.entries=o,n())}},p=c("layout-shift",v);p&&(n=m(i,r,t),f((function(){p.takeRecords().map(v),n(!0)})),s((function(){a=0,T=-1,r=u("CLS",0),n=m(i,r,t)})))},E={passive:!0,capture:!0},w=new Date,L=function(e,t){i||(i=t,r=e,a=new Date,F(removeEventListener),S())},S=function(){if(r>=0&&r<a-w){var e={entryType:"first-input",name:i.type,target:i.target,cancelable:i.cancelable,startTime:i.timeStamp,processingStart:i.timeStamp+r};o.forEach((function(t){t(e)})),o=[]}},b=function(e){if(e.cancelable){var t=(e.timeStamp>1e12?new Date:performance.now())-e.timeStamp;"pointerdown"==e.type?function(e,t){var n=function(){L(e,t),r()},i=function(){r()},r=function(){removeEventListener("pointerup",n,E),removeEventListener("pointercancel",i,E)};addEventListener("pointerup",n,E),addEventListener("pointercancel",i,E)}(t,e):L(t,e)}},F=function(e){["mousedown","keydown","touchstart","pointerdown"].forEach((function(t){return e(t,b,E)}))},C=function(e,t){var n,a=l(),v=u("FID"),p=function(e){e.startTime<a.firstHiddenTime&&(v.value=e.processingStart-e.startTime,v.entries.push(e),n(!0))},d=c("first-input",p);n=m(e,v,t),d&&f((function(){d.takeRecords().map(p),d.disconnect()}),!0),d&&s((function(){var a;v=u("FID"),n=m(e,v,t),o=[],r=-1,i=null,F(addEventListener),a=p,o.push(a),S()}))},k={},P=function(e,t){var n,i=l(),r=u("LCP"),a=function(e){var t=e.startTime;t<i.firstHiddenTime&&(r.value=t,r.entries.push(e),n())},o=c("largest-contentful-paint",a);if(o){n=m(e,r,t);var v=function(){k[r.id]||(o.takeRecords().map(a),o.disconnect(),k[r.id]=!0,n(!0))};["keydown","click"].forEach((function(e){addEventListener(e,v,{once:!0,capture:!0})})),f(v,!0),s((function(i){r=u("LCP"),n=m(e,r,t),requestAnimationFrame((function(){requestAnimationFrame((function(){r.value=performance.now()-i.timeStamp,k[r.id]=!0,n(!0)}))}))}))}},D=function(e){var t,n=u("TTFB");t=function(){try{var t=performance.getEntriesByType("navigation")[0]||function(){var e=performance.timing,t={entryType:"navigation",startTime:0};for(var n in e)"navigationStart"!==n&&"toJSON"!==n&&(t[n]=Math.max(e[n]-e.navigationStart,0));return t}();if(n.value=n.delta=t.responseStart,n.value<0||n.value>performance.now())return;n.entries=[t],e(n)}catch(e){}},"complete"===document.readyState?setTimeout(t,0):addEventListener("load",(function(){return setTimeout(t,0)}))}}}]);
//# sourceMappingURL=787.5f81c7f8.chunk.js.map

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -1,39 +0,0 @@
/**
* @license React
* react-dom.production.min.js
*
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/
/**
* @license React
* react-jsx-runtime.production.min.js
*
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/
/**
* @license React
* react.production.min.js
*
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/
/**
* @license React
* scheduler.production.min.js
*
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/

File diff suppressed because one or more lines are too long

16
index.html Normal file
View File

@ -0,0 +1,16 @@
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<link rel="icon" type="image/svg+xml" href="/vite.svg" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Vite + React</title>
</head>
<body>
<div id="root"></div>
<script type="module" src="/src/index.jsx"></script>
</body>
</html>

17236
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@ -1,44 +1,26 @@
{
"homepage": "https://andrzejstepien.github.io/calculator/",
"name": "calculator",
"version": "0.1.0",
"name": "calculator-vite",
"private": true,
"dependencies": {
"@testing-library/jest-dom": "^5.16.5",
"@testing-library/react": "^13.4.0",
"@testing-library/user-event": "^13.5.0",
"react": "^18.2.0",
"react-dom": "^18.2.0",
"react-scripts": "5.0.1",
"web-vitals": "^2.1.4"
},
"version": "0.0.0",
"type": "module",
"scripts": {
"start": "react-scripts start",
"build": "react-scripts build",
"test": "react-scripts test",
"eject": "react-scripts eject",
"predeploy": "npm run build",
"deploy": "gh-pages -d build"
"dev": "vite",
"build": "vite build",
"lint": "eslint . --ext js,jsx --report-unused-disable-directives --max-warnings 0",
"preview": "vite preview"
},
"eslintConfig": {
"extends": [
"react-app",
"react-app/jest"
]
},
"browserslist": {
"production": [
">0.2%",
"not dead",
"not op_mini all"
],
"development": [
"last 1 chrome version",
"last 1 firefox version",
"last 1 safari version"
]
"dependencies": {
"react": "^18.2.0",
"react-dom": "^18.2.0"
},
"devDependencies": {
"gh-pages": "^5.0.0"
"@types/react": "^18.2.66",
"@types/react-dom": "^18.2.22",
"@vitejs/plugin-react": "^4.2.1",
"eslint": "^8.57.0",
"eslint-plugin-react": "^7.34.1",
"eslint-plugin-react-hooks": "^4.6.0",
"eslint-plugin-react-refresh": "^0.4.6",
"vite": "^5.2.0"
}
}

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.8 KiB

View File

@ -1,47 +0,0 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<link rel="icon" href="%PUBLIC_URL%/favicon.ico" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<meta name="theme-color" content="#000000" />
<meta
name="description"
content="Web site created using create-react-app"
/>
<link rel="apple-touch-icon" href="%PUBLIC_URL%/logo192.png" />
<!--
manifest.json provides metadata used when your web app is installed on a
user's mobile device or desktop. See https://developers.google.com/web/fundamentals/web-app-manifest/
-->
<link rel="manifest" href="%PUBLIC_URL%/manifest.json" />
<!--
Notice the use of %PUBLIC_URL% in the tags above.
It will be replaced with the URL of the `public` folder during the build.
Only files inside the `public` folder can be referenced from the HTML.
Unlike "/favicon.ico" or "favicon.ico", "%PUBLIC_URL%/favicon.ico" will
work correctly both with client-side routing and a non-root public URL.
Learn how to configure a non-root public URL by running `npm run build`.
-->
<title>React App</title>
</head>
<body>
<noscript>You need to enable JavaScript to run this app.</noscript>
<div id="root"></div>
<!--
This HTML file is a template.
If you open it directly in the browser, you will see an empty page.
You can add webfonts, meta tags, or analytics to this file.
The build step will place the bundled scripts into the <body> tag.
To begin the development, run `npm start` or `yarn start`.
To create a production bundle, use `npm run build` or `yarn build`.
-->
<script src="https://cdn.freecodecamp.org/testable-projects-fcc/v1/bundle.js"></script>
<link rel="preconnect" href="https://fonts.googleapis.com">
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
<link href="https://fonts.googleapis.com/css2?family=Roboto:wght@500&family=VT323&display=swap" rel="stylesheet">
</body>
</html>

Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 9.4 KiB

View File

@ -1,25 +0,0 @@
{
"short_name": "React App",
"name": "Create React App Sample",
"icons": [
{
"src": "favicon.ico",
"sizes": "64x64 32x32 24x24 16x16",
"type": "image/x-icon"
},
{
"src": "logo192.png",
"type": "image/png",
"sizes": "192x192"
},
{
"src": "logo512.png",
"type": "image/png",
"sizes": "512x512"
}
],
"start_url": ".",
"display": "standalone",
"theme_color": "#000000",
"background_color": "#ffffff"
}

View File

@ -1,3 +0,0 @@
# https://www.robotstxt.org/robotstxt.html
User-agent: *
Disallow:

1
public/vite.svg Normal file
View File

@ -0,0 +1 @@
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" aria-hidden="true" role="img" class="iconify iconify--logos" width="31.88" height="32" preserveAspectRatio="xMidYMid meet" viewBox="0 0 256 257"><defs><linearGradient id="IconifyId1813088fe1fbc01fb466" x1="-.828%" x2="57.636%" y1="7.652%" y2="78.411%"><stop offset="0%" stop-color="#41D1FF"></stop><stop offset="100%" stop-color="#BD34FE"></stop></linearGradient><linearGradient id="IconifyId1813088fe1fbc01fb467" x1="43.376%" x2="50.316%" y1="2.242%" y2="89.03%"><stop offset="0%" stop-color="#FFEA83"></stop><stop offset="8.333%" stop-color="#FFDD35"></stop><stop offset="100%" stop-color="#FFA800"></stop></linearGradient></defs><path fill="url(#IconifyId1813088fe1fbc01fb466)" d="M255.153 37.938L134.897 252.976c-2.483 4.44-8.862 4.466-11.382.048L.875 37.958c-2.746-4.814 1.371-10.646 6.827-9.67l120.385 21.517a6.537 6.537 0 0 0 2.322-.004l117.867-21.483c5.438-.991 9.574 4.796 6.877 9.62Z"></path><path fill="url(#IconifyId1813088fe1fbc01fb467)" d="M185.432.063L96.44 17.501a3.268 3.268 0 0 0-2.634 3.014l-5.474 92.456a3.268 3.268 0 0 0 3.997 3.378l24.777-5.718c2.318-.535 4.413 1.507 3.936 3.838l-7.361 36.047c-.495 2.426 1.782 4.5 4.151 3.78l15.304-4.649c2.372-.72 4.652 1.36 4.15 3.788l-11.698 56.621c-.732 3.542 3.979 5.473 5.943 2.437l1.313-2.028l72.516-144.72c1.215-2.423-.88-5.186-3.54-4.672l-25.505 4.922c-2.396.462-4.435-1.77-3.759-4.114l16.646-57.705c.677-2.35-1.37-4.583-3.769-4.113Z"></path></svg>

After

Width:  |  Height:  |  Size: 1.5 KiB

View File

@ -1,16 +0,0 @@
import React from 'react';
import ReactDOM from 'react-dom/client';
import App from './App';
import reportWebVitals from './reportWebVitals';
const root = ReactDOM.createRoot(document.getElementById('root'));
root.render(
<React.StrictMode>
<App />
</React.StrictMode>
);
// If you want to start measuring performance in your app, pass a function
// to log results (for example: reportWebVitals(console.log))
// or send to an analytics endpoint. Learn more: https://bit.ly/CRA-vitals
reportWebVitals();

10
src/index.jsx Normal file
View File

@ -0,0 +1,10 @@
import React from 'react';
import ReactDOM from 'react-dom/client';
import App from './App';
const root = ReactDOM.createRoot(document.getElementById('root'));
root.render(
<React.StrictMode>
<App />
</React.StrictMode>
);

View File

@ -1,13 +0,0 @@
const reportWebVitals = onPerfEntry => {
if (onPerfEntry && onPerfEntry instanceof Function) {
import('web-vitals').then(({ getCLS, getFID, getFCP, getLCP, getTTFB }) => {
getCLS(onPerfEntry);
getFID(onPerfEntry);
getFCP(onPerfEntry);
getLCP(onPerfEntry);
getTTFB(onPerfEntry);
});
}
};
export default reportWebVitals;

View File

@ -1,5 +0,0 @@
// jest-dom adds custom jest matchers for asserting on DOM nodes.
// allows you to do things like:
// expect(element).toHaveTextContent(/react/i)
// learn more: https://github.com/testing-library/jest-dom
import '@testing-library/jest-dom';

7
vite.config.js Normal file
View File

@ -0,0 +1,7 @@
import { defineConfig } from 'vite'
import react from '@vitejs/plugin-react'
// https://vitejs.dev/config/
export default defineConfig({
plugins: [react()],
})