import Nav from "./Nav"
import "./css/Random.css"


function Random() {
    return (
        <>
            <Nav/>
            <main className="container">
                <h1>Image generator</h1>
                <button onClick={() => RandomGenerate()}>Generate</button>
                <img src="" alt="" className="random-img"/>
            </main>
        </>
    )
}


function RandomGenerate() {
    const images = ["../character.jpg", "../towerraid.jpg", "../gameplay.jpg", "../wallpaper300.png"]
    document.querySelector(".random-img").src = images[Math.floor(Math.random() * images.length)]
}


export default Random