From d8d5562224a45154e88197d295d8b11a86baef3a Mon Sep 17 00:00:00 2001 From: Nicolas VINCENT Date: Mon, 6 Feb 2023 20:04:25 +0100 Subject: [PATCH] home-page Ajout d'une page accueil --- .vscode/settings.json | 4 ++-- app/page.tsx | 37 ++++++++++++++++++++++++++++++++++--- next.config.js | 2 +- styles/globals.css | 8 ++++++++ 4 files changed, 45 insertions(+), 6 deletions(-) diff --git a/.vscode/settings.json b/.vscode/settings.json index 60972d0..58ff454 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -1,4 +1,4 @@ { - "typescript.tsdk": "node_modules/.pnpm/typescript@4.9.5/node_modules/typescript/lib", + "typescript.tsdk": "node_modules\\.pnpm\\typescript@4.9.5\\node_modules\\typescript\\lib", "typescript.enablePromptUseWorkspaceTsdk": true -} +} \ No newline at end of file diff --git a/app/page.tsx b/app/page.tsx index 35289f2..d38a8a7 100644 --- a/app/page.tsx +++ b/app/page.tsx @@ -1,15 +1,46 @@ +'use client'; + import AppLink from '@/ui/AppLink'; +import { HtmlHTMLAttributes, useEffect } from 'react'; + export default function Home() { + useEffect(() => { + let visible:boolean = true; + let animation:boolean = true; //TODO ajouter un bouton pour arreter l'animation + let con: HTMLElement | null = document.getElementById('console'); + window.setInterval(function() { + if(con !== null && visible === true && animation === true){ + con.className = 'console invisible'; + visible = false; + }else if(con !== null && animation ===true){ + con.className = 'console'; + visible = true; + } + }, 400); + let word:HTMLElement | null = document.getElementById('text') + let text: string= "Peer-at-Code"; + for (let i:number = 0; i < text.length; i++) { + setTimeout(function(){ + if(word !== null) + word.innerHTML += text.charAt(i); + }, 410 * i ) + } + } , []); return (
-

- Amuse toi avec Next.js et{' '} - Tailwindcss ! +

+ Bienvenu sur

+

+ +
_
+

+

Dashboard
); } + diff --git a/next.config.js b/next.config.js index b859826..3bc06a0 100644 --- a/next.config.js +++ b/next.config.js @@ -1,6 +1,6 @@ /** @type {import('next').NextConfig} */ const nextConfig = { - reactStrictMode: true, // Recommended for the `pages` directory, default in `app`. + reactStrictMode: false, // Recommended for the `pages` directory, default in `app`. swcMinify: true, experimental: { appDir: true diff --git a/styles/globals.css b/styles/globals.css index b5c61c9..c786c2e 100644 --- a/styles/globals.css +++ b/styles/globals.css @@ -1,3 +1,11 @@ @tailwind base; @tailwind components; @tailwind utilities; + +.console{ + display:inline-block; + position:relative; + top:-0.14em; + left:5px; + height: 1rem; +} \ No newline at end of file