Created
January 19, 2019 12:56
-
-
Save Cbarua/0e3a8d0232b7bdee3250f5768f40696b to your computer and use it in GitHub Desktop.
Two Nations Flag
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
<h1>Two nations flags</h1> | |
<h2>The Flag of <span>Bangladesh</span></h2> | |
<div class="container"> | |
<div class="circle"></div> | |
</div> | |
<button>Change Flag</button> |
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
var country = document.querySelector("span"); | |
var container = document.querySelector(".container"); | |
var btn = document.querySelector("button"); | |
btn.addEventListener("click", function() { | |
container.classList.toggle("japan"); | |
if(container.classList.value === "container japan"){ | |
country.textContent = "Japan" | |
} | |
}); |
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
* { | |
font-family: 'Raleway', sans-serif; | |
} | |
h1, h2 { | |
text-align: center; | |
} | |
.container { | |
margin: 5% auto; | |
box-sizing: border-box; | |
width: 400px; | |
height: 250px; | |
background: green; | |
position: relative; | |
transition: all 1s; | |
} | |
.circle { | |
margin: auto; | |
box-sizing: border-box; | |
position: absolute; | |
top: 50px; | |
right: 120px; | |
width: 150px; | |
height: 150px; | |
background: red; | |
border: 1px solid red; | |
border-radius: 50% | |
} | |
button { | |
position: absolute; | |
width: 150px; | |
height: 50px; | |
top: 70%; | |
left: 70%; | |
font-size: 20px; | |
font-weight: bold; | |
backgound: none; | |
border: none; | |
outline: none; | |
} | |
.japan { | |
background: white; | |
border: 1px solid #a3a3a3; | |
transition: all 1s; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment