Created
December 11, 2019 19:18
-
-
Save matthieua/a1067c5aee5851b6632055da028a0c9e to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<html> | |
<head> | |
<style> | |
section { | |
background-image: linear-gradient(to top, #37ecba 0%, #72afd3 100%); | |
padding: 40px; | |
max-width: 600px; | |
margin: 0 auto; | |
} | |
h1 { | |
color: white; | |
text-align: center; | |
font-size: 48px; | |
margin: 0; | |
} | |
h2 { | |
text-align: center; | |
font-size: 24px; | |
color: white; | |
} | |
img { | |
display: block; | |
margin: 0 auto; | |
border-radius: 5px; | |
} | |
a { | |
color: blue; | |
display: block; | |
text-align: center; | |
} | |
p { | |
text-align: center; | |
} | |
button { | |
display: block; | |
padding: 20px 30px; | |
background: #e1a762; | |
color: white; | |
font-size: 24px; | |
margin: 20px auto; | |
border-radius: 4px; | |
border: none; | |
box-shadow: 10px 10px 10px rgba(0, 0, 0, 0.3); | |
cursor: pointer; | |
} | |
</style> | |
</head> | |
<body> | |
<section> | |
<h1> | |
War and Peace | |
</h1> | |
<h2> | |
My favorite book | |
</h2> | |
<img | |
src="https://images4.penguinrandomhouse.com/cover/9781400079988" | |
alt="War and Peace book" | |
/> | |
<p> | |
War and Peace is a novel by the Russian author Leo Tolstoy, published | |
serially, then in its entirety in 1869. It is regarded as one of | |
Tolstoy's finest literary achievements | |
</p> | |
<a href="https://en.wikipedia.org/wiki/War_and_Peace"> | |
Read more on Wikipedia | |
</a> | |
<button> | |
Subscribe to newsletter | |
</button> | |
</section> | |
<script> | |
function subscribe() { | |
let email = prompt("What is your email?"); | |
let name = prompt("What is your first name?"); | |
alert( | |
`Thanks ${name}, we'll be in touch!, meanwhile enjoy the book 📗` | |
); | |
} | |
let button = document.querySelector("button"); | |
button.addEventListener("click", subscribe); | |
</script> | |
</body> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment