Отзывчивая 3d сфера с тенью на CSS3

by Andrey Dobrovoi

HTML

<div class="circle"></div>

CSS

body {
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  width: 100vw;
  height: 100vh;
  background-color: #CFD8DC;
}

.circle {
  position: relative;
  width: 1em;
  height: 1em;
  background: radial-gradient(circle at 50% 115%, #bda7e3, #8259cb 10%, #46287d 80%, #261543 100%);
  font-size: 60vmin;
  border-radius: 50%;
}

.circle::before,
.circle::after {
  position: absolute;
  display: block;
  content: "";
}

.circle::before {
  bottom: 0;
  left: 0;
  z-index: -1;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.4);
  border-radius: 50%;
  -webkit-transform: translate(0, 50%) scale(1, 0.2);
          transform: translate(0, 50%) scale(1, 0.2);
  -webkit-filter: blur(0.15em);
          filter: blur(0.15em);
}

.circle::after {
  top: 50%;
  left: 50%;
  z-index: 1;
  width: 0.95em;
  height: 0.95em;
  background: #fff;
  background: radial-gradient(circle at 50% 0, #ffffff, rgba(255, 255, 255, 0) 50%);
  border-radius: 50%;
  -webkit-filter: blur(0.02em);
          filter: blur(0.02em);
  -webkit-transform: translate(-50%, -50%);
          transform: translate(-50%, -50%);
}

JavaScript

/* ========================================================================= */
/*	shurawi --- dbmast.ru ---
/* ========================================================================= */