diff --git a/src/app.js b/src/app.js index f129d1c9e..f8082ee1f 100644 --- a/src/app.js +++ b/src/app.js @@ -1,11 +1,22 @@ -/* eslint-disable */ -import "bootstrap"; -import "./style.css"; - -import "./assets/img/rigo-baby.jpg"; -import "./assets/img/4geeks.ico"; - -window.onload = function() { - //write your code here - console.log("Hello Rigo from the console!"); -}; +// Función para generar excusas +window.onload = function () { + generarExcusa(); +}; + +function generarExcusa() { + let who = ['The dog', 'My grandma', 'The mailman', 'My bird']; + let action = ['ate', 'peed', 'crushed', 'broke']; + let what = ['my homework', 'my phone', 'the car']; + let when = ['before the class', 'when I was sleeping', 'while I was exercising', 'during my lunch', 'while I was praying']; + + let rnd1 = Math.floor(Math.random() * who.length); + let rnd2 = Math.floor(Math.random() * action.length); + let rnd3 = Math.floor(Math.random() * what.length); + let rnd4 = Math.floor(Math.random() * when.length); + + // Genera la excusa combinando las partes + let excuse = `${who[rnd1]} ${action[rnd2]} ${what[rnd3]} ${when[rnd4]}`; + + // Muestra la excusa en el elemento con id "excuse" + document.querySelector("#excuse").innerHTML = excuse; +} diff --git a/src/index.html b/src/index.html index e275741cf..1cfab9b8f 100644 --- a/src/index.html +++ b/src/index.html @@ -1,29 +1,24 @@ - - -
- - -- If this text is not centered and yellow, you probably have - an error -
-