Untitled

mail@pastecode.io avatar
unknown
css
a year ago
803 B
3
Indexable
Never
// такой цсс 
// имхо тут не верно.. body.animate:before

body:before{
  content: '';
  position: fixed;
  width: 100%;
  height: 100%;
  background-color: #000;
  opacity: 0;
  z-index: -1;
  transition: 3s all;
}

.loader {
  opacity: 0;
  width: 48px;
  height: 48px;
  border: 5px solid#FFF;
  border-bottom-color: #FF3D00;
  border-radius: 50%;
  display: inline-block;
  box-sizing: border-box;
  animation: rotation 1s linear infinite;
}
body.animate:before {
opacity: 0.25;
z-index: 999;

.loader{
  opacity: 1;
  }

@keyframes rotation{
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(360deg);
  }
}
}

// js такой
$('.btn-main').on('click', function () {
	$('body').addStyle('animate');
}
)