Make quotes work on homepage

main
Jeffrey Elkner 1 year ago
parent 8d80f506f9
commit 765e29092e

Binary file not shown.

After

Width:  |  Height:  |  Size: 753 B

@ -6,6 +6,7 @@
<link href='https://fonts.googleapis.com/css?family=Ubuntu' rel='stylesheet'>
<link href='https://fonts.googleapis.com/css?family=Ubuntu%20Condensed'
rel='stylesheet'>
<link rel="icon" type="image/x-icon" href="../images/favicon.ico">
<title>Welcome to elkner.net!</title>
<style>
@import url(css/elknernet.css);
@ -18,18 +19,19 @@ function reportScreenWidth() {
}
function showQuote() {
console.log(quotes);
let qnum = Math.floor(Math.random() * quotes.length);
let quoteElem = document.getElementById("quote");
let quoteAuthor = document.getElementById("qauthor");
quoteElem.innerHTML = quotes[0].quote;
quoteAuthor.innerHTML = quotes[0].author;
quoteElem.innerHTML = quotes[qnum].quote;
quoteAuthor.innerHTML = quotes[qnum].author;
}
function init() {
showQuote();
reportScreenWidth();
}
window.onload = init;
window.onload = reportScreenWidth;
window.onresize = reportScreenWidth;
</script>
</head>

@ -1,40 +0,0 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Quotes</title>
<style>
@import url(css/elknernet.css);
</style>
<script src="js/quotes.js"></script>
<script>
function showQuote() {
let mainElem = document.getElementById("quotes");
console.log(mainElem);
mainElem.innerHTML = "Hellooooooo there ;-)";
}
function init() {
let loc = window.location.href;
let HTMLvalidLinkStr = 'http://validator.w3.org/check?uri=' + loc;
let CSSvalidLinkStr = 'http://jigsaw.w3.org/css-validator/validator?uri=' +
loc + '?profile=css3';
document.getElementById("vLink1").setAttribute("href", HTMLvalidLinkStr);
document.getElementById("vLink2").setAttribute("href", CSSvalidLinkStr);
showQuote();
}
window.onload = init;
</script>
</head>
<body>
<h1>Quotes</h1>
<main id="quotes">
</main>
<footer>
<a id="vLink1">
<strong> HTML </strong> Valid! </a> &nbsp;
<a id="vLink2">
<strong> CSS </strong> Valid! </a>
</footer>
</body>
</html>
Loading…
Cancel
Save