JSFiddle - React, Tailwind, and code Playground
by fredd man
HTML
<div id="banner-message">
<iframe src="https://www.google.com/maps/embed?pb=!1m18!1m12!1m3!1d804.6208737006102!2d-71.54647696242472!3d-16.402288593560392!2m3!1f0!2f0!3f0!3m2!1i1024!2i768!4f13.1!3m3!1m2!1s0x91424a5e52d0af5b%3A0x4a8371fa1ad68c2a!2sManuel%20Aguirre%2C%20Arequipa%2004013!5e0!3m2!1sen!2spe!4v1595589743061!5m2!1sen!2spe" width="600" height="450" frameborder="0" style="border:0;" allowfullscreen="" aria-hidden="false" tabindex="0"></iframe>
</div>
<script>
// find elements
var banner = $("#banner-message")
var button = $("button")
// handle click and add class
button.on("click", () => {
banner.toggleClass("alt")
})
</script>
<style>
body {
background: #20262E;
padding: 20px;
font-family: Helvetica;
}
.banner-message.alt {
font-family: Arial, Helvetica, sans-serif;
background: rgba(0, 0, 0, 0.8);
z-index: 99999;
opacity:0;
-webkit-transition: opacity 400ms ease-in;
-moz-transition: opacity 400ms ease-in;
transition: opacity 400ms ease-in;
pointer-events: none;
}
.banner-message.alt:target {
opacity:1;
pointer-events: auto;
}
.banner-message.alt > div {
width: 85%;
position: relative;
margin: 10% auto;
padding: 5px 20px 13px 20px;
border-radius: 10px;
background: #fff;
background: -moz-linear-gradient(#fff, #999);
background: -webkit-linear-gradient(#fff, #999);
background: -o-linear-gradient(#fff, #999);
}
.close {
background: #606061;
color: #FFFFFF;
line-height: 25px;
position: absolute;
right: -12px;
text-align: center;
top: -10px;
width: 24px;
text-decoration: none;
font-weight: bold;
-webkit-border-radius: 12px;
-moz-border-radius: 12px;
border-radius: 12px;
-moz-box-shadow: 1px 1px 3px #000;
-webkit-box-shadow: 1px 1px 3px #000;
box-shadow: 1px 1px 3px #000;
}
.close:hover {
background: #00d9ff;
}
</style>