Skip to content

Instantly share code, notes, and snippets.

@barhouum7
Created April 4, 2020 04:59
Show Gist options
  • Save barhouum7/c2bd1f818aafaea0ef6f8280fd37fcbb to your computer and use it in GitHub Desktop.
Save barhouum7/c2bd1f818aafaea0ef6f8280fd37fcbb to your computer and use it in GitHub Desktop.
BackgroundColor Changer App
<h1>Background Color Changer</h1>
<button id="changeColor">Change Background</button>
<h3>Difficulty: Easy</h3>
<!-- My Game footer -->
<footer class="site-footer">
<div class="container">
<div class="row">
<div class="col-md-8 col-sm-6 col-xs-12">
<p class="copyright-text">Copyright &copy; 2020 All Rights Reserved by
<a href="#">IBHM IBRAHIM</a>.
</p>
</div>
<div class="col-md-4 col-sm-6 col-xs-12">
<ul class="social-icons">
<li><a class="facebook" href="#" target="_blank"><i class="fa fa-facebook"></i></a></li>
<li><a class="twitter" href="https://twitter.com/mindh4qr" target="_blank"><i class="fa fa-twitter"></i></a></li>
<li><a class="dribbble" href="#" target="_blank"><i class="fa fa-dribbble"></i></a></li>
<li><a class="linkedin" href="https://www.linkedin.com/in/ibrahimbs/" target="_blank"><i class="fa fa-linkedin"></i></a></li>
<li><a class="github" href="https://www.github.com/barhouum7/" target="_blank"><i class="fa fa-github"></i></a></li>
</ul>
</div>
</div>
</div>
</footer>
const btn = document.getElementById('changeColor');
const body = document.querySelector('body');
btn.addEventListener('click', () => {
body.classList.toggle('alt-color');
});
@import url('https://fonts.googleapis.com/css2?family=Anton&family=Montserrat&display=swap');
* {
padding: 0;
margin: 0;
box-sizing: border-box;
font-family: "Montserrat", sans-serif;
}
body {
margin: 0 auto;
background: #fa4242;
display: flex;
align-items: center;
justify-content: center;
flex-direction: column;
min-height: 100vh;
max-width: 500px;
transition: .3s ease-in-out;
}
h1 {
font-family: "Anton", sans-serif;
font-size: 5rem;
line-height: 1.1;
text-align: center;
color: #013034;
text-transform: uppercase;
}
button {
padding: 1rem 2rem;
margin: 5rem 0;
border: none;
border-radius: 2rem;
background-color: #171617;
color: white;
text-transform: uppercase;
cursor: pointer;
}
h3 {
text-transform: uppercase;
color: #013034;
}
.alt-color {
background-color: #0aa6b1;
}
.site-footer
{
background-color: rgba(38, 39, 43, .5);
padding: auto;
margin: 20px 0 20px;
font-size:15px;
line-height:60px;
color: #999595;
}
.site-footer a
{
color: #c99575;
font-family: Trebuchet MS;
font-size: 1.1rem;
}
.site-footer a:hover
{
color:#a3a6cc;
text-decoration:none;
}
.site-footer .social-icons
{
text-align:right;
}
.site-footer .social-icons a
{
width:40px;
height:40px;
line-height:40px;
margin-left:6px;
margin-right:0;
border-radius:100%;
background-color:#33353d;
}
.copyright-text
{
margin-top: 15px;
}
@media (max-width:991px)
{
.site-footer [class^=col-]
{
margin-bottom:20px
}
}
@media (max-width:767px)
{
.site-footer
{
padding-bottom:0
}
.site-footer .copyright-text,.site-footer .social-icons
{
text-align:center
}
}
.social-icons
{
padding-left:0;
margin-bottom:0;
list-style:none;
margin-top: 15px;
}
.social-icons li
{
display:inline-block;
margin-bottom: 0;
}
.social-icons a{
background-color:#eceeef;
color:#818a91;
font-size:16px;
display:inline-block;
line-height:44px;
width:44px;
height:44px;
text-align:center;
margin-right:8px;
border-radius:100%;
-webkit-transition:all .2s linear;
-o-transition:all .2s linear;
transition:all .2s linear
}
.social-icons a:active,.social-icons a:focus,.social-icons a:hover
{
color:#fff;
background-color:#29aafe
}
.social-icons a.facebook:hover
{
background-color:#3b5998
}
.social-icons a.twitter:hover
{
background-color:#00aced
}
.social-icons a.linkedin:hover
{
background-color:#007bb6
}
.social-icons a.dribbble:hover
{
background-color:#ea4c89
}
.social-icons a.github:hover
{
background-color:#696c89
}
@media (max-width:767px)
{
.social-icons li.title
{
display:block;
margin-right:0;
font-weight:600
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment