├── src
├── App.css
├── index.css
├── main.jsx
├── App.jsx
├── Component
│ ├── Cnsole.jsx
│ ├── Navbar.jsx
│ └── WeatherApp.jsx
└── assets
│ └── react.svg
├── public
├── bg.jpeg
├── logo.jpeg
├── favicon.ico
├── Background.png
├── favicon-16x16.png
├── favicon-32x32.png
├── apple-touch-icon.png
├── android-chrome-192x192.png
├── android-chrome-512x512.png
└── site.webmanifest
├── postcss.config.js
├── vite.config.js
├── tailwind.config.js
├── .gitignore
├── .eslintrc.cjs
├── index.html
├── package.json
├── SECURITY.md
└── README.md
/src/App.css:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/src/index.css:
--------------------------------------------------------------------------------
1 | @tailwind base;
2 | @tailwind components;
3 | @tailwind utilities;
4 |
5 |
--------------------------------------------------------------------------------
/public/bg.jpeg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/MehmetBozkir/React-interview-app/HEAD/public/bg.jpeg
--------------------------------------------------------------------------------
/public/logo.jpeg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/MehmetBozkir/React-interview-app/HEAD/public/logo.jpeg
--------------------------------------------------------------------------------
/public/favicon.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/MehmetBozkir/React-interview-app/HEAD/public/favicon.ico
--------------------------------------------------------------------------------
/public/Background.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/MehmetBozkir/React-interview-app/HEAD/public/Background.png
--------------------------------------------------------------------------------
/public/favicon-16x16.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/MehmetBozkir/React-interview-app/HEAD/public/favicon-16x16.png
--------------------------------------------------------------------------------
/public/favicon-32x32.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/MehmetBozkir/React-interview-app/HEAD/public/favicon-32x32.png
--------------------------------------------------------------------------------
/postcss.config.js:
--------------------------------------------------------------------------------
1 | export default {
2 | plugins: {
3 | tailwindcss: {},
4 | autoprefixer: {},
5 | },
6 | }
7 |
--------------------------------------------------------------------------------
/public/apple-touch-icon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/MehmetBozkir/React-interview-app/HEAD/public/apple-touch-icon.png
--------------------------------------------------------------------------------
/public/android-chrome-192x192.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/MehmetBozkir/React-interview-app/HEAD/public/android-chrome-192x192.png
--------------------------------------------------------------------------------
/public/android-chrome-512x512.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/MehmetBozkir/React-interview-app/HEAD/public/android-chrome-512x512.png
--------------------------------------------------------------------------------
/vite.config.js:
--------------------------------------------------------------------------------
1 | import { defineConfig } from 'vite'
2 | import react from '@vitejs/plugin-react'
3 |
4 | // https://vitejs.dev/config/
5 | export default defineConfig({
6 | plugins: [react()],
7 | })
8 |
--------------------------------------------------------------------------------
/public/site.webmanifest:
--------------------------------------------------------------------------------
1 | {"name":"","short_name":"","icons":[{"src":"/android-chrome-192x192.png","sizes":"192x192","type":"image/png"},{"src":"/android-chrome-512x512.png","sizes":"512x512","type":"image/png"}],"theme_color":"#ffffff","background_color":"#ffffff","display":"standalone"}
--------------------------------------------------------------------------------
/src/main.jsx:
--------------------------------------------------------------------------------
1 | import React from 'react'
2 | import ReactDOM from 'react-dom/client'
3 | import App from './App.jsx'
4 | import './index.css'
5 | import { QueryClient, QueryClientProvider } from 'react-query'
6 |
7 | const queryClient = new QueryClient()
8 |
9 | ReactDOM.createRoot(document.getElementById('root')).render(
10 |
8 |
9 |
10 |
11 | :wrench: Features
12 | -----------------------
13 |
14 |
15 | The API site I used when creating the site is below:
16 |
17 | Weather Api
18 |
19 |
20 | You can access documents regarding the use of the API from the link.
21 |
22 | Docs.
23 |
24 |
25 |
26 |
27 | ## :book: How to use
28 | To clone and run this application, you'll need [Git](https://git-scm.com/downloads) and [ReactJS](https://reactjs.org/docs/getting-started.html) installed on your computer. From your command line:
29 |
30 | ```
31 | # Clone this repository
32 | $ git clone https://github.com/MehmetBozkir/React-interview-app.git
33 |
34 | # Go into the repository
35 | $ cd React-interview-app
36 |
37 | # Install dependencies
38 | $ npm install
39 |
40 | # Visit the page and get the API key
41 | $ https://www.weatherapi.com/
42 |
43 | # Include the personal API key you have in the .env folder
44 | $ echo "VITE_WEATHER_API=YOUR_API_KEY" > .env
45 |
46 | # Run the app
47 | $ npm run dev
48 | ```
49 | ## :link: Demo
50 | - Click Here to see and play by yourself a demo of the game.
51 |
52 |
53 |
--------------------------------------------------------------------------------
/src/Component/Cnsole.jsx:
--------------------------------------------------------------------------------
1 | import React from "react";
2 | import { useEffect } from "react";
3 |
4 | function Cnsole() {
5 | useEffect(() => {
6 | console.log(`
7 |
8 |
9 |
10 | ███ ███ ███████ ██ ██ ███ ███ ███████ ████████
11 | ████ ████ ██ ██ ██ ████ ████ ██ ██
12 | ██ ████ ██ █████ ███████ ██ ████ ██ █████ ██
13 | ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██
14 | ██ ██ ███████ ██ ██ ██ ██ ███████ ██
15 |
16 |
17 | ███████ █████ ██ ██ ██ ██
18 | ██ ██ ██ ██ ██ ██ ██
19 | ███████ ███████ ██ ██ ███████
20 | ██ ██ ██ ██ ██ ██ ██
21 | ███████ ██ ██ ███████ ██ ██ ██
22 |
23 |
24 | ██████ ██████ ███████ ██ ██ ██ ██████
25 | ██ ██ ██ ██ ███ ██ ██ ██ ██ ██
26 | ██████ ██ ██ ███ █████ ██ ██████
27 | ██ ██ ██ ██ ███ ██ ██ ██ ██ ██
28 | ██████ ██████ ███████ ██ ██ ██ ██ ██
29 |
30 |
31 |
32 | Please visit my github page for code review : https://github.com/MehmetBozkir
33 |
34 |
35 |
36 | `);
37 | }, []);
38 |
39 | return <>>;
40 | }
41 |
42 | export default Cnsole;
43 |
--------------------------------------------------------------------------------
/src/Component/Navbar.jsx:
--------------------------------------------------------------------------------
1 | import React from "react";
2 | import { useState, useEffect } from "react";
3 | import Logo from "/logo.jpeg";
4 |
5 | function Navbar() {
6 | const [theme, setTheme] = useState(
7 | localStorage.getItem("theme") ? localStorage.getItem("theme") : "light"
8 | );
9 |
10 | const handleToggle = (e) => {
11 | if (e.target.checked) {
12 | setTheme("dark");
13 | } else {
14 | setTheme("light");
15 | }
16 | };
17 |
18 | const handleClick = () => {
19 | window.location.reload();
20 | };
21 |
22 | useEffect(() => {
23 | localStorage.setItem("theme", theme);
24 | const localTheme = localStorage.getItem("theme");
25 | document.querySelector("html").setAttribute("data-theme", localTheme);
26 | }, [theme]);
27 | return (
28 |
80 | Welcome to TypeWeather{" "} 81 |
82 |83 | Choose a location to see the weather forecast 84 |
85 | 92 | 98 | 106 |An Error Occurred
108 |110 | Cause : {data.error.message} 111 |
112 |
155 | {" "}
156 |
160 | {data.current.feelslike_c}°C 161 |
162 |
166 | {" "}
167 |
{data.current.vis_km}%
171 |
175 | {" "}
176 |
180 | {data.current.wind_kph} km/h 181 |
182 |
186 | {" "}
187 |
{data.current.humidity}%
191 |
195 | {" "}
196 |
{data.current.uv}
200 |{day.day.maxtemp_c} °C
217 |{day.day.mintemp_c} °C
218 |238 | Welcome to TypeWeather{" "} 239 |
240 |241 | Choose a location to see the weather forecast 242 |
243 | 250 | 256 | 264 |