Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Añadido de la funcion y todo el proyecto acabado] #109

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 21 additions & 6 deletions src/app.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,26 @@
/* 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!");
const indexWho = Math.floor(Math.random() * who.length);
const indexAction = Math.floor(Math.random() * action.length);
const indexWhat = Math.floor(Math.random() * what.length);
const indexWhen = Math.floor(Math.random() * when.length);

const excuseRandom = `${who[indexWho]} ${action[indexAction]} ${what[indexWhat]} ${when[indexWhen]}`;

//Cambiamos el id excuse del html
document.getElementById("excuse").innerText = excuseRandom;
};

//Variables con los strings
let who = ["Mi perro", "Jose", "Luis", "La clase 84"];
let action = ["se ha comido", "escondió", "destruyo", "me hizo chantaje con"];
let what = ["mi proyecto de excusas", "mi Ford Mustang", "mi tarjeta gráfica"];
let when = [
"mientras veía One Piece",
"mientras dormía",
"mientras estudiaba Javascript",
"durante una carrera de caracoles",
"durante Eurovisión",
];
55 changes: 31 additions & 24 deletions src/index.html
Original file line number Diff line number Diff line change
@@ -1,29 +1,36 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Hello Rigo with Vanilla.js</title>
<link
rel="stylesheet"
href="https://use.fontawesome.com/releases/v5.2.0/css/all.css"
integrity="sha384-hWVjflwFxL6sNzntih27bfxkr27PmbbK/iSvJ+a4+0owXq79v+lsFkW54bOGbiDQ"
crossorigin="anonymous"
/>
<link rel="shortcut icon" href="./4geeks.ico" />
</head>
<body>
<div class="container-fluid text-center">
<h1 class="mt-5">Hello Rigo!</h1>
<img src="./rigo-baby.jpg" />
<p class="alert alert-warning mt-4">
If this text is <b>not</b> centered and <b>yellow</b>, you probably have
an error

<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Generador de excusas</title>
<link rel="stylesheet" href="https://use.fontawesome.com/releases/v5.2.0/css/all.css"
integrity="sha384-hWVjflwFxL6sNzntih27bfxkr27PmbbK/iSvJ+a4+0owXq79v+lsFkW54bOGbiDQ" crossorigin="anonymous" />

<link href="https://stackpath.bootstrapcdn.com/bootstrap/4.5.2/css/bootstrap.min.css" rel="stylesheet" />
</head>

<body>
<div class="container align-items-center justify-content-center">
<row class="text-center">
<h1 class="mt-5">Generador de excusas!</h1>
<p id="excuse" class="alert alert-warning mt-4">
Esto es una excusa de deberes
</p>
<div class="fixed-bottom p-4">
<div>
<button id="reload" class="btn btn-primary" onclick="location.reload()">Recarga la página</button>
</div>

<div class="fixed-bottom p-4 text-center">
Made with ❤️ by
<a href="https://www.4geeksacademy.com">4Geeks Academy</a>
<a href="https://www.4geeksacademy.com">4Geeks Academy alumno Alex Perez</a>

</div>
</div>
</body>
</html>
</row>
</div>

<script src="app.js"></script>
</body>

</html>