Lots of refactoring
- Removing test mentions in readme - moving login page as an app - removing vite broken config - removing auto-generated and unused vite configuration (base.css) Overall simplification (sorry @Wal I kinda destroyed your login page a bit but seems fixable 👉👈)
This commit is contained in:
		| @ -19,9 +19,3 @@ npm run dev | ||||
| ```sh | ||||
| npm run build | ||||
| ``` | ||||
|  | ||||
| ### Run Unit Tests with [Vitest](https://vitest.dev/) | ||||
|  | ||||
| ```sh | ||||
| npm run test:unit | ||||
| ``` | ||||
|  | ||||
| @ -1,11 +0,0 @@ | ||||
| <!DOCTYPE html> | ||||
| <html> | ||||
| 	<head> | ||||
| 		<meta charset="utf-8"> | ||||
| 		<title>Clyde - Login</title> | ||||
| 	</head> | ||||
| 	<body> | ||||
| 		<div id="app"></div> | ||||
| 		<script type=module src="/src/login.js"></script> | ||||
| 	</body> | ||||
| </html> | ||||
| @ -1,18 +1,26 @@ | ||||
| <script setup> | ||||
| 	import 'https://kit.fontawesome.com/fb3bbd0a95.js' | ||||
| 	import { toast } from 'vue3-toastify'; | ||||
| 	import { ref } from 'vue' | ||||
|   import { toast } from 'vue3-toastify'; | ||||
|   import { ref, computed } from 'vue' | ||||
|   import i18n, { setLang } from './i18n.js' | ||||
|   import Inscription from "./Inscription.vue" | ||||
|  | ||||
|  | ||||
|   const test = ref(); | ||||
|   // Liste des apps | ||||
|   import LoginPage from './Apps/Login.vue' | ||||
|   import Inscription from "./Apps/Inscription.vue" | ||||
|  | ||||
| 	async function draw(e) { | ||||
| 		test.value = (await fetch("http://localhost:8080/ping")); | ||||
| 		test.value = await test.value.json(); | ||||
| 		toast(test.value['txt']); | ||||
| 	} | ||||
|   const apps = { | ||||
|   	'/login': LoginPage, | ||||
| 	'/inscription': Inscription | ||||
|   } | ||||
|   const currentPath = ref(window.location.hash) | ||||
|  | ||||
|   window.addEventListener('hashchange', () => { | ||||
|     currentPath.value = window.location.hash | ||||
|   }) | ||||
|    | ||||
|   const currentView = computed(() => { | ||||
|     return apps[currentPath.value.slice(1) || '/'] | ||||
|   }) | ||||
|  | ||||
|   const home=ref(i18n("app.home")) | ||||
|   const notifications=ref(i18n("app.notifications")) | ||||
| @ -37,7 +45,7 @@ | ||||
|                 <div class=" fa-solid fa-house" style="margin-top: 7px; margin-bottom: 3px;"></div> | ||||
|             </a></li> | ||||
|         <li style="float: right;" title=login> | ||||
|             <a href="/login"> | ||||
|             <a href="#/login"> | ||||
|                 <div class="fa-solid fa-user"  style="margin-top: 7px; margin-bottom: 3px;"></div> | ||||
|             </a></li> | ||||
|         <li style="float: right;" title=notifications> | ||||
| @ -75,7 +83,7 @@ | ||||
|         <li ><a href="#Forum"> | ||||
|             <div class="fa-solid fa-envelope" style="font-size: 40px;" ></div> | ||||
|             <div class="text">{{i18n("app.forum")}}</div></a></li> | ||||
|         <li><a href="#Inscription"> | ||||
|         <li><a href="#/inscription"> | ||||
|             <div class="fa-solid fa-users" style="font-size: 40px;"></div> | ||||
|             <div class="text">{{i18n("app.inscription.requests")}}</div></a></li> | ||||
|     </ul> | ||||
| @ -83,7 +91,7 @@ | ||||
|     </div> | ||||
|     <div class="page"> | ||||
|       <div style=" margin:50px;"> | ||||
|         <Inscription></Inscription> | ||||
| 		<component :is="currentView" /> | ||||
|       </div> | ||||
|     </div> | ||||
|   </div> | ||||
|  | ||||
| @ -1,7 +1,7 @@ | ||||
| <script setup> | ||||
|   import { login , register} from './rest/Users.js' | ||||
|   import { login , register} from '@/rest/Users.js' | ||||
|   import { ref } from 'vue' | ||||
|   import i18n from './i18n.js' | ||||
|   import i18n from '@/i18n.js' | ||||
|   const loginPage= ref(true) | ||||
|   const page = ref(0) | ||||
| 
 | ||||
| @ -27,12 +27,6 @@ | ||||
| 
 | ||||
| 
 | ||||
| <template> | ||||
|   <body> | ||||
|     <div class="Home"> | ||||
|     <a href="/"> | ||||
|        <img @click="draw" src="./assets/Clyde.png" style="width: 40px; height: auto; margin-top:4px"> | ||||
|     </a> | ||||
|     </div> | ||||
|     <div class="logBoxCenterer"> | ||||
|       <div class='loginBox'> | ||||
| 
 | ||||
| @ -128,7 +122,6 @@ | ||||
|          </div> | ||||
|         </div> | ||||
|       </div> | ||||
|   </body> | ||||
| </template> | ||||
| 
 | ||||
| <style scoped> | ||||
| @ -150,7 +143,6 @@ | ||||
| } | ||||
| 
 | ||||
| .logBoxCenterer { | ||||
|   position: absolute; | ||||
|   width: 100%; | ||||
|   height:  100%; | ||||
|   display: flex; | ||||
| @ -161,7 +153,6 @@ | ||||
| 
 | ||||
| .loginBox { | ||||
|   background-color: rgb(24,24,24); | ||||
|   position : absolute; | ||||
|   width: 400px; | ||||
|   display:flex; | ||||
|   justify-content: center; | ||||
| @ -1,5 +1,5 @@ | ||||
| <script setup> | ||||
|   import i18n from "./i18n.js" | ||||
|   import i18n from "@/i18n.js" | ||||
|   const props = defineProps({ | ||||
|   id: Number, | ||||
|   type: String, | ||||
| @ -1,86 +0,0 @@ | ||||
| /* color palette from <https://github.com/vuejs/theme> */ | ||||
| :root { | ||||
|   --vt-c-white: #ffffff; | ||||
|   --vt-c-white-soft: #f8f8f8; | ||||
|   --vt-c-white-mute: #f2f2f2; | ||||
|  | ||||
|   --vt-c-black: #181818; | ||||
|   --vt-c-black-soft: #222222; | ||||
|   --vt-c-black-mute: #282828; | ||||
|  | ||||
|   --vt-c-indigo: #2c3e50; | ||||
|  | ||||
|   --vt-c-divider-light-1: rgba(60, 60, 60, 0.29); | ||||
|   --vt-c-divider-light-2: rgba(60, 60, 60, 0.12); | ||||
|   --vt-c-divider-dark-1: rgba(84, 84, 84, 0.65); | ||||
|   --vt-c-divider-dark-2: rgba(84, 84, 84, 0.48); | ||||
|  | ||||
|   --vt-c-text-light-1: var(--vt-c-indigo); | ||||
|   --vt-c-text-light-2: rgba(60, 60, 60, 0.66); | ||||
|   --vt-c-text-dark-1: var(--vt-c-white); | ||||
|   --vt-c-text-dark-2: rgba(235, 235, 235, 0.64); | ||||
| } | ||||
|  | ||||
| /* semantic color variables for this project */ | ||||
| :root { | ||||
|   --color-background: var(--vt-c-white); | ||||
|   --color-background-soft: var(--vt-c-white-soft); | ||||
|   --color-background-mute: var(--vt-c-white-mute); | ||||
|  | ||||
|   --color-border: var(--vt-c-divider-light-2); | ||||
|   --color-border-hover: var(--vt-c-divider-light-1); | ||||
|  | ||||
|   --color-heading: var(--vt-c-text-light-1); | ||||
|   --color-text: var(--vt-c-text-light-1); | ||||
|  | ||||
|   --section-gap: 160px; | ||||
| } | ||||
|  | ||||
| @media (prefers-color-scheme: dark) { | ||||
|   :root { | ||||
|     --color-background: var(--vt-c-black); | ||||
|     --color-background-soft: var(--vt-c-black-soft); | ||||
|     --color-background-mute: var(--vt-c-black-mute); | ||||
|  | ||||
|     --color-border: var(--vt-c-divider-dark-2); | ||||
|     --color-border-hover: var(--vt-c-divider-dark-1); | ||||
|  | ||||
|     --color-heading: var(--vt-c-text-dark-1); | ||||
|     --color-text: var(--vt-c-text-dark-2); | ||||
|   } | ||||
| } | ||||
|  | ||||
| *, | ||||
| *::before, | ||||
| *::after { | ||||
|   box-sizing: border-box; | ||||
|   margin: 0; | ||||
|   font-weight: normal; | ||||
| } | ||||
|  | ||||
| body { | ||||
|   min-height: 100vh; | ||||
|   color: var(--color-text); | ||||
|   background: var(--color-background); | ||||
|   transition: | ||||
|     color 0.5s, | ||||
|     background-color 0.5s; | ||||
|   line-height: 1.6; | ||||
|   font-family: | ||||
|     Inter, | ||||
|     -apple-system, | ||||
|     BlinkMacSystemFont, | ||||
|     'Segoe UI', | ||||
|     Roboto, | ||||
|     Oxygen, | ||||
|     Ubuntu, | ||||
|     Cantarell, | ||||
|     'Fira Sans', | ||||
|     'Droid Sans', | ||||
|     'Helvetica Neue', | ||||
|     sans-serif; | ||||
|   font-size: 15px; | ||||
|   text-rendering: optimizeLegibility; | ||||
|   -webkit-font-smoothing: antialiased; | ||||
|   -moz-osx-font-smoothing: grayscale; | ||||
| } | ||||
| @ -1,7 +0,0 @@ | ||||
| import './assets/main.css' | ||||
| import 'vue3-toastify/dist/index.css'; | ||||
|  | ||||
| import { createApp } from 'vue' | ||||
| import App from './Login.vue' | ||||
|  | ||||
| createApp(App).mount('#app') | ||||
| @ -1,5 +1,6 @@ | ||||
| import './assets/main.css' | ||||
| import 'vue3-toastify/dist/index.css'; | ||||
| import 'https://kit.fontawesome.com/fb3bbd0a95.js' | ||||
|  | ||||
| import { createApp } from 'vue' | ||||
| import App from './App.vue' | ||||
|  | ||||
| @ -10,15 +10,6 @@ export default defineConfig({ | ||||
|     vue(), | ||||
|     topLevelAwait(), | ||||
|   ], | ||||
|   build: { | ||||
|  	rollupOptions:{ | ||||
| 		input:{ | ||||
| 			main: './index.html', | ||||
| 			login: './login/index.html' | ||||
| 		} | ||||
|    | ||||
|   	} | ||||
|   }, | ||||
|   resolve: { | ||||
|     alias: { | ||||
|       '@': fileURLToPath(new URL('./src', import.meta.url)) | ||||
|  | ||||
		Reference in New Issue
	
	Block a user