generated from lucien/actix-react-template
Fin Chaos Page
This commit is contained in:
parent
53853dcce5
commit
1e95438b2c
4 changed files with 17 additions and 12 deletions
|
@ -1,10 +1,10 @@
|
|||
//import { useState } from "react";
|
||||
|
||||
export default function MonInput({text, new_focus}) {
|
||||
export default function MonInput({text, new_focus, police}) {
|
||||
|
||||
return (
|
||||
<div>
|
||||
<input readOnly value={text} onFocus={new_focus}></input>
|
||||
<input readOnly value={text} onFocus={new_focus} style={{fontFamily: police,width:1000}}></input>
|
||||
</div>
|
||||
)
|
||||
}
|
|
@ -1,4 +1,4 @@
|
|||
import { useState } from "react";
|
||||
|
||||
|
||||
|
||||
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
|
||||
#keys {
|
||||
display: grid;
|
||||
grid-template-columns: auto auto 1fr;
|
||||
|
|
|
@ -6,11 +6,10 @@ import { useState } from "react";
|
|||
|
||||
export default function ChaosPage(){
|
||||
|
||||
const array_input = [1,2,3,4];
|
||||
const [array_letter,setArray_letter]=useState(["a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","x","y","z"," ","!"]);
|
||||
|
||||
const [sizeFrontw,setSizeFrontw] = useState(16)
|
||||
const [sizeFronth,setSizeFronth] = useState(10)
|
||||
const [sizeFronth,setSizeFronth] = useState(20)
|
||||
const [color,setColor] = useState("#ffffff")
|
||||
|
||||
function randomFront(){setSizeFronth(Math.floor(Math.random() * (1000)));
|
||||
|
@ -25,19 +24,16 @@ export default function ChaosPage(){
|
|||
return arr;
|
||||
}
|
||||
|
||||
const myArray = [1, 2, 3, 4, 5];
|
||||
const shuffledArray = shuffleArray(myArray);
|
||||
|
||||
console.log(shuffledArray); // Affiche un tableau mélangé
|
||||
|
||||
|
||||
const [entry1,setEntry1] = useState("champ1")
|
||||
const [entry1,setEntry1] = useState("")
|
||||
function E1(ent:string) {
|
||||
setEntry1(entry1+ent);
|
||||
}
|
||||
const [connarddefocus,setFocus] = useState(()=>E1)
|
||||
|
||||
const [entry2,setEntry2] = useState("champ2")
|
||||
const [entry2,setEntry2] = useState("")
|
||||
function E2(ent:string) {
|
||||
setEntry2(entry2+ent);
|
||||
}
|
||||
|
@ -47,12 +43,20 @@ export default function ChaosPage(){
|
|||
setFocus(()=>E);
|
||||
}
|
||||
|
||||
const [entry3,setEntry3] = useState("")
|
||||
function E3(ent:string) {
|
||||
setEntry3(entry3+ent);
|
||||
}
|
||||
|
||||
return(
|
||||
<div>
|
||||
<h1>Chaos Page</h1>
|
||||
<MonInput text={entry1} new_focus={()=>changeFocus(E1)}/>
|
||||
<MonInput text={entry2} new_focus={()=>changeFocus(E2)}/>
|
||||
<p>Quel est votre nom ?</p>
|
||||
<MonInput text={entry1} new_focus={()=>changeFocus(E1)} police={""}/>
|
||||
<p>Quel adjectif désigne le mieux Xi Junpin ?</p>
|
||||
<MonInput text={entry2} new_focus={()=>changeFocus(E2)} police={""}/>
|
||||
<p>Combien font 1+1 ?</p>
|
||||
<MonInput text={entry3} new_focus={()=>changeFocus(E3)} police={"Wingdings"}/>
|
||||
<div id = "keys">
|
||||
{array_letter.map((letter) => {return <MonButton
|
||||
letter={letter}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue