├── .gitignore ├── .prettierrc ├── public ├── robots.txt ├── log.png ├── favicon.ico ├── logo192.png ├── logo512.png ├── manifest.json └── index.html ├── .DS_Store ├── src ├── clips │ ├── 1.png │ ├── 18.png │ ├── 2.png │ ├── 22.png │ ├── 3.png │ ├── 33.png │ ├── ad.png │ ├── me.JPG │ ├── me.PNG │ ├── rd.png │ ├── abk.png │ ├── adzh.png │ ├── ala.png │ ├── asad.png │ ├── asir.png │ ├── bou.png │ ├── cat.png │ ├── cli.png │ ├── clik.png │ ├── fnj.png │ ├── frat.png │ ├── game.png │ ├── king.png │ ├── kta.png │ ├── loua.png │ ├── maso.png │ ├── mod.png │ ├── moz.png │ ├── obih.png │ ├── pas.png │ ├── pass.png │ ├── pic.jpeg │ ├── pilo.png │ ├── rid.png │ ├── staj.png │ ├── taj.jpeg │ ├── this.png │ ├── vip.png │ ├── yas.png │ ├── zech.png │ ├── Ahmed.png │ ├── abel.jpeg │ ├── crown.png │ ├── houbet.png │ ├── meme.jpeg │ ├── memem.jpeg │ ├── mmaghri.jpg │ ├── newahm.png │ ├── nopic.png │ ├── notab.png │ ├── redex.png │ ├── adzahrao.png │ ├── approuve.png │ └── maximize.png ├── setupTests.js ├── App.test.js ├── Loader │ ├── Loader.jsx │ └── Loader.css ├── Nav │ ├── Nav.css │ └── Nav.jsx ├── Sheets │ ├── sheets.css │ ├── Sheets.jsx │ └── SheetsComp.jsx ├── reportWebVitals.js ├── Layout │ └── Layout.jsx ├── apicall.jsx ├── Scrol │ ├── Scrol.css │ └── Scrol.jsx ├── index.js ├── App.css ├── Auth │ ├── Auth.css │ └── Auth.jsx ├── Home │ ├── Home.css │ └── Home.jsx ├── Selector │ ├── Sekector.css │ └── Slector.jsx ├── About │ ├── About.css │ └── About.jsx ├── index.css ├── Func_Help │ └── helper.js ├── App.js ├── Connection │ └── Connect.jsx ├── logo.svg ├── Peer │ ├── Listpeer.jsx │ └── Peer.jsx ├── context.jsx ├── Game │ └── Game.jsx ├── AiModel │ └── Model.jsx ├── Dropdown │ └── Dropdown.jsx ├── Calculator │ └── Calculator.jsx └── Vip │ └── Vip.jsx ├── tailwind.config.js ├── package.json └── README.md /.gitignore: -------------------------------------------------------------------------------- 1 | /node_modules 2 | /dist 3 | -------------------------------------------------------------------------------- /.prettierrc: -------------------------------------------------------------------------------- 1 | { 2 | "tabWidth": 2, 3 | "useTabs": false 4 | } 5 | 6 | -------------------------------------------------------------------------------- /public/robots.txt: -------------------------------------------------------------------------------- 1 | # https://www.robotstxt.org/robotstxt.html 2 | User-agent: * 3 | Disallow: 4 | -------------------------------------------------------------------------------- /.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Mohammed-Maghri/The-Old-Ranking-1337-Students-Platform-/HEAD/.DS_Store -------------------------------------------------------------------------------- /public/log.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Mohammed-Maghri/The-Old-Ranking-1337-Students-Platform-/HEAD/public/log.png -------------------------------------------------------------------------------- /src/clips/1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Mohammed-Maghri/The-Old-Ranking-1337-Students-Platform-/HEAD/src/clips/1.png -------------------------------------------------------------------------------- /src/clips/18.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Mohammed-Maghri/The-Old-Ranking-1337-Students-Platform-/HEAD/src/clips/18.png -------------------------------------------------------------------------------- /src/clips/2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Mohammed-Maghri/The-Old-Ranking-1337-Students-Platform-/HEAD/src/clips/2.png -------------------------------------------------------------------------------- /src/clips/22.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Mohammed-Maghri/The-Old-Ranking-1337-Students-Platform-/HEAD/src/clips/22.png -------------------------------------------------------------------------------- /src/clips/3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Mohammed-Maghri/The-Old-Ranking-1337-Students-Platform-/HEAD/src/clips/3.png -------------------------------------------------------------------------------- /src/clips/33.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Mohammed-Maghri/The-Old-Ranking-1337-Students-Platform-/HEAD/src/clips/33.png -------------------------------------------------------------------------------- /src/clips/ad.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Mohammed-Maghri/The-Old-Ranking-1337-Students-Platform-/HEAD/src/clips/ad.png -------------------------------------------------------------------------------- /src/clips/me.JPG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Mohammed-Maghri/The-Old-Ranking-1337-Students-Platform-/HEAD/src/clips/me.JPG -------------------------------------------------------------------------------- /src/clips/me.PNG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Mohammed-Maghri/The-Old-Ranking-1337-Students-Platform-/HEAD/src/clips/me.PNG -------------------------------------------------------------------------------- /src/clips/rd.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Mohammed-Maghri/The-Old-Ranking-1337-Students-Platform-/HEAD/src/clips/rd.png -------------------------------------------------------------------------------- /public/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Mohammed-Maghri/The-Old-Ranking-1337-Students-Platform-/HEAD/public/favicon.ico -------------------------------------------------------------------------------- /public/logo192.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Mohammed-Maghri/The-Old-Ranking-1337-Students-Platform-/HEAD/public/logo192.png -------------------------------------------------------------------------------- /public/logo512.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Mohammed-Maghri/The-Old-Ranking-1337-Students-Platform-/HEAD/public/logo512.png -------------------------------------------------------------------------------- /src/clips/abk.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Mohammed-Maghri/The-Old-Ranking-1337-Students-Platform-/HEAD/src/clips/abk.png -------------------------------------------------------------------------------- /src/clips/adzh.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Mohammed-Maghri/The-Old-Ranking-1337-Students-Platform-/HEAD/src/clips/adzh.png -------------------------------------------------------------------------------- /src/clips/ala.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Mohammed-Maghri/The-Old-Ranking-1337-Students-Platform-/HEAD/src/clips/ala.png -------------------------------------------------------------------------------- /src/clips/asad.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Mohammed-Maghri/The-Old-Ranking-1337-Students-Platform-/HEAD/src/clips/asad.png -------------------------------------------------------------------------------- /src/clips/asir.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Mohammed-Maghri/The-Old-Ranking-1337-Students-Platform-/HEAD/src/clips/asir.png -------------------------------------------------------------------------------- /src/clips/bou.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Mohammed-Maghri/The-Old-Ranking-1337-Students-Platform-/HEAD/src/clips/bou.png -------------------------------------------------------------------------------- /src/clips/cat.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Mohammed-Maghri/The-Old-Ranking-1337-Students-Platform-/HEAD/src/clips/cat.png -------------------------------------------------------------------------------- /src/clips/cli.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Mohammed-Maghri/The-Old-Ranking-1337-Students-Platform-/HEAD/src/clips/cli.png -------------------------------------------------------------------------------- /src/clips/clik.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Mohammed-Maghri/The-Old-Ranking-1337-Students-Platform-/HEAD/src/clips/clik.png -------------------------------------------------------------------------------- /src/clips/fnj.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Mohammed-Maghri/The-Old-Ranking-1337-Students-Platform-/HEAD/src/clips/fnj.png -------------------------------------------------------------------------------- /src/clips/frat.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Mohammed-Maghri/The-Old-Ranking-1337-Students-Platform-/HEAD/src/clips/frat.png -------------------------------------------------------------------------------- /src/clips/game.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Mohammed-Maghri/The-Old-Ranking-1337-Students-Platform-/HEAD/src/clips/game.png -------------------------------------------------------------------------------- /src/clips/king.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Mohammed-Maghri/The-Old-Ranking-1337-Students-Platform-/HEAD/src/clips/king.png -------------------------------------------------------------------------------- /src/clips/kta.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Mohammed-Maghri/The-Old-Ranking-1337-Students-Platform-/HEAD/src/clips/kta.png -------------------------------------------------------------------------------- /src/clips/loua.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Mohammed-Maghri/The-Old-Ranking-1337-Students-Platform-/HEAD/src/clips/loua.png -------------------------------------------------------------------------------- /src/clips/maso.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Mohammed-Maghri/The-Old-Ranking-1337-Students-Platform-/HEAD/src/clips/maso.png -------------------------------------------------------------------------------- /src/clips/mod.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Mohammed-Maghri/The-Old-Ranking-1337-Students-Platform-/HEAD/src/clips/mod.png -------------------------------------------------------------------------------- /src/clips/moz.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Mohammed-Maghri/The-Old-Ranking-1337-Students-Platform-/HEAD/src/clips/moz.png -------------------------------------------------------------------------------- /src/clips/obih.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Mohammed-Maghri/The-Old-Ranking-1337-Students-Platform-/HEAD/src/clips/obih.png -------------------------------------------------------------------------------- /src/clips/pas.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Mohammed-Maghri/The-Old-Ranking-1337-Students-Platform-/HEAD/src/clips/pas.png -------------------------------------------------------------------------------- /src/clips/pass.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Mohammed-Maghri/The-Old-Ranking-1337-Students-Platform-/HEAD/src/clips/pass.png -------------------------------------------------------------------------------- /src/clips/pic.jpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Mohammed-Maghri/The-Old-Ranking-1337-Students-Platform-/HEAD/src/clips/pic.jpeg -------------------------------------------------------------------------------- /src/clips/pilo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Mohammed-Maghri/The-Old-Ranking-1337-Students-Platform-/HEAD/src/clips/pilo.png -------------------------------------------------------------------------------- /src/clips/rid.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Mohammed-Maghri/The-Old-Ranking-1337-Students-Platform-/HEAD/src/clips/rid.png -------------------------------------------------------------------------------- /src/clips/staj.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Mohammed-Maghri/The-Old-Ranking-1337-Students-Platform-/HEAD/src/clips/staj.png -------------------------------------------------------------------------------- /src/clips/taj.jpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Mohammed-Maghri/The-Old-Ranking-1337-Students-Platform-/HEAD/src/clips/taj.jpeg -------------------------------------------------------------------------------- /src/clips/this.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Mohammed-Maghri/The-Old-Ranking-1337-Students-Platform-/HEAD/src/clips/this.png -------------------------------------------------------------------------------- /src/clips/vip.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Mohammed-Maghri/The-Old-Ranking-1337-Students-Platform-/HEAD/src/clips/vip.png -------------------------------------------------------------------------------- /src/clips/yas.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Mohammed-Maghri/The-Old-Ranking-1337-Students-Platform-/HEAD/src/clips/yas.png -------------------------------------------------------------------------------- /src/clips/zech.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Mohammed-Maghri/The-Old-Ranking-1337-Students-Platform-/HEAD/src/clips/zech.png -------------------------------------------------------------------------------- /src/clips/Ahmed.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Mohammed-Maghri/The-Old-Ranking-1337-Students-Platform-/HEAD/src/clips/Ahmed.png -------------------------------------------------------------------------------- /src/clips/abel.jpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Mohammed-Maghri/The-Old-Ranking-1337-Students-Platform-/HEAD/src/clips/abel.jpeg -------------------------------------------------------------------------------- /src/clips/crown.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Mohammed-Maghri/The-Old-Ranking-1337-Students-Platform-/HEAD/src/clips/crown.png -------------------------------------------------------------------------------- /src/clips/houbet.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Mohammed-Maghri/The-Old-Ranking-1337-Students-Platform-/HEAD/src/clips/houbet.png -------------------------------------------------------------------------------- /src/clips/meme.jpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Mohammed-Maghri/The-Old-Ranking-1337-Students-Platform-/HEAD/src/clips/meme.jpeg -------------------------------------------------------------------------------- /src/clips/memem.jpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Mohammed-Maghri/The-Old-Ranking-1337-Students-Platform-/HEAD/src/clips/memem.jpeg -------------------------------------------------------------------------------- /src/clips/mmaghri.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Mohammed-Maghri/The-Old-Ranking-1337-Students-Platform-/HEAD/src/clips/mmaghri.jpg -------------------------------------------------------------------------------- /src/clips/newahm.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Mohammed-Maghri/The-Old-Ranking-1337-Students-Platform-/HEAD/src/clips/newahm.png -------------------------------------------------------------------------------- /src/clips/nopic.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Mohammed-Maghri/The-Old-Ranking-1337-Students-Platform-/HEAD/src/clips/nopic.png -------------------------------------------------------------------------------- /src/clips/notab.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Mohammed-Maghri/The-Old-Ranking-1337-Students-Platform-/HEAD/src/clips/notab.png -------------------------------------------------------------------------------- /src/clips/redex.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Mohammed-Maghri/The-Old-Ranking-1337-Students-Platform-/HEAD/src/clips/redex.png -------------------------------------------------------------------------------- /src/clips/adzahrao.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Mohammed-Maghri/The-Old-Ranking-1337-Students-Platform-/HEAD/src/clips/adzahrao.png -------------------------------------------------------------------------------- /src/clips/approuve.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Mohammed-Maghri/The-Old-Ranking-1337-Students-Platform-/HEAD/src/clips/approuve.png -------------------------------------------------------------------------------- /src/clips/maximize.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Mohammed-Maghri/The-Old-Ranking-1337-Students-Platform-/HEAD/src/clips/maximize.png -------------------------------------------------------------------------------- /src/setupTests.js: -------------------------------------------------------------------------------- 1 | // jest-dom adds custom jest matchers for asserting on DOM nodes. 2 | // allows you to do things like: 3 | // expect(element).toHaveTextContent(/react/i) 4 | // learn more: https://github.com/testing-library/jest-dom 5 | import '@testing-library/jest-dom'; 6 | -------------------------------------------------------------------------------- /src/App.test.js: -------------------------------------------------------------------------------- 1 | import { render, screen } from '@testing-library/react'; 2 | import App from './App'; 3 | 4 | test('renders learn react link', () => { 5 | render(); 6 | const linkElement = screen.getByText(/learn react/i); 7 | expect(linkElement).toBeInTheDocument(); 8 | }); 9 | -------------------------------------------------------------------------------- /src/Loader/Loader.jsx: -------------------------------------------------------------------------------- 1 | import React from "react"; 2 | import "./Loader.css"; 3 | 4 | export default function Loads() { 5 | return ( 6 |
7 | 8 |
9 | ); 10 | } -------------------------------------------------------------------------------- /src/Nav/Nav.css: -------------------------------------------------------------------------------- 1 | @import url('https://fonts.googleapis.com/css2?family=Rajdhani:wght@300;400;500;600;700&display=swap'); 2 | @import url('https://fonts.googleapis.com/css2?family=Chakra+Petch:ital,wght@0,300;0,400;0,500;0,600;0,700;1,300;1,400;1,500;1,600;1,700&family=Rajdhani:wght@300;400;500;600;700&display=swap'); 3 | 4 | @tailwind base; 5 | @tailwind components; 6 | @tailwind utilities; -------------------------------------------------------------------------------- /src/Sheets/sheets.css: -------------------------------------------------------------------------------- 1 | @import url('https://fonts.googleapis.com/css2?family=Rajdhani:wght@300;400;500;600;700&display=swap'); 2 | @import url('https://fonts.googleapis.com/css2?family=Chakra+Petch:ital,wght@0,300;0,400;0,500;0,600;0,700;1,300;1,400;1,500;1,600;1,700&family=Rajdhani:wght@300;400;500;600;700&display=swap'); 3 | 4 | @tailwind base; 5 | @tailwind components; 6 | @tailwind utilities; -------------------------------------------------------------------------------- /src/reportWebVitals.js: -------------------------------------------------------------------------------- 1 | const reportWebVitals = onPerfEntry => { 2 | if (onPerfEntry && onPerfEntry instanceof Function) { 3 | import('web-vitals').then(({ getCLS, getFID, getFCP, getLCP, getTTFB }) => { 4 | getCLS(onPerfEntry); 5 | getFID(onPerfEntry); 6 | getFCP(onPerfEntry); 7 | getLCP(onPerfEntry); 8 | getTTFB(onPerfEntry); 9 | }); 10 | } 11 | }; 12 | 13 | export default reportWebVitals; 14 | -------------------------------------------------------------------------------- /src/Layout/Layout.jsx: -------------------------------------------------------------------------------- 1 | import React, { useEffect , useState} from 'react' 2 | import { Outlet, useNavigate } from 'react-router-dom' 3 | import Cookies from 'js-cookie' 4 | import { HeaderNav } from '../Nav/Nav' 5 | const Layout = () => { 6 | return ( 7 |
8 | 9 | 10 |
11 | ) 12 | } 13 | 14 | export default Layout -------------------------------------------------------------------------------- /src/apicall.jsx: -------------------------------------------------------------------------------- 1 | import React from "react"; 2 | 3 | export function apifunction(api){ 4 | fetch(api, { 5 | method: 'GET', 6 | headers: { 7 | 'Content-Type': 'application/json', 8 | 'Accept': 'application/json' 9 | }.then(response => { 10 | if (response.ok) { 11 | return response.json(); 12 | } 13 | throw new Error('Request failed!'); 14 | }).then(data => { 15 | console.log(data); 16 | }).catch(error => { 17 | console.error(error); 18 | }) 19 | }) 20 | }; -------------------------------------------------------------------------------- /public/manifest.json: -------------------------------------------------------------------------------- 1 | { 2 | "short_name": "React App", 3 | "name": "Create React App Sample", 4 | "icons": [ 5 | { 6 | "src": "log.png", 7 | "sizes": "64x64 32x32 24x24 16x16", 8 | "type": "image/x-icon" 9 | }, 10 | { 11 | "src": "log.png", 12 | "type": "image/png", 13 | "sizes": "192x192" 14 | }, 15 | { 16 | "src": "log.png", 17 | "type": "image/png", 18 | "sizes": "512x512" 19 | } 20 | ], 21 | "start_url": ".", 22 | "display": "standalone", 23 | "theme_color": "#000000", 24 | "background_color": "#ffffff" 25 | } 26 | -------------------------------------------------------------------------------- /src/Scrol/Scrol.css: -------------------------------------------------------------------------------- 1 | @import url('https://fonts.googleapis.com/css2?family=Rajdhani:wght@300;400;500;600;700&display=swap'); 2 | @import url('https://fonts.googleapis.com/css2?family=Chakra+Petch:ital,wght@0,300;0,400;0,500;0,600;0,700;1,300;1,400;1,500;1,600;1,700&family=Rajdhani:wght@300;400;500;600;700&display=swap'); 3 | @import url('https://fonts.googleapis.com/css2?family=Chakra+Petch:ital,wght@0,300;0,400;0,500;0,600;0,700;1,300;1,400;1,500;1,600;1,700&family=Rajdhani:wght@300;400;500;600;700&family=Space+Grotesk:wght@300..700&display=swap'); 4 | @import url('https://fonts.googleapis.com/css2?family=Orbitron:wght@400..900&display=swap'); 5 | 6 | 7 | @tailwind base; 8 | @tailwind components; 9 | @tailwind utilities; -------------------------------------------------------------------------------- /src/index.js: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | import ReactDOM from 'react-dom/client'; 3 | import './index.css'; 4 | import App from './App'; 5 | import reportWebVitals from './reportWebVitals'; 6 | import { MycontextProvider } from './context'; 7 | import { Nav } from './Nav/Nav'; 8 | 9 | const root = ReactDOM.createRoot(document.getElementById('root')); 10 | 11 | 12 | 13 | root.render( 14 | 15 | 16 | 17 | ); 18 | 19 | // If you want to start measuring performance in your app, pass a function 20 | // to log results (for example: reportWebVitals(console.log)) 21 | // or send to an analytics endpoint. Learn more: https://bit.ly/CRA-vitals 22 | reportWebVitals(); 23 | -------------------------------------------------------------------------------- /src/App.css: -------------------------------------------------------------------------------- 1 | .App { 2 | text-align: center; 3 | } 4 | 5 | .App-logo { 6 | height: 40vmin; 7 | pointer-events: none; 8 | } 9 | 10 | @media (prefers-reduced-motion: no-preference) { 11 | .App-logo { 12 | animation: App-logo-spin infinite 20s linear; 13 | } 14 | } 15 | 16 | .App-header { 17 | background-color: #282c34; 18 | min-height: 100vh; 19 | display: flex; 20 | flex-direction: column; 21 | align-items: center; 22 | justify-content: center; 23 | font-size: calc(10px + 2vmin); 24 | color: white; 25 | } 26 | 27 | .App-link { 28 | color: #61dafb; 29 | } 30 | 31 | @keyframes App-logo-spin { 32 | from { 33 | transform: rotate(0deg); 34 | } 35 | to { 36 | transform: rotate(360deg); 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /src/Auth/Auth.css: -------------------------------------------------------------------------------- 1 | @import url('https://fonts.googleapis.com/css2?family=Rajdhani:wght@300;400;500;600;700&display=swap'); 2 | @import url('https://fonts.googleapis.com/css2?family=Chakra+Petch:ital,wght@0,300;0,400;0,500;0,600;0,700;1,300;1,400;1,500;1,600;1,700&family=Rajdhani:wght@300;400;500;600;700&display=swap'); 3 | @import url('https://fonts.googleapis.com/css2?family=Chakra+Petch:ital,wght@0,300;0,400;0,500;0,600;0,700;1,300;1,400;1,500;1,600;1,700&family=Rajdhani:wght@300;400;500;600;700&family=Space+Grotesk:wght@300..700&display=swap'); 4 | @import url('https://fonts.googleapis.com/css2?family=Open+Sans:ital,wght@0,300..800;1,300..800&family=Sankofa+Display&family=Shadows+Into+Light&display=swap'); 5 | 6 | @tailwind base; 7 | @tailwind components; 8 | @tailwind utilities; -------------------------------------------------------------------------------- /src/Home/Home.css: -------------------------------------------------------------------------------- 1 | @import url('https://fonts.googleapis.com/css2?family=Rajdhani:wght@300;400;500;600;700&display=swap'); 2 | @import url('https://fonts.googleapis.com/css2?family=Chakra+Petch:ital,wght@0,300;0,400;0,500;0,600;0,700;1,300;1,400;1,500;1,600;1,700&family=Rajdhani:wght@300;400;500;600;700&display=swap'); 3 | @import url('https://fonts.googleapis.com/css2?family=Chakra+Petch:ital,wght@0,300;0,400;0,500;0,600;0,700;1,300;1,400;1,500;1,600;1,700&family=Rajdhani:wght@300;400;500;600;700&family=Space+Grotesk:wght@300..700&display=swap'); 4 | @import url('https://fonts.googleapis.com/css2?family=Open+Sans:ital,wght@0,300..800;1,300..800&family=Sankofa+Display&family=Shadows+Into+Light&display=swap'); 5 | 6 | @tailwind base; 7 | @tailwind components; 8 | @tailwind utilities; -------------------------------------------------------------------------------- /src/Loader/Loader.css: -------------------------------------------------------------------------------- 1 | @import url('https://fonts.googleapis.com/css2?family=Rajdhani:wght@300;400;500;600;700&display=swap'); 2 | @import url('https://fonts.googleapis.com/css2?family=Chakra+Petch:ital,wght@0,300;0,400;0,500;0,600;0,700;1,300;1,400;1,500;1,600;1,700&family=Rajdhani:wght@300;400;500;600;700&display=swap'); 3 | @import url('https://fonts.googleapis.com/css2?family=Chakra+Petch:ital,wght@0,300;0,400;0,500;0,600;0,700;1,300;1,400;1,500;1,600;1,700&family=Rajdhani:wght@300;400;500;600;700&family=Space+Grotesk:wght@300..700&display=swap'); 4 | @import url('https://fonts.googleapis.com/css2?family=Open+Sans:ital,wght@0,300..800;1,300..800&family=Sankofa+Display&family=Shadows+Into+Light&display=swap'); 5 | 6 | @tailwind base; 7 | @tailwind components; 8 | @tailwind utilities; -------------------------------------------------------------------------------- /src/Selector/Sekector.css: -------------------------------------------------------------------------------- 1 | @import url('https://fonts.googleapis.com/css2?family=Rajdhani:wght@300;400;500;600;700&display=swap'); 2 | @import url('https://fonts.googleapis.com/css2?family=Chakra+Petch:ital,wght@0,300;0,400;0,500;0,600;0,700;1,300;1,400;1,500;1,600;1,700&family=Rajdhani:wght@300;400;500;600;700&display=swap'); 3 | 4 | @tailwind base; 5 | @tailwind components; 6 | @tailwind utilities; 7 | 8 | @keyframes fadeIn { 9 | from { 10 | opacity: 0; 11 | transform: translateY(-10px); 12 | } 13 | to { 14 | opacity: 1; 15 | transform: translateY(0); 16 | } 17 | } 18 | 19 | [class*="absolute"] { 20 | animation: fadeIn 0.2s ease-out; 21 | } 22 | 23 | .backdrop-blur-sm { 24 | backdrop-filter: blur(8px); 25 | -webkit-backdrop-filter: blur(8px); 26 | } -------------------------------------------------------------------------------- /src/About/About.css: -------------------------------------------------------------------------------- 1 | @import url('https://fonts.googleapis.com/css2?family=Rajdhani:wght@300;400;500;600;700&display=swap'); 2 | @import url('https://fonts.googleapis.com/css2?family=Chakra+Petch:ital,wght@0,300;0,400;0,500;0,600;0,700;1,300;1,400;1,500;1,600;1,700&family=Rajdhani:wght@300;400;500;600;700&display=swap'); 3 | @import url('https://fonts.googleapis.com/css2?family=Chakra+Petch:ital,wght@0,300;0,400;0,500;0,600;0,700;1,300;1,400;1,500;1,600;1,700&family=Rajdhani:wght@300;400;500;600;700&family=Space+Grotesk:wght@300..700&display=swap'); 4 | @import url('https://fonts.googleapis.com/css2?family=Open+Sans:ital,wght@0,300..800;1,300..800&family=Sankofa+Display&family=Shadows+Into+Light&display=swap'); 5 | 6 | @tailwind base; 7 | 8 | 9 | @tailwind components; 10 | @tailwind utilities; 11 | -------------------------------------------------------------------------------- /src/index.css: -------------------------------------------------------------------------------- 1 | body { 2 | margin: 0; 3 | font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 4 | 'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue', 5 | sans-serif; 6 | -webkit-font-smoothing: antialiased; 7 | -moz-osx-font-smoothing: grayscale; 8 | } 9 | 10 | code { 11 | font-family: source-code-pro, Menlo, Monaco, Consolas, 'Courier New', 12 | monospace; 13 | } 14 | 15 | ::-webkit-scrollbar { 16 | width: 8px; 17 | height: 8px; 18 | background-color: #000000; 19 | } 20 | 21 | ::-webkit-scrollbar-track { 22 | background: rgba(0, 0, 0, 0.1); 23 | border-radius: 4px; 24 | } 25 | 26 | ::-webkit-scrollbar-thumb { 27 | background: #EAB308; 28 | border-radius: 4px; 29 | transition: all 0.3s ease; 30 | } 31 | 32 | ::-webkit-scrollbar-thumb:hover { 33 | background: #CA8A04; 34 | } 35 | 36 | * { 37 | scrollbar-width: thin; 38 | scrollbar-color: #EAB308 #000000; 39 | } 40 | -------------------------------------------------------------------------------- /tailwind.config.js: -------------------------------------------------------------------------------- 1 | /** @type {import('tailwindcss').Config} */ 2 | module.exports = { 3 | content: [ 4 | './src/**/*.{js,jsx,ts,tsx}', 5 | './public/index.html', 6 | './src/**/*.css', 7 | ], 8 | theme: { 9 | extend: { 10 | fontFamily: { 11 | 'bars': ['Poppins', 'sans-serif'], 12 | 'bars2': ['Chakra Petch', 'sans-serif'], 13 | 'bars3': ['Space Grotesk', 'sans-serif'], 14 | 'bars4': ['Sankofa Display', 'sans-serif'], 15 | 'bars5': ['Orbitron' , 'sans-serif'] 16 | }, 17 | screens: { 18 | 'xs' : '250px', 19 | 'xm' : '300px', 20 | 'xf' : '400px', 21 | 'bgs' : '1372px', 22 | 'balf' : '1371px', 23 | 'tsa' : '928px', 24 | }, 25 | keyframes: { 26 | fadeout: { 27 | '0%': { opacity: '1' }, // Start fully opaque 28 | '100%': { opacity: '0' }, // End fully transparent 29 | }, 30 | }, 31 | }, 32 | }, 33 | plugins: [ 34 | require('daisyui'), 35 | ], 36 | } 37 | 38 | -------------------------------------------------------------------------------- /src/Func_Help/helper.js: -------------------------------------------------------------------------------- 1 | import Cookies from "js-cookie"; 2 | import { context } from "../context"; 3 | import { useContext } from "react"; 4 | const StaticArray = [] 5 | 6 | for (let index = 0 ; index < 99; index++) 7 | StaticArray.push({level : 99.99, login : "maghri", 8 | first_name : "Mohammed" , last_name : "Maghri", location : null}) 9 | 10 | 11 | const FuncFetch = async (DomainFetch, seter, Elem, Object, from, nav, Empty, ForLoads) => { 12 | try { 13 | 14 | let Resp = await fetch(DomainFetch, { 15 | method : 'POST' , 16 | headers : { 17 | 'authorization' : `${Cookies.get('access_token')}` 18 | }, 19 | body : JSON.stringify(Object) 20 | }) 21 | if (!Resp.ok){ 22 | console.log('Error !') 23 | Cookies.remove('access_token') 24 | nav('/') 25 | } 26 | const DataFetch = await Resp.json(); 27 | let Eleme 28 | Eleme = [...Elem, ...DataFetch] 29 | seter(Eleme) 30 | if (Elem.length == 0) { 31 | Empty(false) 32 | ForLoads(true) 33 | } 34 | }catch { 35 | console.log('Error !') 36 | Cookies.remove('access_token') 37 | nav('/') 38 | } 39 | return ('Done') 40 | } 41 | export {FuncFetch, StaticArray} 42 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "twai", 3 | "version": "0.1.0", 4 | "private": true, 5 | "dependencies": { 6 | "@testing-library/jest-dom": "^5.17.0", 7 | "@testing-library/react": "^13.4.0", 8 | "@testing-library/user-event": "^13.5.0", 9 | "js-cookie": "^3.0.5", 10 | "react": "^18.3.1", 11 | "react-dom": "^18.3.1", 12 | "react-icons": "^5.2.1", 13 | "react-router-dom": "^6.25.1", 14 | "react-scripts": "5.0.1", 15 | "react-starfield": "^1.0.3", 16 | "vercel": "^35.2.3", 17 | "web-vitals": "^2.1.4" 18 | }, 19 | "proxy": "http://192.168.1.115", 20 | "scripts": { 21 | "start": "react-scripts start", 22 | "build": "GENERATE_SOURCEMAP=false react-scripts build", 23 | "test": "react-scripts test", 24 | "eject": "react-scripts eject" 25 | }, 26 | "eslintConfig": { 27 | "extends": [ 28 | "react-app", 29 | "react-app/jest" 30 | ] 31 | }, 32 | "browserslist": { 33 | "production": [ 34 | ">0.2%", 35 | "not dead", 36 | "not op_mini all" 37 | ], 38 | "development": [ 39 | "last 1 chrome version", 40 | "last 1 firefox version", 41 | "last 1 safari version" 42 | ] 43 | }, 44 | "devDependencies": { 45 | "daisyui": "^4.3.2-alpha.0", 46 | "tailwindcss": "^3.4.7" 47 | } 48 | } 49 | -------------------------------------------------------------------------------- /src/App.js: -------------------------------------------------------------------------------- 1 | import logo from './logo.svg'; 2 | import './App.css'; 3 | import React from 'react'; 4 | import { BrowserRouter as Router, Route, Switch, Routes } from 'react-router-dom'; 5 | import { Home } from './Home/Home'; 6 | import Auth from './Auth/Auth'; 7 | import { Calculator } from './Calculator/Calculator'; 8 | import {Game} from "./Game/Game"; 9 | import { Model } from "./AiModel/Model"; 10 | import { Peer } from './Peer/Peer'; 11 | import { Sheets } from './Sheets/Sheets' 12 | import Connect from './Connection/Connect.jsx' 13 | import Layout from './Layout/Layout.jsx'; 14 | import Vip from './Vip/Vip.jsx'; 15 | 16 | 17 | import { Nav } from './Nav/Nav.jsx'; 18 | function App() { 19 | return ( 20 | 21 | 22 | } /> 23 | } /> 24 | }> 25 | } /> 26 | } /> 27 | } /> 28 | } /> 29 | } /> 30 | } /> 31 | 32 | 33 | 34 | ); 35 | } 36 | 37 | export default App; 38 | -------------------------------------------------------------------------------- /src/Connection/Connect.jsx: -------------------------------------------------------------------------------- 1 | import React, { useEffect } from 'react' 2 | import Load from '../Loader/Loader' 3 | import Cookies from 'js-cookie' 4 | import { useContext } from 'react' 5 | import { context } from '../context' 6 | import { useNavigate } from 'react-router' 7 | 8 | const Connect = () => { 9 | const {ObjectData, setObjectData} = useContext(context) 10 | const navigate = useNavigate() 11 | 12 | useEffect(() => { 13 | const EndPoint = "https://api.1337leets.com/Auth" 14 | const ParamCode = new URLSearchParams(window.location.search).get('code') 15 | console.log(' == > ', ParamCode) 16 | if (ParamCode == undefined && !Cookies.get('access_token')) 17 | navigate('/') 18 | else if (Cookies.get('access_token') != null && Cookies.get('access_token') != undefined){ 19 | navigate('/Home') 20 | } 21 | else { 22 | fetch(EndPoint, { 23 | method : 'GET', 24 | headers : { 25 | 'authorization' : `${ParamCode}` 26 | } 27 | }).then((Data) => { 28 | return (Data.json()) 29 | }).then((Data) => { 30 | Cookies.set('access_token',Data.token) 31 | setObjectData(Data) 32 | navigate('/Home') 33 | }).catch((Error) => { 34 | // navigate('/') 35 | console.log('Error -> ' , Error) 36 | }) 37 | } 38 | }, []) 39 | 40 | return ( 41 |
42 | 43 |
44 | ) 45 | } 46 | export default Connect 47 | -------------------------------------------------------------------------------- /public/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 12 | 13 | 17 | 18 | 27 | 1337Leets 28 | 29 | 30 | 31 |
32 | 42 | 43 | 44 | -------------------------------------------------------------------------------- /src/About/About.jsx: -------------------------------------------------------------------------------- 1 | import React, {useContext} from "react"; 2 | import { IoIosClose } from "react-icons/io"; 3 | import { context } from "../context"; 4 | 5 | export default function About() { 6 | const {show, setShow} = useContext(context); 7 | return ( 8 |
9 |
10 |
11 |
12 |
(setShow(false))} className="w-[15px] flex items-center justify-center rounded-[50%] h-[15px] ml-3 cursor-pointer bg-red-500"> 13 | 14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 | 27 |
28 |
29 | ); 30 | } -------------------------------------------------------------------------------- /src/Home/Home.jsx: -------------------------------------------------------------------------------- 1 | import React, { useContext } from "react"; 2 | import "./Home.css"; 3 | import Scrool from "../Scrol/Scrol"; 4 | import Starfield from 'react-starfield'; 5 | import { context } from "../context"; 6 | import { useEffect } from "react"; 7 | import { FuncFetch } from "../Func_Help/helper"; 8 | import { useNavigate } from "react-router-dom"; 9 | 10 | export function Home() { 11 | const {StoreExist, setStoreExist} = useContext(context) // Data Stored Here < - Student's Data 12 | const {Connection, setConnection} = useContext(context) // Checking the State of the Loading Rank 13 | const {forloads, setForloads} = useContext(context); 14 | 15 | const {Empty, setEmpty} = useContext(context) 16 | const { campusScope, setCompusScope } = useContext(context) // Local 17 | const {Year, SetYear} = useContext(context) // Year 18 | const {Campus, setCampus} = useContext(context) // Cursus Id 19 | const {Student_State, setState} = useContext(context) // Campus Id 20 | const {Month, setMonth} = useContext(context) // Month 21 | const {LoadMore, SetLoadMore} = useContext(context) 22 | 23 | const navigate = useNavigate() 24 | useEffect(() => { 25 | const Domain = "https://api.1337leets.com/Users" 26 | let Mo 27 | if (Month.length > 1) Mo = Month 28 | else Mo = "0" + Month 29 | if (Connection){ 30 | SetLoadMore(2) 31 | let Obj = { 32 | From : 'Home' , 33 | CampID: Student_State, 34 | Year : Year , 35 | Month : Month , 36 | CurId : campusScope , 37 | Load : 1 38 | } 39 | setTimeout(() => { 40 | FuncFetch(Domain, setStoreExist, StoreExist, Obj, 'Home', navigate, setEmpty, setForloads); 41 | }, 1000); 42 | } 43 | }, [Connection]) 44 | return ( 45 |
46 | 52 | 53 |
54 | ); 55 | } -------------------------------------------------------------------------------- /src/logo.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /src/Peer/Listpeer.jsx: -------------------------------------------------------------------------------- 1 | import React from "react"; 2 | import { useEffect } from "react"; 3 | import { useContext } from "react"; 4 | import { useState } from "react"; 5 | import { context } from "../context"; 6 | import me from "../clips/mmaghri.jpg"; 7 | import { redirect } from "react-router-dom"; 8 | 9 | export default function Listpeer() { 10 | const {peerfinder, setPeerfinder} = useContext(context); 11 | const {peertracker, setPeertracker} = useContext(context); 12 | const {othload, setOthload} = useContext(context); 13 | 14 | const Redirect = (text) => { 15 | window.open(text, "_blank"); 16 | } 17 | return ( 18 |
19 |
20 | { 21 | peerfinder.map((item, index) => ( 22 | item.final_mark == null ? ( 23 | 24 |
(Redirect(`https://profile.intra.42.fr/users/${item.user.login}`))} key={index} className="w-[140px] hover:scale-110 duration-300 cursor-pointer flex items-center justify-center h-[170px] mt-2 flex-col 25 | rounded-[50px] "> 26 |
27 | {othload == false ? ( 28 | 29 | ):( 30 |
31 | ) 32 | } 33 |
34 |
35 |
36 |

{item.user.login}

37 |
38 |
39 |

{item.status}

40 |
41 |
42 |
43 | ):( 44 | <> 45 | ))) 46 | } 47 |
48 |
49 | ); 50 | } -------------------------------------------------------------------------------- /src/context.jsx: -------------------------------------------------------------------------------- 1 | import React, { createContext } from "react"; 2 | import { use } from "react"; 3 | import { useContext } from "react"; 4 | import { useState } from "react"; 5 | const context = createContext(); 6 | 7 | // Bzffff TA3 values Cz Nssiit Chno Knt kandir The half of them 8 | // Mkhdamch bih but i hv No jhd to Clear Thing's hihih 9 | const MycontextProvider = ({children}) => { 10 | const [forloads, setForloads] = useState(false); 11 | const [Empty, setEmpty] = useState(true) 12 | const [LocalCampus, setLocalCampus] = useState(1) // Local Scope For the Search 13 | const [LocalDepa, setLocalDepart] = useState(1) // Local Scope 14 | const [LocalMonth, setLocalmonth] = useState(1) 15 | const [LocalYear, SetYearLocal] = useState(1) 16 | const [LoadMore, SetLoadMore] = useState(1) 17 | const [Month, setMonth] = useState(0) 18 | const [Year, SetYear] = useState(0) 19 | const [Campus, setCampus] = useState('') 20 | const [Student_State, setState] = useState('') 21 | const [Connection, setConnection] = useState(false) 22 | const [GlobalData, setGlobalData] = useState([]) 23 | const [StoreExist, setStoreExist] = useState([]) 24 | const [logs, setLogs] = useState(false) 25 | const [ObjectData, setObjectData] = useState({}) 26 | const [all, setAll] = useState({}) 27 | const [tok, setTok] = useState("") 28 | const [enable, setEnable] = useState(false); 29 | const [pages, setPages] = useState(2); 30 | const [campusId, setCampusId] = useState(""); 31 | const [cursusId, setCursusId] = useState(""); 32 | const [poolYear, setPoolYear] = useState(""); 33 | 34 | 35 | const [loadingstate, setLoadingstate] = useState(false); 36 | const [pol, setPol] = useState(21); 37 | const [prf, setPrf] = useState(""); 38 | const [peerfinder , setPeerfinder] = useState({}); 39 | 40 | const [peertracker, setPeertracker] = useState(false); 41 | const [othload, setOthload] = useState(false); 42 | const [username, seTusername] = useState(""); 43 | const [iftr, setIftr] = useState(false); 44 | const [campusScope, setCompusScope] = useState(0) 45 | 46 | return ( 47 | 55 | {children} 56 | 57 | ); 58 | }; 59 | export {context, MycontextProvider}; -------------------------------------------------------------------------------- /src/Game/Game.jsx: -------------------------------------------------------------------------------- 1 | import React from "react"; 2 | import { useState } from "react"; 3 | import "../Scrol/Scrol.css"; 4 | import Starfield from 'react-starfield'; 5 | import { Nav } from "../Nav/Nav"; 6 | import pic from "../clips/mmaghri.jpg"; 7 | import cat from "../clips/kta.png"; 8 | import keys from "../clips/game.png"; 9 | import click from "../clips/cli.png"; 10 | import { useContext } from "react"; 11 | import { context } from "../context"; 12 | import { useNavigate } from "react-router-dom"; 13 | import Cookies from "js-cookie"; 14 | 15 | export function Game() { 16 | 17 | const [game, setGame] = useState(false); 18 | const {logs, setLogs} = useContext(context); 19 | const studetns = [{pic : cat }]; 20 | const navigate = useNavigate(); 21 | if (Cookies.get('log') == undefined || Cookies.get('log') != "1337") { 22 | navigate("/"); 23 | } 24 | return ( 25 |
26 | 32 |
33 |
34 |

The Game Only playable On Big screens

35 |
36 |
37 | 41 |
42 |
43 | {game && 44 | keys 45 | } 46 |
47 |
48 |

Game Created By :

49 |
50 |
51 | (window.open("https://profile.intra.42.fr/users/mait-elk" ,"_blank"))} src="https://cdn.intra.42.fr/users/c805a96c4a7949026580c4796c19a1a9/mait-elk.jpg" alt="pic" className="w-[100%] h-[100%] rounded-[50%]" /> 52 |
53 |
54 |
55 |
56 |
57 |
58 |
59 | ); 60 | }; -------------------------------------------------------------------------------- /src/AiModel/Model.jsx: -------------------------------------------------------------------------------- 1 | import React, { useEffect } from "react"; 2 | import "../Scrol/Scrol.css"; 3 | import Starfield from 'react-starfield'; 4 | import { useState } from "react"; 5 | import { IoSend } from "react-icons/io5"; 6 | import { json } from "react-router-dom"; 7 | import { useNavigate } from "react-router-dom"; 8 | import Cookies from "js-cookie"; 9 | 10 | export function Model() { 11 | const [setthis, setThis] = useState(""); 12 | const [model, setModel] = useState([]); 13 | const [fill , setFill] = useState(""); 14 | const [respond, setRespond] = useState([]); 15 | const [flg, setFlg] = useState(false); 16 | const [value, setValue] = useState(1); 17 | const [old, setOld] = useState(0); 18 | const [seeen , setSeen] = useState(false); 19 | const [api, setApi] = useState("https://generativelanguage.googleapis.com/v1beta/models/gemini-1.5-flash-latest:generateContent?key=AIzaSyDj3X9KrzfNFv_Yd-UvTtLeFMlMB_Jbwec"); 20 | 21 | const navigate = useNavigate(); 22 | if (Cookies.get('log') == undefined) { 23 | navigate("/");} 24 | 25 | const addAns = (te) => { 26 | const tdel = { 27 | id: Date.now(), 28 | Ai : te 29 | }; 30 | setModel([...model, tdel]); 31 | } 32 | const fetchModel = async (api) => { 33 | await fetch(api, { 34 | method: 'POST', 35 | headers: { 36 | 'Content-Type': 'application/json', 37 | }, 38 | body: JSON.stringify({"contents":[ 39 | { 40 | "role": "user", 41 | "parts":[{"text": fill}] 42 | }] 43 | })}) 44 | .then(response => response.json()).then(data => {setSeen(false); addAns(data.candidates[0].content.parts[0].text)}).catch((err) => {console.log(err);}); 45 | } 46 | 47 | useEffect(() => { 48 | if (value > old) 49 | fetchModel(api); 50 | setOld(value); 51 | }, [value]) 52 | 53 | const functionAddmodel = (th) => { 54 | setThis(""); 55 | setSeen(true); 56 | const newModl = { 57 | id: Date.now(), 58 | text: th 59 | }; 60 | setModel([...model, newModl]); 61 | setTimeout(() => { 62 | setValue((prev) => prev + 1); 63 | }, 1000); 64 | } 65 | const fillInput = (e) => { 66 | setThis(e.target.value); 67 | setFill(e.target.value); 68 | } 69 | const onKey = (e) => { 70 | if (e.key === "Enter") 71 | functionAddmodel(fill); 72 | } 73 | return ( 74 |
75 | 81 |
82 |
83 | { 84 | model.map((item, index) => ( 85 | <> 86 | {item.text && 87 |
88 |
89 |
{item.text}
90 |
91 |
92 | } 93 | {item.Ai && 94 |
95 |
96 |
{item.Ai}
97 |
98 |
99 | } 100 | 101 | )) 102 | } 103 |
104 | { 105 | seeen && 106 |
107 | 108 |
109 | } 110 |
111 | (onKey(e))} onChange={(e) => (fillInput(e))} value={setthis} type="text" placeholder="Type here" className="input w-[100%] bg-slate-900 placeholder-white text-white input-bordered " /> 112 |
113 | (functionAddmodel(fill))} className="w-[40px] cursor-pointer duration-200 text-white hover:scale-105 h-[40px]" /> 114 |
115 |
116 |
117 | ); 118 | } -------------------------------------------------------------------------------- /src/Sheets/Sheets.jsx: -------------------------------------------------------------------------------- 1 | import React, { Component, useState } from 'react'; 2 | import './sheets.css' 3 | import { Nav } from '../Nav/Nav' 4 | import { BsFileEarmarkCodeFill } from "react-icons/bs"; 5 | import aprov from "../clips/approuve.png" 6 | import { MdArrowOutward } from "react-icons/md"; 7 | import { Submit_Flags }from './SheetsComp' 8 | import {Submit_Corection} from './SheetsComp' 9 | import { LiaPasteSolid } from "react-icons/lia"; 10 | import { List_comp } from './SheetsComp'; 11 | 12 | export function Sheets() { 13 | const [clicked , setClicked] = useState(false); 14 | const [subjects, setSubject] = useState([{name : "ft_irc", date : "15-01-2025"},{name : "webserve", date : "15-01-2025"} ,{name : "ft_trencendese", date : "15-01-2025"} 15 | ,{name : "ft_irc", date : "15-01-2025"}]); 16 | const [ObjectComp, setObjComp] = useState([{component : }, {component : }, {component : }, {component : }, {component : },{component : }, {component : }]); 17 | return ( 18 |
19 | {clicked && 20 |
21 |
22 |
23 |
24 |

SCALE FOR PROJECT

25 |

FT_TRANSCENDENCE

26 |
27 |
28 |

You should evaluate 5 students in this team

29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 | 38 |
39 | 40 |
41 |
42 |
43 | 44 |
45 |
46 | } 47 | {!clicked && 48 |
49 | {subjects.map((item, index) => ( 50 |
51 |
52 |
53 | 54 |
55 |
56 |

{item.name}

57 |
58 |
59 | 60 |
61 |
62 |
63 |
64 |

{item.date}

65 |
66 |
{setClicked(true)}} className='flex items-center hover:scale-110 cursor-pointer duration-150 border-solid border-green-600 border-[3px] justify-center w-[40px] h-[40px] rounded-full mr-2 bg-green-500'> 67 | 68 |
69 |
70 |
71 | ))} 72 | 73 |
74 | } 75 |
76 | ); 77 | } -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Getting Started with Create React App 2 | 3 | This project was bootstrapped with [Create React App](https://github.com/facebook/create-react-app). 4 | 5 | ## Available Scripts 6 | 7 | In the project directory, you can run: 8 | 9 | ### `npm start` 10 | 11 | Runs the app in the development mode.\ 12 | Open [http://localhost:3000](http://localhost:3000) to view it in your browser. 13 | 14 | The page will reload when you make changes.\ 15 | You may also see any lint errors in the console. 16 | 17 | ### `npm test` 18 | 19 | Launches the test runner in the interactive watch mode.\ 20 | See the section about [running tests](https://facebook.github.io/create-react-app/docs/running-tests) for more information. 21 | 22 | ### `npm run build` 23 | 24 | Builds the app for production to the `build` folder.\ 25 | It correctly bundles React in production mode and optimizes the build for the best performance. 26 | 27 | The build is minified and the filenames include the hashes.\ 28 | Your app is ready to be deployed! 29 | 30 | See the section about [deployment](https://facebook.github.io/create-react-app/docs/deployment) for more information. 31 | 32 | ### `npm run eject` 33 | 34 | **Note: this is a one-way operation. Once you `eject`, you can't go back!** 35 | 36 | If you aren't satisfied with the build tool and configuration choices, you can `eject` at any time. This command will remove the single build dependency from your project. 37 | 38 | Instead, it will copy all the configuration files and the transitive dependencies (webpack, Babel, ESLint, etc) right into your project so you have full control over them. All of the commands except `eject` will still work, but they will point to the copied scripts so you can tweak them. At this point you're on your own. 39 | 40 | You don't have to ever use `eject`. The curated feature set is suitable for small and middle deployments, and you shouldn't feel obligated to use this feature. However we understand that this tool wouldn't be useful if you couldn't customize it when you are ready for it. 41 | 42 | ## Learn More 43 | 44 | You can learn more in the [Create React App documentation](https://facebook.github.io/create-react-app/docs/getting-started). 45 | 46 | To learn React, check out the [React documentation](https://reactjs.org/). 47 | 48 | ### Code Splitting 49 | 50 | This section has moved here: [https://facebook.github.io/create-react-app/docs/code-splitting](https://facebook.github.io/create-react-app/docs/code-splitting) 51 | 52 | ### Analyzing the Bundle Size 53 | 54 | This section has moved here: [https://facebook.github.io/create-react-app/docs/analyzing-the-bundle-size](https://facebook.github.io/create-react-app/docs/analyzing-the-bundle-size) 55 | 56 | ### Making a Progressive Web App 57 | 58 | This section has moved here: [https://facebook.github.io/create-react-app/docs/making-a-progressive-web-app](https://facebook.github.io/create-react-app/docs/making-a-progressive-web-app) 59 | 60 | ### Advanced Configuration 61 | 62 | This section has moved here: [https://facebook.github.io/create-react-app/docs/advanced-configuration](https://facebook.github.io/create-react-app/docs/advanced-configuration) 63 | 64 | ### Deployment 65 | 66 | This section has moved here: [https://facebook.github.io/create-react-app/docs/deployment](https://facebook.github.io/create-react-app/docs/deployment) 67 | 68 | ### `npm run build` fails to minify 69 | 70 | ### Ranking Board For All Student's 71 | 72 | Screen Shot 2024-08-11 at 4 10 42 PM 73 | Screen Shot 2024-08-14 at 6 37 47 PM 74 | Screen Shot 2024-08-14 at 6 37 50 PM 75 | Screen Shot 2024-08-14 at 6 38 07 PM 76 | Screen Shot 2024-08-14 at 6 38 18 PM 77 | Screen Shot 2024-08-14 at 6 38 22 PM 78 | 79 | 80 | 81 | This section has moved here: [https://facebook.github.io/create-react-app/docs/troubleshooting#npm-run-build-fails-to-minify](https://facebook.github.io/create-react-app/docs/troubleshooting#npm-run-build-fails-to-minify) 82 | 83 | ### Xp-Level Calculator For The School Project's Let u know what Ur xp Will be 84 | Screen Shot 2024-08-14 at 6 34 11 PM 85 | 86 | ### Ai Same As Gpt U can ask Him what Ever on ur mind 87 | Screen Shot 2024-08-14 at 6 34 18 PM 88 | Screen Shot 2024-08-14 at 6 41 36 PM 89 | Screen Shot 2024-08-14 at 6 42 18 PM 90 | 91 | ###Peer Finder 92 | Screen Shot 2024-08-18 at 1 27 00 PM 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | 105 | -------------------------------------------------------------------------------- /src/Sheets/SheetsComp.jsx: -------------------------------------------------------------------------------- 1 | import React, { useState } from 'react'; 2 | import { MdArrowOutward } from "react-icons/md"; 3 | import { LiaCheckCircleSolid } from "react-icons/lia"; 4 | import { RxCross1 } from "react-icons/rx"; 5 | import { IoCheckmarkOutline } from "react-icons/io5"; 6 | import { RiStarFill } from "react-icons/ri"; 7 | import { FaExplosion } from "react-icons/fa6"; 8 | import { FaFileExcel } from "react-icons/fa"; 9 | import { GiWalrusHead } from "react-icons/gi"; 10 | import aprov from "../clips/approuve.png" 11 | import { FaRegFileLines } from "react-icons/fa6"; 12 | import { BsFileEarmarkCodeFill } from "react-icons/bs"; 13 | import { VscVerifiedFilled } from "react-icons/vsc"; 14 | import './sheets.css' 15 | 16 | export const List_comp = ({comp}) => { 17 | return ( 18 |
19 | { 20 | comp.map((item , index) => ( 21 | <>{item.component} 22 | )) 23 | } 24 |
25 | ) 26 | }; 27 | 28 | export function Submit_Corection() { 29 | const [clickIthem, setClickIthem] = useState(''); 30 | return ( 31 |
32 |
{setClickIthem('green')}} className={`flex items-center gap-1 rounded-sm justify-center duration-200 w-[45%] h-[45px] ${clickIthem === 'green' ? 'bg-green-400' : 'bg-green-100' } cursor-pointer`}> 33 | 34 |

Yes

35 |
36 |
{setClickIthem('red')}} className={`flex gap-1 items-center rounded-sm cursor-pointer duration-300 justify-center ${clickIthem === 'red' ? 'bg-red-500' : 'bg-red-100' } w-[45%] h-[45px]`}> 37 | 38 |

No

39 |
40 |
41 | ); 42 | } 43 | export function Submit_Flags() { 44 | const [check, setCheck] = useState('ok'); 45 | const [flags, setFlags] = useState([{name : 'Empty Work', icons : '', size : 210} , 46 | {name : 'Incomplete Work', icons : , size : 210}, 47 | {name : 'Invalid Compilation', icons : , size : 210}, 48 | {name : 'Cheat', icons : , size : 210}, 49 | {name : 'Crash', icons : , size : 210}, 50 | {name : "Can't Explain ", icons : , size : 210}, 51 | {name : 'Leacks', icons : , size : 210}, 52 | {name : 'Forbiden Function', icons : , size : 210},]); 53 | const [clickedColor, setClickedColor] = useState(-1); 54 | const [clicked, setClicked] = useState(false); 55 | return ( 56 |
57 |
58 |

Ratings

59 |
60 |
61 |

Don’t forget to check the flag corresponding to the defense

62 |
63 |
64 |
{setCheck("ok"); setClicked(false)}} className={`min-w-[80px] rounded-md cursor-pointer duration-300 flex items-center gap-1 justify-center ${check === 'ok' ? 'bg-green-500' : 'bg-green-100'} w-[40%] h-full`}> 65 | 66 |

Ok

67 |
68 |
{setCheck("Outstanding"); setClicked(false)}} className={`cursor-pointer duration-300 flex rounded-md items-center gap-1 justify-center ${check === 'Outstanding' ? 'bg-green-500' : 'bg-green-100'} min-w-[140px] w-[60%] h-full`}> 69 | 70 |

Outstanding

71 |
72 |
73 |
74 | {flags.map((item, index) => ( 75 | <> 76 |
(console.log(index),setCheck("") , setClicked(true), setClickedColor(index))} key={index} className={`${clicked && clickedColor === index ? 'bg-red-500' : 'bg-red-100'} ${clicked && clickedColor != index ? 'bg-gray-100':''} flex cursor-pointer duration-150 gap-1 max-w-[${item.size}px] items-center justify-center mb-1 ml-1 min-w-[120px] rounded-md h-[40px]`}> 77 | <>{item.icons} 78 |

{item.name}

79 |
80 | 81 | ))} 82 |
83 |
84 | 85 |
86 |
87 |

Finish Evaluation

88 |
89 |
90 | ); 91 | }; -------------------------------------------------------------------------------- /src/Auth/Auth.jsx: -------------------------------------------------------------------------------- 1 | import React , {useContext, useEffect, useState} from "react"; 2 | import { useNavigate } from "react-router"; 3 | import Starfield from 'react-starfield'; 4 | import me from "../clips/this.png" 5 | import lou from "../clips/loua.png" 6 | import Cookies from "js-cookie"; 7 | import { context } from "../context"; 8 | import { BsFillLightningFill } from "react-icons/bs"; 9 | import meme from "../clips/memem.jpeg"; 10 | import { VscGithubAlt } from "react-icons/vsc"; 11 | import kta from "../clips/cat.png" 12 | import { RxCross2 } from "react-icons/rx"; 13 | import { PiWarningOctagonLight } from "react-icons/pi"; 14 | import { ImCross } from "react-icons/im"; 15 | 16 | export default function Auth() { 17 | const navigate = useNavigate(); 18 | const {enable, setEnable} = useContext(context); 19 | const token = "https://api.intra.42.fr/oauth/authorize?client_id=u-s4t2ud-7852f6f9f2cd7e73e66c2e2a940ab893f431f0e3fc6244a8cdde3f773a592bc8&redirect_uri=https%3A%2F%2Foldleets.vercel.app%2FConnect&response_type=code"; 20 | const functionNavigate = (path) => { 21 | window.open(path, '_blank'); 22 | } 23 | const cally = (thepath) => { 24 | setTimeout(() => { 25 | window.location.href = thepath; 26 | }, 1000); 27 | } 28 | localStorage.setItem('pics', meme); 29 | const [button_Deselect, set_ButtonDeselect] = useState(true); 30 | useEffect(() => { 31 | if (Cookies.get('access_token') != null && Cookies.get('access_token') != undefined) 32 | navigate('/Home') 33 | console.log(' ===== === < ' , Cookies.get('close')) 34 | if (Cookies.get('close') === "false") 35 | { 36 | console.log("rest"); 37 | set_ButtonDeselect(false) 38 | } 39 | }, []) 40 | return ( 41 | <> 42 | { 43 | button_Deselect && 44 |
45 |
46 |
47 |
(set_ButtonDeselect(false) , Cookies.set('close', false))} className=" cursor-pointer hover:scale-105 duration-150 h-[25px] flex items-center justify-center ml-2 w-[25px] rounded-full bg-red-600"> 48 | 49 |
50 |
51 |
52 |

Do You Find 1337Leets Useful ?

53 |

Give the Project A star 🌟

54 |

And Drop a Follow On Github 🌝

55 |

If u want No (one Will Force U)

56 |

Click The Button Above To cancel

57 |
58 |
59 |
60 | 61 |
62 |
63 |
64 |
(functionNavigate('https://github.com/Mohammed-Maghri'))} className="flex hover:scale-105 items-center bg-yellow-400 bg-opacity-25 duration-200 cursor-pointer justify-center w-[40%] h-[50%] rounded-lg border-solid border-[1px] border-yellow-500"> 65 |

Follow ❤️

66 |
67 |
(functionNavigate('https://github.com/Mohammed-Maghri/Rank'))} className="flex hover:scale-105 items-center bg-yellow-400 bg-opacity-25 duration-200 cursor-pointer justify-center w-[40%] h-[50%] rounded-lg border-solid border-[1px] border-yellow-500"> 68 |

Drop a star 🌟

69 |
70 |
71 |
72 |
73 | } 74 |
75 | 81 |
82 |
83 |
84 |

1337Leets

85 |
86 |
87 |
88 | {/*
89 | 90 |

site on maintenance

91 |

Try Later

92 |
*/} 93 |
(cally(token))} className=" cursor-pointer w-[225px] flex items-center 94 | justify-center h-[60px] border-solid rounded-md border-yellow-500 border-[2px] border-opacity-80 duration-300 hover:bg-yellow-500 hover:bg-opacity-20 hover:scale-105"> 95 |
96 |

Login

97 |
98 |
99 |
100 |
101 |

By : mmaghri

102 |
103 |
104 | 105 | ); 106 | } 107 | -------------------------------------------------------------------------------- /src/Peer/Peer.jsx: -------------------------------------------------------------------------------- 1 | import react from 'react'; 2 | import { useEffect } from "react"; 3 | import Cookies from "js-cookie"; 4 | import "../Scrol/Scrol" 5 | import { Nav } from '../Nav/Nav'; 6 | import { useContext } from 'react'; 7 | import { context } from '../context'; 8 | import Starfield from 'react-starfield'; 9 | import { useState } from 'react'; 10 | import Listpeer from "./Listpeer"; 11 | import { useNavigate } from 'react-router-dom'; 12 | import { IoConstructOutline } from "react-icons/io5"; 13 | 14 | const FunctionDiv = () => { 15 | const {StoreExist, setStoreExist} = useContext(context) 16 | const {peerfinder, setPeerfinder} = useContext(context); 17 | const [projectName, setProjectName] = useState("Enter Project Name ? "); 18 | const [list, setList] = useState([]); 19 | const [event, setEvent] = useState(""); 20 | const [seem , setSeem] = useState(false); 21 | const {peertracker, setPeertracker} = useContext(context); 22 | const {othload, setOthload} = useContext(context); 23 | const [iftr, setIftr] = useState(false); 24 | 25 | const [value , setValue] = useState(""); 26 | const [id, setId] = useState(""); 27 | const {forloads, setForloads} = useContext(context); 28 | const {Empty, setEmpty} = useContext(context) 29 | 30 | 31 | const functionCallApi = async (theid) => { 32 | try { 33 | const res = await fetch(`https://api.1337leets.com/api/v1/peer-finder?campusId=${Cookies.get('campusId')}&projectId=${theid}`,{ 34 | method: 'GET', 35 | headers: { 36 | 'Content-Type': 'application/json', 37 | 'Authorization': `Bearer ${Cookies.get('access_token')}` 38 | } 39 | }); 40 | await res.json().then((data) => { 41 | setPeerfinder(data); 42 | setIftr(true); 43 | setPeertracker(true); 44 | setOthload(false); 45 | }) 46 | } 47 | catch (error) { 48 | console.log("Error", error); 49 | } 50 | } 51 | const eventFunction = (e) => { 52 | setEvent(e.target.value); 53 | setProjectName(e.target.value); 54 | } 55 | const functionFetchjson = async (text) => { 56 | try { 57 | const res = await fetch("/Project_lvl.json"); 58 | const data = await res.json(); 59 | setList(data); 60 | } 61 | catch (error) { 62 | console.log("Error", error); 63 | } 64 | } 65 | useEffect(() => { 66 | setEmpty(true) 67 | setForloads(false) 68 | setStoreExist([]) 69 | functionFetchjson("ft_transcendence"); 70 | }, []) 71 | const printArg = (ind) => { 72 | 73 | list.forEach((item, index) => { 74 | if (item.name === ind) { 75 | functionCallApi(item.project_id); 76 | } 77 | }) 78 | } 79 | return ( 80 | 81 |
82 |
83 | (setSeem(true), setProjectName(""))} onChange={(e) => eventFunction(e)} type="text" value={projectName} className="outline-none w-[100%] 84 | bg-transparent border-solid border-[1px] border-yellow-200 placeholder-white text-xs font-bars2 h-[80%] pl-2 rounded-[5px] text-white" /> 85 |
86 | {seem && 87 |
88 | {list.filter((item) => { 89 | const lower = item.name.toLowerCase(); 90 | const filter = event.toLowerCase(); 91 | 92 | return (lower && lower.startsWith(filter)); 93 | }).map((item, index) => ( 94 |
(setSeem(false), printArg(item.name), setOthload(true) ,setProjectName(item.name))} className="w-[100%] cursor-pointer h-[40px] pt-3 pb-3 text-white bg-slate-900 rounded-[10px] flex items-center justify-center text-xs font-bars2">

95 | {item.name}

96 | )) 97 | } 98 |
99 | } 100 |
101 |
102 |
103 | ); 104 | } 105 | 106 | 107 | export function Peer() { 108 | const navigate = useNavigate(); 109 | const {peerfinder, setPeerfinder} = useContext(context); 110 | const {peertracker, setPeertracker} = useContext(context); 111 | const {othload, setOthload} = useContext(context); 112 | const [iftr, setIftr] = useState(false); 113 | const {StoreExist, setStoreExist} = useContext(context) 114 | 115 | const {forloads, setForloads} = useContext(context); 116 | const {Empty, setEmpty} = useContext(context) 117 | 118 | useEffect(() => { 119 | setEmpty(true) 120 | setForloads(false) 121 | setStoreExist([]) 122 | }, []) 123 | return ( 124 |
125 |
126 | 127 |
128 |
129 |

Under construction

130 |
131 | {/* 132 | 138 |
139 | 140 |
141 |
142 | {peertracker && 143 | 144 | } 145 | { 146 | !peertracker && !othload && 147 |
148 | 149 |

To comply with the 42 API's data caching rules, we need to

150 |

minimize the number of API requests as much as possible.

151 |

So Please Search For the Project to Get Data

152 | 153 |
154 | } 155 | { 156 | !iftr && othload && 157 |
158 | 159 |
160 | } 161 |
*/} 162 |
163 | ); 164 | } -------------------------------------------------------------------------------- /src/Selector/Slector.jsx: -------------------------------------------------------------------------------- 1 | import React, { useContext, useState } from "react"; 2 | import "./Sekector.css"; 3 | import { IoSettings } from "react-icons/io5"; 4 | import pic from "../clips/mmaghri.jpg"; 5 | import { IoMdLogOut } from "react-icons/io"; 6 | import {functionVisible, Nav} from "../Nav/Nav"; 7 | import { FaChevronDown, FaChevronLeft, FaChevronRight, FaSearch, FaLeaf } from "react-icons/fa"; 8 | import { context } from "../context"; 9 | import Cookies from "js-cookie"; 10 | 11 | export function Selector() { 12 | const [visible, setVisible] = useState(false); 13 | const [visible2, setVisible2] = useState(false); 14 | const [value, setValue] = useState(false); 15 | const { pol, setPol } = useContext(context); 16 | const [addyear, setAddyear] = useState(2023); 17 | const [campus, setCampus] = useState(Cookies.get('campusId')); 18 | const [month, setMoth] = useState(1); 19 | const { pages, setPages } = useContext(context); 20 | const { loadingstate, setLoadingstate } = useContext(context); 21 | const [changed, setChange] = useState("Cursus"); 22 | const [camp, setCamp] = useState("Campus"); 23 | const { all, setAll } = useContext(context); 24 | const [onlyprom, setOnlyprom] = useState("Promo"); 25 | const [logs, setLogs] = useState(false); 26 | 27 | const object = [{promo: 2018}, {promo: 2019}, {promo: 2020}, {promo: 2021}, {promo: 2022}, {promo: 2023}, {promo: 2024}]; 28 | 29 | // { name: "Khouribga", id: 16 }, 30 | // { name: "Bengrir", id: 21 }, 31 | // { name: "Tetouan", id: 55 }, 32 | // { name: "Rabat", id: 75 } 33 | return ( 34 |
35 | 36 |
37 | ); 38 | } 39 | //
40 | //
41 | //
42 | // 49 | 50 | // {visible && ( 51 | //
52 | // {[ 53 | // { name: "Khouribga", id: 16 }, 54 | // { name: "Bengrir", id: 21 }, 55 | // { name: "Tetouan", id: 55 }, 56 | // { name: "Rabat", id: 75 } 57 | // ].map((item) => ( 58 | // 69 | // ))} 70 | //
71 | // )} 72 | //
73 | 74 | //
75 | // 82 | 83 | // {value && ( 84 | //
85 | //
86 | //
87 | // 90 | // {addyear} 91 | // 94 | //
95 | 96 | // {pol !== 21 && ( 97 | //
98 | // 101 | // Month: {month} 102 | // 105 | //
106 | // )} 107 | //
108 | //
109 | // )} 110 | //
111 | 112 | //
113 | // 120 | 121 | // {visible2 && ( 122 | //
123 | // 134 | // 145 | //
146 | // )} 147 | //
148 | 149 | // 160 | //
161 | //
-------------------------------------------------------------------------------- /src/Dropdown/Dropdown.jsx: -------------------------------------------------------------------------------- 1 | import React, { useContext, useEffect, useRef } from "react"; 2 | import { useState } from "react"; 3 | import { context } from "../context"; 4 | import Cookies from "js-cookie"; 5 | import { RiArrowDropDownFill } from "react-icons/ri"; 6 | import { TbWorldSearch } from "react-icons/tb"; 7 | import "../Nav/Nav.css"; 8 | import { functionVisible } from "../Nav/Nav"; 9 | import { GrDocumentOutlook } from "react-icons/gr"; 10 | import { CiCircleMinus } from "react-icons/ci"; 11 | import { CiCirclePlus } from "react-icons/ci"; 12 | import { use } from "react"; 13 | import { FuncFetch } from "../Func_Help/helper"; 14 | import { useNavigate } from "react-router-dom"; 15 | 16 | const CampusButton = ({ setCampus }) => { 17 | const [Cliked, SetClicked] = useState(false) 18 | const [Camp, setCam] = useState("Campus") 19 | const Ref = useRef(null) 20 | 21 | const [Campuses, setCampuses] = useState([ 22 | 23 | { name: "Khouribga", id: 16 }, 24 | { name: "Bengrir", id: 21 }, 25 | { name: "Tetouan", id: 55 }, 26 | { name: "Rabat", id: 75 }, 27 | {name : "Paris" , id : 1}, 28 | {name : "Lyon" , id : 9} , 29 | {name : "Barcelona" , id : 46}, 30 | {name : "Mulhouse" , id : 48}, 31 | {name : "Lausanne" , id : 47}, 32 | {name : "Istanbul" , id : 49}, 33 | {name : "Berlin" , id : 51}, 34 | {name : "Florence" , id : 52}, 35 | {name : "Vienna" , id : 53}, 36 | {name : "Prague" , id : 56}, 37 | {name : "London" , id : 57}, 38 | {name : "Porto" , id : 58}, 39 | {name : "Luxembourg" , id : 59}, 40 | {name : "Perpignan" , id : 60}, 41 | {name : "Tokyo" , id : 26}, 42 | {name : "Moscow" , id : 17}, 43 | {name : "Madrid" , id : 22}, 44 | {name : "Seoul" , id : 29}, 45 | {name : "Rome" , id : 30}, 46 | {name : "Bangkok" , id : 33}, 47 | {name : "Amman" , id : 35}, 48 | {name : "Malaga" , id : 37}, 49 | {name : "Nice" , id : 41}, 50 | {name : "Abu Dhabi" , id : 43}, 51 | {name : "Wolfsburg" , id : 44}, 52 | 53 | ]) 54 | 55 | const FunctionCheck = (event) => { 56 | if (Ref) { 57 | if (Ref.current && !Ref.current.contains(event.target)) 58 | SetClicked(false) 59 | } 60 | } 61 | useEffect(() => { 62 | document.addEventListener('mousedown', (event) => FunctionCheck(event)) 63 | return () => { 64 | document.removeEventListener('mousedown', FunctionCheck); 65 | }; 66 | }, []) 67 | 68 | return ( 69 |
SetClicked(!Cliked)} className={` cursor-pointer hover:bg-opacity-10 flex items-center justify-center w-[220px] h-full ${!Cliked ? "hover:bg-yellow-600 hover:bg-opacity-10 border-solid border-opacity-25 border-[1px] border-yellow-500" : ""} rounded-md`}> 70 | {/*
*/} 71 |

{Camp}

72 | 73 | {Cliked && 74 |
75 | {Campuses.map((item, index) => ( 76 |
(setCampus(item.id), setCam(item.name))} key={index} className="flex items-center justify-center w-[90%] h-[25px] m-2 bg-slate-950 hover:bg-slate-900"> 77 |

{item.name}

78 |
79 | )) 80 | } 81 |
82 | } 83 |
84 | ) 85 | } 86 | const CursusButton = ({ Cursus, Number, SetNumber }) => { 87 | const Ref = useRef(null) 88 | const [Cliked, SetClicked] = useState(false) 89 | const [Max, setMax] = useState(12) 90 | const [Min, SetMin] = useState(1) 91 | 92 | useEffect(() => { 93 | if (Cursus === 'Mo') { 94 | setMax(12) 95 | SetMin(1) 96 | SetNumber(8) 97 | } 98 | else { 99 | setMax(2025) 100 | SetMin(2019) 101 | SetNumber(2024) 102 | } 103 | }, [Cursus]) 104 | 105 | const AddPlusFunction = (AD) => { 106 | if (AD === 1) 107 | if (Number > Min) SetNumber((Number) => Number - 1) 108 | if (AD === 2) 109 | if (Number < Max) SetNumber((Number) => Number + 1) 110 | } 111 | 112 | const ClickedInside = (event) => { 113 | if (Ref.current && !Ref.current.contains(event.target)) 114 | SetClicked(false) 115 | } 116 | useEffect(() => { 117 | document.addEventListener('mousedown', (event) => (ClickedInside(event))) 118 | }, []) 119 | 120 | return ( 121 |
122 | {/*
*/} 123 |
(SetClicked(!Cliked))} className="w-full h-[40px] flex items-center justify-center flex-row "> 124 |

{Cursus + ' ' + Number}

125 | 126 |
127 | <> 128 | {Cliked && 129 |
130 |
(AddPlusFunction(1))} className="w-[20%] hover:scale-110 duration-200 rounded-md flex items-center justify-center h-full"> 131 | 132 |
133 |
134 |

{Number}

135 |
136 |
(AddPlusFunction(2))} className="w-[20%] hover:scale-110 duration-200 rounded-md flex items-center justify-center h-full"> 137 | 138 |
139 |
140 | } 141 | 142 |
143 | ) 144 | } 145 | 146 | const PromoButton = ({Camp, CampusSeter}) => { 147 | const Ref = useRef(null) 148 | const [Cliked, SetClicked] = useState(false) 149 | 150 | const [Curs, seTcurs] = useState([ 151 | { Curs: 'Pool', id: 9 }, 152 | { Curs: 'Cursus', id: 21 }]) 153 | 154 | const checkClick = (event) => { 155 | if (Ref.current && !Ref.current.contains(event.target)) 156 | SetClicked(false) 157 | } 158 | useEffect(() => { 159 | document.addEventListener('mousedown', (event) => (checkClick(event))) 160 | }, []) 161 | 162 | return ( 163 |
(SetClicked(!Cliked))} className={` cursor-pointer hover:bg-opacity-10 flex items-center justify-center w-[220px] h-full ${!Cliked ? "hover:bg-yellow-600 hover:bg-opacity-10 border-solid border-opacity-25 border-[1px] border-yellow-500" : ""} rounded-md`}> 164 | {(Camp == 21) ? 165 |

Cursus

: 166 |

Pool

167 | } 168 | 169 | {Cliked && 170 |
171 | {Curs.map((item, index) => ( 172 |
(CampusSeter(item.id))} key={index} className="w-[90%] m-2 hover:bg-slate-900 flex items-center justify-center h-[25px]"> 173 |

{item.Curs}

174 |
175 | )) 176 | } 177 |
178 | } 179 |
180 | ) 181 | } 182 | 183 | const DropDowns = () => { 184 | 185 | 186 | //--------------- 187 | 188 | 189 | const { Year, SetYear } = useContext(context) // Year 190 | const { Student_State, setState } = useContext(context) // Campus Id 191 | const { campusScope, setCompusScope } = useContext(context) 192 | const { Month, setMonth } = useContext(context) // Month 193 | 194 | const {Empty, setEmpty} = useContext(context) 195 | const { LoadMore, SetLoadMore } = useContext(context) // lOAD 196 | const { StoreExist, setStoreExist } = useContext(context) 197 | const { forloads, setForloads } = useContext(context) 198 | //--------------- 199 | 200 | const [CursId, SetCursID] = useState('Cursus') 201 | const [MonthScope, SetMonthScope] = useState(8) 202 | 203 | const {LocalCampus, setLocalCampus} = useContext(context) // Local Scope Id Cur 204 | const {LocalDepa, setLocalDepart} = useContext(context) // Local Scope Id Camp 205 | const {LocalMonth, setLocalmonth} = useContext(context) // Local Scope Month 206 | const {LocalYear, SetYearLocal} = useContext(context) 207 | const navigate = useNavigate() 208 | const ReqMore = () => { 209 | 210 | setState(LocalCampus) // local Scope Id Setter 211 | setCompusScope(LocalDepa) 212 | SetYear(LocalYear) // Year Set Local 213 | setMonth(LocalMonth) // Setting the Month When Submitiing 214 | 215 | SetLoadMore(2) // Setting the page To 2 To Req A new One ! 216 | 217 | if (forloads) { 218 | let ObjectSend = { 219 | CampID: LocalCampus, 220 | CurId: LocalDepa, 221 | Year: LocalYear, 222 | Month : LocalMonth, 223 | Load : 1 224 | } 225 | 226 | setEmpty(true) 227 | setForloads(false) 228 | setStoreExist([]) 229 | FuncFetch("https://api.1337leets.com/Users", setStoreExist, [], ObjectSend, 'DropDown', navigate , setEmpty, setForloads); 230 | } 231 | } 232 | return ( 233 |
234 |
235 |
236 | 237 | 238 | 239 | {LocalDepa === 9 && 240 | 241 | } 242 | 243 |
(ReqMore())} className="w-[40px] cursor-pointer border-opacity-60 items-center justify-center flex min-w-[40px] h-[40px] border-yellow-600 rounded-full border-solid border-[1px]"> 244 | 245 |
246 |
247 |
248 |
249 | ) 250 | } 251 | 252 | export { DropDowns } -------------------------------------------------------------------------------- /src/Calculator/Calculator.jsx: -------------------------------------------------------------------------------- 1 | import React from "react"; 2 | import { useState } from "react"; 3 | import "../Scrol/Scrol.css"; 4 | import { Nav } from "../Nav/Nav"; 5 | import Starfield from 'react-starfield'; 6 | import { useEffect } from "react"; 7 | import Loads from "../Loader/Loader"; 8 | import { BsFillLightningFill } from "react-icons/bs"; 9 | import { IoMdAddCircle } from "react-icons/io"; 10 | import { useContext } from "react"; 11 | import { context } from "../context"; 12 | import { useNavigate } from "react-router-dom"; 13 | import Cookies from "js-cookie"; 14 | import { ImCross } from "react-icons/im"; 15 | 16 | export function Calculator() { 17 | const {StoreExist, setStoreExist} = useContext(context) 18 | const [color, setColor] = useState("rgb(255, 51, 0)"); 19 | const [coalition, setCoalition] = useState("Coalition off"); 20 | const [desplay, setDesplay] = useState("Current Level 0.0 ?"); 21 | const [cols, setCols] = useState("off"); 22 | const [las , setLas] = useState(""); 23 | const [getproject, setProject] = useState(""); 24 | const [difficulty, setDifficulty] = useState(""); 25 | const [Loader, setLoader] = useState(false); 26 | const [setjson, setJson] = useState([]); 27 | const [setobv, setObv] = useState(true); 28 | const {logs, setLogs} = useContext(context); 29 | const [setvalt, setValt] = useState(""); 30 | const [setdif, setDif] = useState(""); 31 | const [sename, setSename] = useState("Please Write the Project Name ?"); 32 | const {forloads, setForloads} = useContext(context); 33 | const {Empty, setEmpty} = useContext(context) 34 | 35 | const [vel, setVel] = useState({ 36 | level : '', 37 | score : '' 38 | }); 39 | 40 | const navigate = useNavigate(); 41 | function levelCalculator(startLevel, plannedXp, score, switchValue) { 42 | const levelsXp = [0, 462, 2688, 5885, 11777, 29217, 46255, 63559, 74340, 85483, 95000, 105630, 43 | 124446, 145782, 169932, 197316, 228354, 263508, 303366, 348516, 399672, 457632, 44 | 523320, 597786, 682164, 777756, 886074, 1008798, 1147902, 1305486, 1484070]; 45 | let xp = plannedXp * (score / 100); 46 | if (switchValue === 'on') { 47 | xp += xp * 0.042; 48 | } 49 | const levelDown = Math.floor(startLevel); 50 | const levelUp = levelDown + 1; 51 | 52 | const levelXpTotal = levelsXp[levelUp] - levelsXp[levelDown]; 53 | const currentXp = levelsXp[levelDown] + (levelXpTotal * (startLevel - levelDown)); 54 | 55 | let finalXp = currentXp + xp; 56 | 57 | let i; 58 | for (i = 0; i < levelsXp.length; i++) { 59 | if (levelsXp[i] > finalXp) { 60 | break; 61 | } 62 | } 63 | 64 | const maxXp = levelsXp[i] - levelsXp[i - 1]; 65 | finalXp -= levelsXp[i - 1]; 66 | 67 | return (i - 1) + (finalXp / maxXp); 68 | } 69 | 70 | const result = levelCalculator(4.20, 5775, 125, 'off'); 71 | const functioHandlechange = (e) => { 72 | setVel({...vel, [e.target.name] : e.target.value}); 73 | if (e.target.name == "project") { 74 | setjson.forEach((item, index) => { 75 | if (item.name == e.target.value) { 76 | console.log(item.difficulty); 77 | } 78 | }); 79 | } 80 | } 81 | 82 | const getdif = (get) => { 83 | setjson.forEach((item, index) => { 84 | if (get == item.name) { 85 | setDif(String(item.difficulty)); 86 | } 87 | }); 88 | } 89 | useEffect(() => { 90 | setEmpty(true) 91 | setForloads(false) 92 | 93 | 94 | setStoreExist([]) 95 | fetch("/Project_lvl.json").then((response) => { 96 | return response.json(); 97 | }).then((data) => { 98 | setJson(data); 99 | }).catch((err) => { 100 | console.log(err); 101 | }) 102 | }, []); 103 | 104 | const funcAdd = () => { 105 | vel.level = las; 106 | if (las != "fill the form" || las != "NaN" || las != "") { 107 | setDesplay(las); 108 | } 109 | } 110 | const Calculate = () => { 111 | setjson.map((item, index) => { 112 | }); 113 | if (String(vel.level).length == 0 || String(vel.score).length == 0 || sename == "Please Write the Project Name ?" || sename == "") { 114 | setLas("fill the form"); 115 | return; 116 | } 117 | setLas(String(levelCalculator(vel.level, setdif, vel.score, cols)).substring(0, 4)); 118 | } 119 | setTimeout(() => { 120 | setLoader(true); 121 | }, 1000); 122 | 123 | setTimeout(() => { 124 | setObv(false); 125 | }, 8000); 126 | const functionGet = (e) => { 127 | setSename(e.target.value); 128 | setValt(e.target.value); 129 | } 130 | const [ButtonOff, SetButtonOff] = useState(false) 131 | 132 | const FunctionSetCol = () => { 133 | SetButtonOff(!ButtonOff) 134 | if (cols === 'off') setCols('on') 135 | else setCols('off') 136 | } 137 | // Col All maters Is this --> cols 138 | return ( 139 |
140 | 146 |
148 |
149 |

XP-Calculator

150 |
151 |
152 | functioHandlechange(e)} value={vel.level} placeholder={desplay} className="input text-white w-[50%] font-bars2 border-solid border-[1px] placeholder-white border-yellow-500 bg-black " /> 153 | functioHandlechange(e)} value={vel.score} placeholder=" Score 100 - 125 ?" className="input text-white w-[50%] font-bars2 border-solid placeholder-white border-[1px] border-yellow-500 bg-black" /> 154 |
155 |
156 |
157 |
158 | (setSename(""))} onChange={(e) => functionGet(e)} inputMode="text" value={sename} className="w-[100%] pl-5 rounded-lg text-white z-40 placeholder-white bg-black placeholder-yellow-600 font-bars2 outline-none h-[100%]" placeholder={sename}/> 159 |
160 | {setjson.filter(item => { 161 | const vao = item.name.toLowerCase(); 162 | const sec = setvalt.toLowerCase(); 163 | return (vao.startsWith(sec)); 164 | 165 | }).map((item, index) => 166 |
(setSename(item.name), getdif(item.name))} key={index} className="w-[100%] flex-row h-10 pt-2 pb-2 rounded-md cursor-pointer flex pl-4 items-center duration-300 justify-start hover:bg-yellow-600 hover:bg-opacity-15"> 167 |

{item.name}

168 |
169 | )} 170 |
171 |
172 |
173 |
174 |
175 |
176 |
177 |
178 |

Coalition

179 |

{cols}

180 |
181 |
182 |
FunctionSetCol()} className={`w-[50px] cursor-pointer flex items-center rounded-lg duration-500 h-[25px] mr-1 border-solid border-black border-[2px] bg-white`}> 183 |
184 |
185 |
186 |
187 |
188 |
(Calculate())} className="bg-yellow-500 hover:scale-105 flex items-center 189 | text-black font-bars2 font-bold cursor-pointer duration-200 hover:bg-yellow-400 justify-center h-[100px] w-[100px] rounded-[50%]" > 190 |

Calculate

191 |
192 |
193 |
194 | {las == "NaN" ? 195 | (

Please Provide An Input !

) : 196 | las == "" ? 197 | (

0.0

) : 198 | (

{las}

)} 199 | { 200 | !vel.level == "" && 201 |
(funcAdd())} className="w-[30px] cursor-pointer duration-300 hover:scale-110 h-[30px] "> 202 | 203 |
204 | } 205 |
206 |
207 | {/*
208 |
209 |
210 |

{sename}

211 |
212 |
213 | 214 |
215 |
216 |
*/} 217 |
218 |
219 | ); 220 | } -------------------------------------------------------------------------------- /src/Nav/Nav.jsx: -------------------------------------------------------------------------------- 1 | import React , {useContext, useEffect, useRef, useSyncExternalStore} from "react"; 2 | import { useState } from "react"; 3 | import { useNavigate } from "react-router"; 4 | import Cookies from "js-cookie"; 5 | import { TiThMenu } from "react-icons/ti"; 6 | import { FaRankingStar } from "react-icons/fa6"; 7 | import { FaUsersViewfinder } from "react-icons/fa6"; 8 | import { GrCalculator } from "react-icons/gr"; 9 | import { CiMenuBurger } from "react-icons/ci"; 10 | import { BiLogOutCircle } from "react-icons/bi"; 11 | import { RiVipCrown2Fill } from "react-icons/ri"; 12 | import { DropDowns } from "../Dropdown/Dropdown"; 13 | import { SiBitcoinsv } from "react-icons/si"; 14 | import { RiTokenSwapLine } from "react-icons/ri"; 15 | import { MdOutlinePool } from "react-icons/md"; 16 | import { SiAmazonsimpleemailservice } from "react-icons/si"; 17 | import { FaUniversity } from "react-icons/fa"; 18 | import { context } from "../context"; 19 | 20 | // This Comp Is too Long I Kept Testing Some StufF then i find My Self Hard Coding this Comp o Mb9ch 3ndi jhd So Khalito hhhhhhhh 21 | const CardMuchComp = ({MeData}) => { 22 | return ( 23 |
24 |
25 |
26 | 27 |
28 |
29 |
30 |

{MeData.Full_name }

31 |
32 |
33 |
34 |
35 |
36 |

{MeData.Wallet}

37 |
38 |
39 |

Wallet

40 | 41 |
42 |
43 |
44 |
45 |
46 |
47 |

{MeData.point}

48 |
49 |
50 |

Point's

51 | 52 |
53 |
54 |
55 |
56 |
57 |
58 |

Campus :

59 |

{MeData.campus}

60 |
61 |
62 |

Pool :

63 |

{MeData.poolMonth + " " + MeData.poolYear}

64 |
65 |
66 |

Email :

67 |

{MeData.email}

68 |
69 |
70 | 71 |
72 | ) 73 | } 74 | const StateDropMenu = ({Seter}) => { 75 | const navigate = useNavigate() 76 | const ObjectMenu = [{text : 'Rank', icon :, navi : "/home"}, 77 | {text : 'Peer-Finder', icon : , navi : "/PeerFinder"}, 78 | {text : 'XP-Calculator', icon : , navi : "/calculator"}, 79 | {text : 'Vip-Pass', icon : , navi : "/Vip"}] 80 | return ( 81 |
82 | {ObjectMenu.map((item, index) => ( 83 | <> 84 |
85 |
(navigate(item.navi), Seter(false))} className='flex hover:scale-105 duration-200 cursor-pointer pl-2 items-cemter justify-start gap-2 w-[90%] rounded-md h-[30px] hover:bg-gray-900 bg-black'> 86 |
87 |

{item.text}

88 |
89 |
90 | {item.icon} 91 |
92 |
93 |
94 | 95 | )) 96 | } 97 |
98 | ) 99 | } 100 | 101 | const LeftBar = ({DataObject, seter}) => { 102 | const navigate = useNavigate() 103 | const FunctionLogout = () => { 104 | Cookies.remove('access_token') 105 | navigate('/') 106 | } 107 | return ( 108 |
109 |
{FunctionLogout()}} className='w-[30px] cursor-pointer hover:scale-125 duration-200 flex mr-3 items-center justify-center h-[30px]'> 110 | 111 |
112 |
seter(true)} className='flex cursor-pointer items-center justify-center mr-2 h-[50px]'> 113 | {DataObject.login != undefined && 114 |

115 | {DataObject.login} 116 |

117 | } 118 |
119 |
seter(true)} className='w-[50px] cursor-pointer h-[50px] border-[2px] border-yellow-500 rounded-full'> 120 | 121 |
122 |
123 |
124 |
125 | ) 126 | } 127 | 128 | const ElementsNav = () => { 129 | const navigate = useNavigate() 130 | const ObjectMenu = [{text : 'Peer-Finder', icon : , navi : "/PeerFinder"}, 131 | {text : 'XP-Calculator', icon : , navi : "/calculator"}, 132 | {text : 'Live-Rank', icon :, navi : "/home"}, 133 | {text : 'Vip-Pass', icon : , navi : "/Vip"}] 134 | return ( 135 |
136 |
137 | {ObjectMenu.map((item, index) => ( 138 |
{navigate(item.navi)}} key={index} className='w-[170px] cursor-pointer hover:scale-105 duration-200 border-opacity-25 rounded-md h-[35px] flex items-center justify-center'> 139 |
140 | {item.icon} 141 |

{item.text}

142 |
143 | )) 144 | } 145 |
146 | ) 147 | } 148 | 149 | 150 | // ID : 151 | // Year 152 | // Campus 153 | // Page 154 | 155 | const HeaderNav = () => { 156 | const [MeData, setMeData] = useState({login : 'Tsna HH'}) 157 | const {GlobalData, setGlobalData} = useContext(context) 158 | 159 | const [Fetched, setFetched] = useState(false) 160 | const [DropMenu, SetDropMenu] = useState(false) 161 | const [Profile, setProfile] = useState(false) 162 | 163 | const {Connection, setConnection} = useContext(context) 164 | const {Student_State, setState} = useContext(context) 165 | const {Campus, setCampus} = useContext(context) 166 | const {Month, setMonth} = useContext(context) 167 | const {Year, SetYear} = useContext(context) 168 | const {campusScope, setCompusScope} = useContext(context) 169 | 170 | 171 | const {LocalCampus, setLocalCampus} = useContext(context) // Local Scope ID Curs 172 | const {LocalDepa, setLocalDepart} = useContext(context) // Local Scope Id of schol 173 | const {LocalMonth, setLocalmonth} = useContext(context) 174 | const {LocalYear, SetYearLocal} = useContext(context) 175 | 176 | const { forloads, setForloads } = useContext(context) 177 | const {Empty, setEmpty} = useContext(context) 178 | 179 | 180 | const navigate = useNavigate() 181 | const FunctionGet = async () => { 182 | 183 | const RouteFetch = "https://api.1337leets.com/Me" 184 | const Token = Cookies.get('access_token') 185 | let FetchMe 186 | try { 187 | 188 | FetchMe = await fetch(RouteFetch, { 189 | method : 'GET' , 190 | headers : { 191 | 'authorization' : `${Token}` 192 | } 193 | }) 194 | if (!FetchMe.ok){ 195 | Cookies.remove('access_token') 196 | navigate('/') 197 | } 198 | if (FetchMe.ok){ 199 | if (FetchMe.status > 400 && FetchMe.status < 460) 200 | return 201 | const DataGet = await FetchMe.json() 202 | SetYear(parseInt(DataGet.Year)) // Begin Year 203 | 204 | setLocalmonth(DataGet.poolMonth) // Local Month 205 | setLocalDepart(DataGet.cursusId) // Local Scope 206 | 207 | SetYearLocal(parseInt(DataGet.Year)) 208 | 209 | setState(DataGet.campusId) // Cursus State 210 | setLocalCampus(DataGet.campusId) // Cursus State local 211 | 212 | setCampus(DataGet.campusId) // Campus Student 213 | 214 | setCompusScope(DataGet.cursusId) 215 | setMonth(DataGet.poolMonth) // Month Pool 216 | setMeData(DataGet) // 217 | setGlobalData(DataGet) 218 | setConnection(true) // Flag To Show Data When It Get Fetched 219 | setFetched(true) // 220 | } 221 | } catch (e) { 222 | console.log(e) 223 | Cookies.remove('access_token') 224 | navigate('/') 225 | } 226 | } 227 | useEffect(() => { 228 | if (Cookies.get('access_token') === undefined) 229 | navigate('/') 230 | 231 | if (Year == 0) 232 | FunctionGet() 233 | }) 234 | return ( 235 |
236 | {Profile && 237 |
(setProfile(false))} className="flex items-center justify-center absolute z-50 w-full h-[100vh] bg-white bg-opacity-10 backdrop-blur-sm"> 238 | 239 |
240 | } 241 |
242 |
SetDropMenu(!DropMenu)} className='w-[35px] ml-3 flex items-center justify-center h-[35px] cursor-pointer'> 243 | 244 |
245 | { 246 | DropMenu && 247 | 248 | } 249 |
250 | 251 | 252 |
253 | ) 254 | } 255 | 256 | export {HeaderNav} -------------------------------------------------------------------------------- /src/Vip/Vip.jsx: -------------------------------------------------------------------------------- 1 | import {React , useContext, useEffect, useRef, useState } from "react"; 2 | import Starfield from 'react-starfield'; 3 | import { context } from "../context"; 4 | import Cookies from "js-cookie"; 5 | import { TbLockAccess } from "react-icons/tb"; 6 | import { RiDashboardLine } from "react-icons/ri"; 7 | import { FaUsersGear } from "react-icons/fa6"; 8 | import { RiApps2AddLine } from "react-icons/ri"; 9 | import { FaBan } from "react-icons/fa6"; 10 | import { LuUsers } from "react-icons/lu"; 11 | import { TbClockHour7Filled } from "react-icons/tb"; 12 | import { HiUsers } from "react-icons/hi2"; 13 | import { FaEye } from "react-icons/fa"; 14 | import kta from "../clips/cat.png" 15 | import { IoNavigateCircleOutline } from "react-icons/io5"; 16 | import { SiDiscogs } from "react-icons/si"; 17 | import { FaUserSecret } from "react-icons/fa"; 18 | import { IoMdArrowDropdown } from "react-icons/io"; 19 | import { ImCross } from "react-icons/im"; 20 | 21 | const Bar = ({ROLE, ACT, INDEX}) => { 22 | const Bar = [ 23 | {name : 'Board', icon : RiDashboardLine, ID : 1} , 24 | {name : 'Users', icon : FaUsersGear, ID : 2} , 25 | {name : 'Add', icon : RiApps2AddLine , ID : 4}] 26 | 27 | return ( 28 |
29 |
30 |

Role :

31 | {!ACT ? ( 32 | 33 | ): ( 34 |

{ROLE}

) 35 | } 36 |
37 |
38 | {!ACT ? ( 39 | <> 40 |

Cheking User Role And Permision's

41 | 42 | 43 | ): ( 44 | <> 45 |
46 | {Bar.map((item, index) => ( 47 |
{INDEX(item.ID)}} className="flex items-center justify-center hover:bg-yellow-500 hover:scale-105 duration-200 cursor-pointer h-full w-[80px]"> 48 | 49 |

{item.name}

50 |
51 | )) 52 | } 53 |
54 | {/*
55 |
56 |
*/} 57 | 58 | ) 59 | } 60 | 61 |
62 |
63 | ); 64 | } 65 | 66 | const ContentBanned = () => { 67 | return ( 68 |
69 |
70 | 71 |

You,re Access has Been

72 |

Denied To the Vip !

73 |
74 |

The Only Users With Given Permission

75 |

Can Use The Vip Option's

76 |
77 | ) 78 | } 79 | 80 | const BoardRender = ({item, ALL}) => { 81 | const FindProjct = (ID) => { 82 | const value = ALL.find((user) => { 83 | if (user.id == ID) 84 | return (user.name) 85 | }) 86 | if (value != undefined) 87 | return (value.name) 88 | if (value === undefined) return ('UNKOWN') 89 | } 90 | const FunctionRedirect = (item) => { 91 | window.open(`https://profile.intra.42.fr/` + item) 92 | } 93 | return ( 94 |
95 |
96 |

{item.title}

97 |
98 |
99 |
100 |

{`This Team was closed at : `}

101 |

{item.close.substring(item.close.indexOf('T') + 1, item.close.indexOf('T') + 6)}

102 | 103 |
104 |
(FunctionRedirect("users/" + item.Who))} className="w-[20%] flex items-center rounded-md justify-center hover:bg-yellow-400 duration-200 cursor-pointer h-[30px] bg-yellow-200"> 105 |

View

106 | 107 |
108 |
109 | 110 |
111 | 112 |

User's -

113 |

{item.Users.length}

114 |

in this Team

115 |
116 |
117 | {item.Users.map((items, ind) => ( 118 |
(FunctionRedirect("users/"+ items.login))} className="w-[35px] h-[35px] border-solid hover:scale-105 duration-200 cursor-pointer border-[2px] border-yellow-400 rounded-full bg-black"> 119 | 120 |
121 | )) 122 | } 123 |
124 |
125 |
126 |
127 |

{item.status}

128 |
129 |
130 |
131 |

{FindProjct(item.Id)}

132 |
133 |
134 |
135 | ) 136 | } 137 | 138 | const UserGET = ({role}) => { 139 | const EndPo = "https://api.1337leets.com/Vip/Users" 140 | const EndDel = "https://api.1337leets.com/Vip/Delete" 141 | const [err, setErr] = useState(false) 142 | const [thedata, setdata] = useState([]) 143 | const [refetch, setRefetch] = useState(0) 144 | const FetchReq = async (End) => { 145 | const Req = await fetch(End, { 146 | method : 'GET' , 147 | headers : { 148 | authorization : `${Cookies.get('access_token')}` 149 | } 150 | }) 151 | if (!Req.ok){ 152 | console.log('Error !') 153 | return 154 | } 155 | const Data = await Req.json() 156 | setdata(Data) 157 | } 158 | 159 | const functionDeleteEl = async (ENDPOINT, ID) => { 160 | const fet = await fetch(ENDPOINT, { 161 | method : 'POST' , 162 | headers : { 163 | authorization : `${Cookies.get('access_token')}` 164 | }, 165 | body : JSON.stringify({ 166 | id : ID , 167 | role : role 168 | }) 169 | }) 170 | if (!fet.ok) { 171 | setErr(true) 172 | return 173 | } 174 | setRefetch((refetch) => (refetch + 1)) 175 | } 176 | useEffect(() => { 177 | FetchReq(EndPo) 178 | }, [refetch]) 179 | return ( 180 |
181 | {err && 182 |
183 |

Not Authorized !

184 |
185 | } 186 |
187 | {thedata.map((item, index) => ( 188 |
189 |
190 |
191 |

ID:

192 |

{item.ID}

193 | 194 |
195 |
196 |
197 | (functionDeleteEl(EndDel, item.ID))} className="cursor-pointer" color="red"/> 198 |
199 |

{item.USER}

200 |
201 |
202 | 203 |

{item.ROLE}

204 |
205 |
206 |
207 | )) 208 | } 209 |
210 |
211 |
212 | ) 213 | } 214 | 215 | const AddUser = ({ROLE}) => { 216 | const [Object, setObject] = useState([{name: 'SUPER' , id : 1}, {name : 'Admin' , id : 2}, {name : "User" , id : 3}]) 217 | const [RoleSe , SetRole] = useState('Role') 218 | const [succes, setSuccess] = useState(false) 219 | const [erro, setErr] = useState(false) 220 | const [TheSet, SetTheSet] = useState(false) 221 | const [auth, setAuth] = useState(false) 222 | const Ref = useRef(null) 223 | const EndPoint = "https://api.1337leets.com/Vip/Add" 224 | const [Value, setValue] = useState('') 225 | const [state, SetState] = useState({}) 226 | const functionClick = async (ENDPOINT) => { 227 | console.log(' ====> ', ROLE) 228 | if (Value.length === 0 || RoleSe === 'Role' || ROLE == undefined) { 229 | setErr(true) 230 | return 231 | } 232 | setErr(false) 233 | let val = { 234 | fun : RoleSe , 235 | role : ROLE , 236 | value : Value 237 | } 238 | const fet = await fetch(ENDPOINT, { 239 | method : 'POST' , 240 | headers : { 241 | authorization : `${Cookies.get('access_token')}` 242 | }, 243 | body : JSON.stringify(val) 244 | }) 245 | if (!fet.ok){ 246 | setAuth(true) 247 | return 248 | } 249 | setErr(false) 250 | setAuth(false) 251 | setSuccess(true) 252 | } 253 | return ( 254 |
255 |
256 | (setValue(e.target.value))} className="w-full h-full pl-2 placeholder:font-bars5 bg-transparent placeholder:text-white text-white font-bars5" placeholder=" User Name !"/> 257 |
258 |
(functionClick(EndPoint))} className="mb-3 w-[300px] rounded-full cursor-pointer hover:bg-yellow-300 duration-200 border-solid border-[4px] border-yellow-100 bg-yellow-400 h-[300px] flex items-center justify-center "> 259 |

ADD

260 |
261 |
262 |
(SetTheSet(!TheSet))} className="flex items-center justify-center w-[100px] rounded-lg h-[30px] bg-white"> 263 |

{RoleSe}

264 | 265 |
266 | {TheSet && 267 |
268 | { 269 | Object.map((item, index) => ( 270 |
(SetRole(item.name), SetTheSet(false))} className="border-solid border-[1px] cursor-pointer hover:scale-105 duration-200 border-black mb-1 w-full h-[20px] flex items-center justify-center bg-yellow-400 rounded-sm"> 271 |

{item.name}

272 |
273 | )) 274 | } 275 |
276 | } 277 |
278 | {erro && 279 |
280 |

Missing a Value !

281 |
282 | } 283 | {auth && 284 |
285 |

Not Authorized !

286 |
287 | } 288 | {succes && 289 |
290 |

Added !

291 |
292 | } 293 |
294 | ) 295 | } 296 | 297 | const ProjectShow = ({ALL, ID, ROLE}) => { 298 | const EndPoint = "https://api.1337leets.com/Vip/Push" 299 | const [Objects, setObjects] = useState([{Users : [{}, {}] , close : 'LOA...', title : 'LOADING...', Id : 999, status : 'LOADING'}]) 300 | const [MainObj, setMainObj] = useState([]) 301 | const [Relod, SetReload] = useState(false) 302 | for (let index = 0; index < 20; index++) 303 | Objects.push({Users : [{}, {}] , close : 'LOA...', title : 'LOADING...', Id : 999, status : 'LOADING'}) 304 | 305 | const FunctionGet = async () => { 306 | const DataGet = await fetch(EndPoint, { 307 | method : 'GET', 308 | headers : { 309 | authorization : `${Cookies.get('access_token')}` 310 | } 311 | }) 312 | if (!DataGet.ok){ 313 | console.log('Error !') 314 | return 315 | } 316 | const Data = await DataGet.json() 317 | setMainObj(Data) 318 | SetReload(true) 319 | } 320 | 321 | 322 | useEffect(() => { 323 | FunctionGet() 324 | }, []) 325 | 326 | return ( 327 |
328 | {ID === 1 && !Relod ? ( 329 |
330 | { 331 | Objects.map((item, index) => ( 332 | 333 | )) 334 | } 335 |
336 | ): ID === 1 && Relod ? ( 337 |
338 | { 339 | MainObj.map((item, index) => ( 340 | 341 | )) 342 | } 343 |
344 | ) : ID === 2 ? ( 345 | 346 | ) : ID === 4 ? ( 347 | 348 | ) : ( 349 | <> 350 | ) 351 | } 352 |
353 | ) 354 | } 355 | 356 | const Vip = () => { 357 | const {GlobalData, setGlobalData} = useContext(context) 358 | const [role, setRole] = useState('') 359 | const [ACTIVE, setActive] = useState(false) 360 | const [rend, setrend] = useState(true) 361 | const [ACESS, setACCESS] = useState(false) 362 | const [Projects, setProjects] = useState([]) 363 | const [ID, setId] = useState(1) 364 | const Url = 'https://api.1337leets.com/Vip/Auth' 365 | 366 | const FetchSubject = async () => { 367 | const Fet = await fetch("/Project_lvl.json") 368 | const Data = await Fet.json() 369 | const MapKey = Data.map((item) => ({ 370 | id : item.project_id, 371 | name : item.name 372 | })) 373 | setProjects(MapKey) 374 | } 375 | 376 | const ReqMaker = async () => { 377 | let CheckReq = await fetch(Url,{ 378 | method : 'POST' , 379 | headers : { 380 | authorization : Cookies.get('access_token') 381 | }, 382 | body : JSON.stringify(GlobalData) 383 | }) 384 | if (CheckReq.ok) { 385 | const Data = await CheckReq.json() 386 | console.log(Data.Rows) 387 | if (Data.Rows.length > 0){ 388 | setRole(Data.Rows[0].ROLE) 389 | setActive(true) 390 | } 391 | } 392 | } 393 | 394 | useEffect(() => { 395 | ReqMaker() 396 | FetchSubject() 397 | }, []) 398 | 399 | return ( 400 |
401 | 402 | {!ACTIVE ? ( 403 | 404 | ) : ( 405 | 406 | ) 407 | } 408 | 409 |
410 | ) 411 | } 412 | 413 | export default Vip 414 | -------------------------------------------------------------------------------- /src/Scrol/Scrol.jsx: -------------------------------------------------------------------------------- 1 | import React, { useContext, useEffect } from "react"; 2 | import { useState } from "react"; 3 | import { context } from "../context"; 4 | import "./Scrol.css"; 5 | import me from "../clips/this.png"; 6 | import loua from "../clips/loua.png"; 7 | import asad from "../clips/asad.png"; 8 | import Cookies from "js-cookie"; 9 | import mma from "../clips/memem.jpeg" 10 | import cat from "../clips/taj.jpeg" 11 | import first from "../clips/crown.png" 12 | import sec from "../clips/22.png" 13 | import third from "../clips/33.png" 14 | import king from "../clips/pass.png" 15 | import moz from "../clips/moz.png" 16 | import { WiDaySnow } from "react-icons/wi"; 17 | import promo from "../clips/18.png" 18 | import kta from "../clips/kta.png" 19 | import meme from "../clips/memem.jpeg"; 20 | import abdel from "../clips/abel.jpeg"; 21 | import notab from "../clips/notab.png"; 22 | import hamza from "../clips/pas.png"; 23 | import yas from "../clips/yas.png"; 24 | import pilo from "../clips/pilo.png"; 25 | import mod from "../clips/mod.png"; 26 | import mso from "../clips/maso.png"; 27 | import bou from "../clips/bou.png"; 28 | import zech from "../clips/zech.png"; 29 | import obihi from "../clips/obih.png"; 30 | import thecat from "../clips/nopic.png" 31 | import frat from "../clips/frat.png" 32 | import fnj from "../clips/fnj.png"; 33 | import ala from "../clips/ala.png" 34 | import rd from "../clips/rd.png" 35 | import { GiFullMotorcycleHelmet } from "react-icons/gi"; 36 | import { SiCyberdefenders } from "react-icons/si"; 37 | import ad from "../clips/ad.png" 38 | import abk from "../clips/abk.png" 39 | import asir from "../clips/asir.png" 40 | import redex from '../clips/redex.png' 41 | import Ahmed from '../clips/newahm.png' 42 | import rid from '../clips/rid.png' 43 | import houbet from '../clips/houbet.png' 44 | import { FuncFetch, StaticArray} from "../Func_Help/helper"; 45 | import { DropDowns } from "../Dropdown/Dropdown"; 46 | import { useNavigate } from "react-router-dom"; 47 | import { TbMoodEmptyFilled } from "react-icons/tb"; 48 | import adz from '../clips/adzh.png' 49 | import adzahrao from '../clips/adzahrao.png' 50 | 51 | // Trash Code From the First Leet Update I hv no Time or (JHD) To make this Smaller hihi 52 | const LoneComponenet = ({item, index, forloads, setForloads, StoreExist}) => { 53 | let color = "white"; 54 | const cardSlect = (id) => { 55 | if (StoreExist.length > 1) 56 | window.open(`https://profile.intra.42.fr/users/${StoreExist[id].login}`, '_blank'); 57 | } 58 | return ( 59 |
60 |
(cardSlect(index))} key={index} style={{ backgroundColor: `transparent` }} className="z-40 md:w-[70%] xs:w-[100%] flex items-center justify-start w-[100%] max-w-[800px] rounded-[20px] duration-500 cursor-pointer mb-2 "> 61 |
62 | 63 | {!forloads ? ( 64 | item.login == 'adzahrao' ? ( 65 | 66 | ): 67 | item.login == "adechaji" ? ( 68 | 69 | ) : 70 | item.login == "aghounam" ? ( 71 | 72 | ) : 73 | item.login == "alaassir" ? ( 74 | 75 | ) : 76 | item.login == "aitaouss" ? ( 77 | 78 | ) : 79 | item.login == "abkacimi" ? ( 80 | 81 | ) : 82 | item.login == "amabrouk" ? ( 83 | 84 | ) : 85 | item.login == "amel-has" ? ( 86 | 87 | ) : 88 | item.login == "akoutate" ? ( 89 | 90 | ) : 91 | item.login == "oel-feng" ? ( 92 | 93 | ) : 94 | item.login == "skasmi" ? ( 95 | 96 | ) : 97 | item.profileImage === "null" ? ( 98 | 99 | ) : 100 | item.login == "youbihi" ? ( 101 | 102 | ) : 103 | item.login == "zech-chi" ? ( 104 | 105 | ) : 106 | item.login == "aboukdid" ? ( 107 | 108 | ) : 109 | item.login == "ymassiou" ? ( 110 | 111 | ) : 112 | item.login == "mkimdil" ? ( 113 | 114 | ) : 115 | item.login == "mes-salh" ? ( 116 | 117 | ) : 118 | item.login == "ymakhlou" ? ( 119 | 120 | ) : 121 | item.login == "hel-magh" ? ( 122 | 123 | ) : 124 | item.login == "abel-all" ? ( 125 | 126 | ) : 127 | item.login == "ychahbi" ? ( 128 | 129 | ) : 130 | item.login == "sel-jett" ? ( 131 | 132 | ) : item.login == "mmaghri" ? ( 133 | 134 | ) : item.login == "mlouazir" ? ( 135 | 136 | ) : item.login == "asnaji" ? ( 137 | 138 | ) : item.login == "mozennou" ? ( 139 | 140 | ) : item.login == "hmrabet" ? ( 141 | 142 | ) : ( 143 | 144 | )) : ( 145 |
146 | 147 |
148 | ) 149 | } 150 |
151 |
152 |
153 |
154 |
155 |

{ 156 | item.login == "wabolles" ? ( 157 | "wabolles-Aka-theF" 158 | ) : item.login == "ael-mouz" ? ( 159 | "ael-mouz Aka-( MakeFile )" 160 | ) : ( 161 | `${item.login}` 162 | ) 163 | } 164 | {item.login == "mmaghri" || item.login == "adzahrao" || item.login == "abkacimi" || item.login == "mlouazir" || item.login == "abablil" ? ( 165 | 166 | ) : item.login == "amel-has" || item.login == "adechaji" || item.login == 'adzahrao' ? ( 167 | 168 | ) : item.login == "hmrabet" ? ( 169 | 170 | ) : 171 | ( 172 | <> 173 | ) 174 | } 175 |

176 |

{item.first_name + " " + item.last_name}

177 |
178 |
179 |

Lvl :

180 |
181 | {String(item.level).includes(".") ? ( 182 |

{String(item.level).split(".")[0]}

183 | ) : ( 184 |

{item.level}

185 | ) 186 | } 187 |
188 |
189 |
190 |
191 |
192 |

{index + 1}

193 | {index + 1 == 1 ? ( 194 | 195 | ) : index + 1 == 2 ? ( 196 | 197 | ) : index + 1 == 3 ? ( 198 | 199 | ) : 200 | ( 201 | <> 202 | ) 203 | } 204 |
205 | 206 |
207 | {item.location != null ? ( 208 | <> 209 |
210 |

{item.location}

211 | ) : ( 212 | <> 213 |
214 |

unav

215 | 216 | )} 217 |
218 |
219 |
220 |
221 |
222 |
223 | {String(item.level).includes(".") ? ( 224 | String(item.level).split(".")[1].substring(0, 2).length == 1 ? ( 225 |
226 | ) : 227 |
228 | ) : ( 229 |
230 | ) 231 | 232 | } 233 |
234 |
235 |
236 | {String(item.level).includes(".") ? ( 237 | String(item.level).split(".")[1].substring(0, 2).length == 1 ? ( 238 |

{String(item.level).split(".")[1].substring(0, 2) + "0" + "%"}

239 | ) : 240 |

{String(item.level).split(".")[1].substring(0, 2) + "%"}

241 | ) : ( 242 |

{0 + "%"}

243 | ) 244 | } 245 |
246 |
247 |
248 |
249 |
250 | ); 251 | } 252 | // Trash Code From the First Leet Update I hv no Time or (JHD) To make this Smaller hihi 253 | 254 | 255 | 256 | export default function Scrol() { 257 | const [TimerWait, setTimerWait] = useState(false) 258 | 259 | const {Year, SetYear} = useContext(context) // Year 260 | const {Campus, setCampus} = useContext(context) // Cursus Id 261 | const {Student_State, setState} = useContext(context) // Campus Id 262 | const {Month, setMonth} = useContext(context) // Month 263 | const {LoadMore, SetLoadMore} = useContext(context) 264 | const { campusScope, setCompusScope } = useContext(context) // Local 265 | const {forloads, setForloads} = useContext(context); 266 | const {Empty, setEmpty} = useContext(context) 267 | 268 | const {StoreExist, setStoreExist} = useContext(context) 269 | useEffect(() => { 270 | if (StoreExist.length > 0) { 271 | setForloads(true) 272 | setEmpty(true) 273 | } 274 | }, [StoreExist]) 275 | 276 | const navigate = useNavigate() 277 | const FunctionClickedBut = () => { 278 | setTimerWait(true) 279 | setTimeout(() => { 280 | setTimerWait(false) 281 | }, [5000]) 282 | let Mo 283 | if (Month.length > 1) Mo = Month 284 | else Mo = "0" + Month 285 | 286 | let Obj = { 287 | CampID: Student_State, 288 | CurId: campusScope, 289 | Year: Year, 290 | Month : Month, 291 | Load : LoadMore 292 | } 293 | FuncFetch("https://api.1337leets.com/Users", setStoreExist, StoreExist, Obj, 'Scroll', navigate, setEmpty, setForloads) 294 | } 295 | return ( 296 |
{console.log('scr')}} className="flex-col items-center justify-start border-solid overflow-auto w-[100%] h-[100%] mt-[10px] z-30 rounded-[10px]"> 297 | 298 | <> 299 | {(!forloads && Empty) && 300 | StaticArray.map((items, indexx) => ( 301 | 302 | )) 303 | } 304 | {(forloads && Empty) && 305 | StoreExist.map((items, indexx) => ( 306 | 307 | )) 308 | } 309 | 310 |
311 | {Empty && 312 | <> 313 | {!TimerWait && 314 |
315 | 316 |
317 | } 318 | {TimerWait && 319 |
320 | 321 |
322 | } 323 | 324 | } 325 | { 326 | !Empty && 327 |
328 | 329 |

Nothing Here Go Search For Something Else !

330 |
331 | } 332 |
333 |
334 | ); 335 | } 336 | --------------------------------------------------------------------------------