LOADING...

Preview

Pen ID
Unlock Campus Themeforest adv

 

Code
BG MixMaster - 90 CSS • HTML • JS
Vue Components
A:{{track.y}}
B:{{track.x}}
Saturation {{color.s}}%
{{currentColor}}
Luminance {{color.l}}%
{{translator[currentKey]}}
×
A
BG MM-90 Code CSS4
Custom Properties
Now Playing:
B

Playlist

  • {{item.name}}
CSS
@import url("https://fonts.googleapis.com/css?family=Pontano+Sans|Covered+By+Your+Grace");
:root {
  --base: #363639;
  --base-light: #464649;
  --base-dark: #262629;
  --base-shade: #303033;
  --base-text: #7db69d;
  --label: #e9dfde;
  --label-text: #b18373;
  --accent: rgba(35, 35, 35, 0.7);
  --button: rgba(40, 40, 43, 0.7);
}

body {
  background-image: -webkit-repeating-linear-gradient(var(--a), rgba(var(--bg-rgb), 0) 0, var(--line-y), var(--c2) calc(var(--y) - var(--l)), var(--c2) var(--y)), -webkit-repeating-linear-gradient(var(--b), rgba(var(--bg-rgb), 0) 0, var(--line-x), var(--c1) calc(var(--x) - var(--l)), var(--c1) var(--x));
  background-image: repeating-linear-gradient(var(--a), rgba(var(--bg-rgb), 0) 0, var(--line-y), var(--c2) calc(var(--y) - var(--l)), var(--c2) var(--y)), repeating-linear-gradient(var(--b), rgba(var(--bg-rgb), 0) 0, var(--line-x), var(--c1) calc(var(--x) - var(--l)), var(--c1) var(--x));
  background-color: var(--bg);
  background-size: var(--size);
}

*, *::before, *::after {
  box-sizing: border-box;
}

body {
  margin: 0;
  height: 100vh;
  font-family: 'Pontano Sans', Helvetica, sans-serif;
  display: -webkit-box;
  display: -ms-flexbox;
  display: flex;
}

main {
  -webkit-box-flex: 1;
      -ms-flex: 1;
          flex: 1;
  display: -webkit-box;
  display: -ms-flexbox;
  display: flex;
  -webkit-box-pack: center;
      -ms-flex-pack: center;
          justify-content: center;
  -webkit-box-align: center;
      -ms-flex-align: center;
          align-items: center;
}

button,
select {
  border: none;
  border: 1px inset var(--button);
  padding: .7em 1em;
  border-radius: .35em;
  color: #fff;
  font: inherit;
  background: var(--button);
  cursor: pointer;
  outline: none;
  will-change: transform;
  -webkit-transition: -webkit-transform 200ms ease-out;
  transition: -webkit-transform 200ms ease-out;
  transition: transform 200ms ease-out;
  transition: transform 200ms ease-out, -webkit-transform 200ms ease-out;
}
button:active,
select:active {
  -webkit-transform: scale(0.9);
          transform: scale(0.9);
}
button[disabled],
select[disabled] {
  opacity: .7;
  cursor: not-allowed;
}

::-webkit-input-placeholder {
  opacity: .4;
  font-family: 'Pontano Sans', Helvetica, sans-serif;
  font-size: .7em;
  color: var(--label-text);
}

::-moz-placeholder {
  opacity: .4;
  font-family: 'Pontano Sans', Helvetica, sans-serif;
  font-size: .7em;
  color: var(--label-text);
}

:-ms-input-placeholder {
  opacity: .4;
  font-family: 'Pontano Sans', Helvetica, sans-serif;
  font-size: .7em;
  color: var(--label-text);
}

::placeholder {
  opacity: .4;
  font-family: 'Pontano Sans', Helvetica, sans-serif;
  font-size: .7em;
  color: var(--label-text);
}

.menu select {
  -webkit-appearance: none;
     -moz-appearance: none;
          appearance: none;
  display: inline-block;
  padding: .4em;
  font-size: inherit;
  text-transform: uppercase;
  color: inherit;
  border: none;
  background: rgba(0, 0, 0, 0.1);
  border-radius: .2em;
}

.cue {
  width: 7em;
  height: 7em;
  padding: 1em;
  display: -webkit-box;
  display: -ms-flexbox;
  display: flex;
  -webkit-box-align: center;
      -ms-flex-align: center;
          align-items: center;
  -webkit-box-pack: center;
      -ms-flex-pack: center;
          justify-content: center;
  cursor: pointer;
  will-change: transform;
  -webkit-transition: -webkit-transform 200ms cubic-bezier(1, 0, 0.2, 1.25);
  transition: -webkit-transform 200ms cubic-bezier(1, 0, 0.2, 1.25);
  transition: transform 200ms cubic-bezier(1, 0, 0.2, 1.25);
  transition: transform 200ms cubic-bezier(1, 0, 0.2, 1.25), -webkit-transform 200ms cubic-bezier(1, 0, 0.2, 1.25);
}
.cue:active {
  -webkit-transform: scale(0.9);
          transform: scale(0.9);
}
.cue svg {
  fill: var(--c2-contrast);
}

label {
  display: block;
  padding: .3em;
}

textarea {
  font-size: 1.2em;
  font-family: monospace;
  padding: .5em;
  width: 100%;
  height: 100%;
  border: 1px solid #000;
  resize: none;
  -webkit-box-flex: 1;
      -ms-flex: 1;
          flex: 1;
  outline: none;
  background: var(--accent);
  color: rgba(255, 255, 255, 0.7);
}

.input-text {
  width: 100%;
  font-size: 2em;
  font-family: 'Covered By Your Grace', fantasy, serif;
  color: #5c69c2;
  border: 0;
  background: transparent;
  padding: 0em .5em;
  line-height: 1;
  outline: none;
}

.color-well {
  width: 2.75em;
  height: 2.75em;
  padding: 0;
  border-radius: 50%;
  overflow: hidden;
  border: 0.3em solid var(--base-shade);
  box-shadow: 0 0 0 1px #000 inset, 0 0.3em 1em rgba(0, 0, 0, 0.8) inset;
  cursor: pointer;
  -webkit-transform: translateZ(1em);
          transform: translateZ(1em);
}
.color-well.color-bg {
  background: var(--bg);
}
.color-well.color-a {
  background: var(--c2);
}
.color-well.color-b {
  background: var(--c1);
}
.color-well input[type=color] {
  opacity: 0;
  font-size: 0;
}

header {
  font-size: 1.3em;
  font-weight: 200;
  -webkit-box-flex: 1;
      -ms-flex: 1;
          flex: 1;
}

.controls {
  position: relative;
  -webkit-box-flex: 1;
      -ms-flex: 1;
          flex: 1;
  display: -webkit-box;
  display: -ms-flexbox;
  display: flex;
  -webkit-box-orient: vertical;
  -webkit-box-direction: normal;
      -ms-flex-direction: column;
          flex-direction: column;
  border: 3px solid var(--base);
  border-color: var(--base-dark) var(--base-light) var(--base-light) var(--base-dark);
  box-shadow: 0 0 1.5em -.5em #000 inset;
  overflow: hidden;
}
.controls section {
  z-index: 1;
}

section {
  display: -webkit-box;
  display: -ms-flexbox;
  display: flex;
  -webkit-box-align: center;
      -ms-flex-align: center;
          align-items: center;
}
section > * {
  display: -webkit-box;
  display: -ms-flexbox;
  display: flex;
}

.height-100 {
  height: 100%;
}

.row {
  display: -webkit-box;
  display: -ms-flexbox;
  display: flex;
}

.flex-1 {
  -webkit-box-flex: 1;
      -ms-flex: 1;
          flex: 1;
}

.flex-2 {
  -webkit-box-flex: 2;
      -ms-flex: 2;
          flex: 2;
}

.column {
  display: -webkit-box;
  display: -ms-flexbox;
  display: flex;
  -webkit-box-orient: vertical;
  -webkit-box-direction: normal;
      -ms-flex-direction: column;
          flex-direction: column;
}

.space-around {
  -ms-flex-pack: distribute;
      justify-content: space-around;
}

.center {
  -webkit-box-pack: center;
      -ms-flex-pack: center;
          justify-content: center;
}

.align-center {
  -webkit-box-align: center;
      -ms-flex-align: center;
          align-items: center;
}

.switch {
  cursor: pointer;
}
.switch input {
  opacity: 0;
  position: absolute;
}
.switch input + * {
  display: inline-block;
  padding: .4em;
  color: inherit;
  background: rgba(0, 0, 0, 0.1);
  border-radius: .2em;
}
.switch input:checked + * {
  background: var(--accent);
}
.switch button {
  display: inline-block;
  text-transform: uppercase;
  padding: .4em;
  margin: .3em;
  color: inherit;
  background: rgba(0, 0, 0, 0.1);
  border-radius: .2em;
  border: none;
  white-space: nowrap;
}

.rad-slider {
  --degree: 0deg;
  --degree-reverse: calc(0deg - var(--degree));
  position: relative;
  display: -webkit-box;
  display: -ms-flexbox;
  display: flex;
  -webkit-box-align: center;
      -ms-flex-align: center;
          align-items: center;
  -webkit-box-pack: center;
      -ms-flex-pack: center;
          justify-content: center;
  margin: 0em;
  border-radius: 50%;
  -webkit-transform: rotate(var(--degree));
          transform: rotate(var(--degree));
}
.rad-slider .label {
  -webkit-user-select: none;
     -moz-user-select: none;
      -ms-user-select: none;
          user-select: none;
  pointer-events: none;
  -webkit-transform: rotate(var(--degree-reverse));
          transform: rotate(var(--degree-reverse));
}
.rad-slider:hover {
  cursor: -webkit-grab;
}
.rad-slider.moving {
  cursor: -webkit-grabbing;
}

.rad-slider:not(.dirty) .label {
  opacity: 1;
}
.rad-slider .label {
  position: absolute;
  left: 50%;
  top: 5%;
  width: 6em;
  height: 6em;
  display: -webkit-box;
  display: -ms-flexbox;
  display: flex;
  -webkit-box-align: center;
      -ms-flex-align: center;
          align-items: center;
  -webkit-box-pack: center;
      -ms-flex-pack: center;
          justify-content: center;
  -webkit-transition: opacity 2000ms linear 2000ms;
  transition: opacity 2000ms linear 2000ms;
  opacity: .5;
  -webkit-transform: translate(-50%, -100%) rotate(var(--degree-reverse));
          transform: translate(-50%, -100%) rotate(var(--degree-reverse));
}
.rad-slider:hover .label {
  -webkit-transition-duration: 600ms;
          transition-duration: 600ms;
  -webkit-transition-delay: 0ms;
          transition-delay: 0ms;
  opacity: 1;
}
.rad-slider[name=a] {
  border-top-color: var(--c2);
}
.rad-slider[name=b] {
  border-top-color: var(--c1);
}

.spool {
  width: 12em;
  height: 12em;
  box-shadow: 0 0 0 .15em inset, 0 0 0 .15em, 0 0 0 4.5em #26292c;
  border: .9em double;
  border-top: .9em solid orange;
}

.color-wheel {
  width: 12em;
  height: 12em;
  border: .9em solid;
  box-shadow: 0 0 .3em -.15em #000, 0 0 .3em -.15em #000 inset;
}

.color-wheel span {
  pointer-events: none;
  -webkit-user-select: none;
     -moz-user-select: none;
      -ms-user-select: none;
          user-select: none;
  position: absolute;
  text-align: center;
  top: 50%;
  left: 50%;
  width: 80%;
  -webkit-transform: translate(-50%, -50%) rotate(var(--degree-reverse));
          transform: translate(-50%, -50%) rotate(var(--degree-reverse));
}
.color-wheel::before {
  content: '';
  position: absolute;
  top: .5em;
  left: 50%;
  -webkit-transform: translate(-50%, -1em);
          transform: translate(-50%, -1em);
  width: .65em;
  height: 2em;
  border-radius: 1em;
  background: currentColor;
}

.spool[name=a] {
  --handle-color: var(--c2);
}
.spool[name=b] {
  --handle-color: var(--c1);
}
.spool > div {
  width: 65%;
  pointer-events: none;
}
.spool span {
  pointer-events: none;
  -webkit-user-select: none;
     -moz-user-select: none;
      -ms-user-select: none;
          user-select: none;
  position: absolute;
  top: 35%;
  left: 65%;
  -webkit-transform: rotate(var(--degree-reverse));
          transform: rotate(var(--degree-reverse));
}
.spool input[type="range"] {
  -webkit-transform: rotate(-90deg);
          transform: rotate(-90deg);
  pointer-events: all;
}

input[type="range"] {
  -webkit-appearance: none;
     -moz-appearance: none;
          appearance: none;
  outline: none;
  padding: 0;
  border: 0;
  width: 100%;
  height: .5em;
  border-radius: 1em;
  cursor: pointer;
  box-shadow: 0 0 .3em -.15em #000;
}
input[type="range"]::-moz-range-track {
  -moz-appearance: none;
       appearance: none;
  background: #fff;
  outline: none;
}
input[type="range"]::-moz-focus-outer {
  border: 0;
}
input[type="range"]::-moz-range-thumb {
  -moz-appearance: none;
       appearance: none;
  width: 2em;
  height: 2em;
  border: none;
  box-shadow: 0 0 0.3em -0.15em #000, 0 0 0 0.5em var(--handle-color);
  border-radius: 1em;
  background: #fff;
  transform: scale(0.7);
  -webkit-transition: .3s ease-out;
  transition: .3s ease-out;
}
input[type="range"]::-moz-range-thumb:focus, input[type="range"]::-moz-range-thumb:active {
  -moz-appearance: none;
       appearance: none;
  transform: scale(1.1);
}
input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
          appearance: none;
  width: 2em;
  height: 2em;
  border: none;
  box-shadow: 0 0 0.3em -0.15em #000, 0 0 0 0.5em var(--handle-color);
  border-radius: 1em;
  background: #fff;
  -webkit-transform: scale(0.8);
          transform: scale(0.8);
  -webkit-transition: .3s ease-out;
  transition: .3s ease-out;
}
input[type="range"]::-webkit-slider-thumb:focus, input[type="range"]::-webkit-slider-thumb:active {
  -webkit-appearance: none;
          appearance: none;
  -webkit-transform: scale(1.1);
          transform: scale(1.1);
}
input[type="range"][disabled] {
  opacity: .3;
  cursor: not-allowed;
}
input[type="range"][disabled]::-moz-range-thumb {
  box-shadow: none;
}
input[type="range"][disabled]::-webkit-slider-thumb {
  box-shadow: none;
}

.params input[type=range] {
  background: var(--label-text);
}
.params input[type=range]::-moz-range-track {
  background: var(--label-text);
}
.params input[type=range]::-moz-range-thumb {
  background: var(--label-text);
  box-shadow: 0 0 0 0.25em var(--handle-color);
}
.params input[type=range]::-webkit-slider-thumb {
  background: var(--label-text);
  box-shadow: 0 0 0 0.25em var(--handle-color);
}

.palette input[type=range] {
  background: var(--contrast);
}
.palette input[type=range]::-moz-range-track {
  background: var(--contrast);
}
.palette input[type=range]::-moz-range-thumb {
  background: var(--contrast);
  box-shadow: 0 0 0 0.25em var(--handle-color);
}
.palette input[type=range]::-webkit-slider-thumb {
  background: var(--contrast);
  box-shadow: 0 0 0 0.25em var(--handle-color);
}

@-webkit-keyframes show-off {
  to {
    -webkit-transform: rotate3D(0.5, 0.5, 0.3, -360deg);
            transform: rotate3D(0.5, 0.5, 0.3, -360deg);
  }
}

@keyframes show-off {
  to {
    -webkit-transform: rotate3D(0.5, 0.5, 0.3, -360deg);
            transform: rotate3D(0.5, 0.5, 0.3, -360deg);
  }
}
.skin .modal__wrapper {
  background: none;
  font-size: 12px;
  -webkit-animation: show-off 900ms cubic-bezier(1, 0, 0.2, 1.25);
          animation: show-off 900ms cubic-bezier(1, 0, 0.2, 1.25);
}
.skin .modal__header {
  background: var(--base);
  color: var(--base-text);
  border-radius: 1em 1em 0 0;
}
.skin .modal__body {
  border-left: 3em solid var(--base);
  border-right: 3em solid var(--base);
  padding: 0;
  display: -webkit-box;
  display: -ms-flexbox;
  display: flex;
}
.skin .modal__footer {
  background: var(--base);
  border-radius: 0 0 1em 1em;
  padding: 4.5em 2em 2em 2em;
  -webkit-perspective: 20em;
          perspective: 20em;
}
.skin .modal__footer::before, .skin .modal__footer::after {
  content: '';
  position: absolute;
  width: 1em;
  height: 10em;
  bottom: 4em;
  background: var(--base-shade);
}
.skin .modal__footer::before {
  right: 100%;
  border-radius: 1em 0 0 1em;
}
.skin .modal__footer::after {
  left: 100%;
  border-radius: 0 1em 1em 0;
}
.skin .model {
  font-size: 2em;
  font-weight: 900;
  letter-spacing: -1px;
  text-transform: uppercase;
  padding-left: 1ch;
  display: -webkit-box;
  display: -ms-flexbox;
  display: flex;
  -webkit-box-align: center;
      -ms-flex-align: center;
          align-items: center;
}
.skin .model small {
  font-size: 45%;
  letter-spacing: 0;
  line-height: 1;
  margin-left: 1ch;
}
.skin .params {
  --handle-color: var(--label);
  border: 1px inset #555;
  margin: .3em;
  padding: .2em;
  border-radius: .3em;
  text-transform: uppercase;
  font-size: .85em;
}
.skin .params > * {
  -webkit-box-flex: 1;
      -ms-flex: 1;
          flex: 1;
  display: -webkit-box;
  display: -ms-flexbox;
  display: flex;
  background: var(--label);
  color: var(--label-text);
  border-radius: .2em;
  box-shadow: -1px -1px 0 0 rgba(0, 0, 0, 0.3) inset;
}
.skin .front .params > * {
  margin-left: .3em;
  -webkit-transform: rotate(0.35deg);
          transform: rotate(0.35deg);
}
.skin .front .case {
  -webkit-box-orient: horizontal;
  -webkit-box-direction: normal;
      -ms-flex-direction: row;
          flex-direction: row;
}
.skin .back .params > * {
  margin-right: .3em;
  -webkit-transform: rotate(-0.25deg);
          transform: rotate(-0.25deg);
}
.skin .back .case {
  -webkit-box-orient: vertical;
  -webkit-box-direction: normal;
      -ms-flex-direction: column;
          flex-direction: column;
}
.skin .back .now-playing {
  position: absolute;
  top: .5em;
  left: .5em;
}
.skin .back .input-text {
  padding-left: 4em;
  padding-right: 2.5em;
}

.palette {
  --handle-color: var(--color);
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: var(--color);
  color: var(--contrast);
  -webkit-transform: translateY(100%);
          transform: translateY(100%);
  -webkit-transition: background 300ms linear, -webkit-transform 300ms ease-out;
  transition: background 300ms linear, -webkit-transform 300ms ease-out;
  transition: transform 300ms ease-out, background 300ms linear;
  transition: transform 300ms ease-out, background 300ms linear, -webkit-transform 300ms ease-out;
  display: -webkit-box;
  display: -ms-flexbox;
  display: flex;
  -webkit-box-align: stretch;
      -ms-flex-align: stretch;
          align-items: stretch;
}
.palette.open {
  -webkit-transform: translateY(0%);
          transform: translateY(0%);
}
.palette__x {
  cursor: pointer;
  font-size: 4em;
  line-height: 0;
  opacity: .4;
  position: absolute;
  top: 0.35em;
  right: 0.35em;
}
.palette__key {
  position: absolute;
  top: 2em;
  left: 2em;
  text-transform: uppercase;
  font-weight: bold;
}

.modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  display: -webkit-box;
  display: -ms-flexbox;
  display: flex;
  -webkit-box-align: center;
      -ms-flex-align: center;
          align-items: center;
  -webkit-box-pack: center;
      -ms-flex-pack: center;
          justify-content: center;
}
.modal__mask {
  background: rgba(252, 23, 112, 0.5);
  position: absolute;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
}
.modal__wrapper {
  font-size: 1vmax;
  position: relative;
  width: 52em;
  height: 36em;
  background: rgba(0, 0, 0, 0.3) url(https://s-media-cache-ak0.pinimg.com/originals/60/da/b5/60dab5db582f2a48dd55955dc4297080.jpg) no-repeat 50% 50%;
  background-size: cover;
  color: #fff;
  display: -webkit-box;
  display: -ms-flexbox;
  display: flex;
  border-radius: 1em;
  box-shadow: 0 2em 5em -1em #000;
}
.modal__container {
  -webkit-box-flex: 1;
      -ms-flex: 1;
          flex: 1;
  display: -webkit-box;
  display: -ms-flexbox;
  display: flex;
  -webkit-box-orient: vertical;
  -webkit-box-direction: normal;
      -ms-flex-direction: column;
          flex-direction: column;
}
.modal__header {
  display: -webkit-box;
  display: -ms-flexbox;
  display: flex;
  -webkit-box-pack: justify;
      -ms-flex-pack: justify;
          justify-content: space-between;
  -webkit-box-align: center;
      -ms-flex-align: center;
          align-items: center;
  padding: 1em 1.5em;
}
.modal__header * {
  margin: 0;
}
.modal__body {
  -webkit-box-flex: 1;
      -ms-flex: 1;
          flex: 1;
  overflow: auto;
}
.modal__footer {
  position: relative;
}
.modal__footer > * {
  -webkit-box-orient: horizontal;
  -webkit-box-direction: reverse;
      -ms-flex-direction: row-reverse;
          flex-direction: row-reverse;
  display: -webkit-box;
  display: -ms-flexbox;
  display: flex;
  -webkit-box-pack: justify;
      -ms-flex-pack: justify;
          justify-content: space-between;
}
.modal__x {
  cursor: pointer;
  font-size: 4em;
  line-height: 0;
  opacity: .4;
  position: absolute;
  top: 0.35em;
  right: 0.35em;
}

.front .modal__body {
  overflow: hidden;
}
.front .modal__body .controls {
  background: rgba(0, 0, 0, 0.5);
}
.front .modal__body .controls::before, .front .modal__body .controls::after {
  content: '';
  position: absolute;
  top: 0;
  bottom: 0;
  z-index: 0;
}
.front .modal__body .controls::before {
  background: rgba(0, 0, 0, 0.2);
  width: 11em;
  left: 50%;
  -webkit-transform: translateX(-50%);
          transform: translateX(-50%);
}
.front .modal__body .controls::after {
  left: 0;
  right: 0;
  border-left: 5.5em solid rgba(0, 0, 0, 0.2);
  border-right: 5.5em solid rgba(0, 0, 0, 0.2);
}

.button-leave-active,
.modal-enter-active {
  -webkit-transition: -webkit-transform 500ms cubic-bezier(1, 0, 0.2, 1.5);
  transition: -webkit-transform 500ms cubic-bezier(1, 0, 0.2, 1.5);
  transition: transform 500ms cubic-bezier(1, 0, 0.2, 1.5);
  transition: transform 500ms cubic-bezier(1, 0, 0.2, 1.5), -webkit-transform 500ms cubic-bezier(1, 0, 0.2, 1.5);
}

.modal-leave-active,
.button-enter-active {
  -webkit-transition: -webkit-transform 500ms cubic-bezier(1, -0.5, 0.2, 1);
  transition: -webkit-transform 500ms cubic-bezier(1, -0.5, 0.2, 1);
  transition: transform 500ms cubic-bezier(1, -0.5, 0.2, 1);
  transition: transform 500ms cubic-bezier(1, -0.5, 0.2, 1), -webkit-transform 500ms cubic-bezier(1, -0.5, 0.2, 1);
}

.mask-enter-active, .mask-leave-active {
  -webkit-transition: opacity 300ms linear;
  transition: opacity 300ms linear;
}

.mask-enter, .mask-leave-to {
  opacity: 0;
}

.button-enter, .button-leave-to,
.modal-enter, .modal-leave-to {
  -webkit-transform: scale(0);
          transform: scale(0);
}

.flip-container {
  -webkit-perspective: 85vmax;
          perspective: 85vmax;
}
.flip-container.flip-me .flipper {
  -webkit-transform: rotateY(-180deg);
          transform: rotateY(-180deg);
}

.flipper {
  -webkit-transition: 1000ms cubic-bezier(1, -0.2, 0.2, 1.2);
  transition: 1000ms cubic-bezier(1, -0.2, 0.2, 1.2);
  -webkit-transform-style: preserve-3d;
          transform-style: preserve-3d;
  position: relative;
}
.flipper .front,
.flipper .back {
  -webkit-backface-visibility: hidden;
  backface-visibility: hidden;
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
}
.flipper .front {
  -webkit-transform: rotateY(0deg);
          transform: rotateY(0deg);
}
.flipper .back {
  -webkit-transform: rotateY(-180deg);
          transform: rotateY(-180deg);
}

.side {
  margin-top: -.7em;
  width: 1.3em;
  height: 1.3em;
  border: 1px inset #555;
  border-radius: .1em;
  display: -webkit-box;
  display: -ms-flexbox;
  display: flex;
  -webkit-box-align: center;
      -ms-flex-align: center;
          align-items: center;
  -webkit-box-pack: center;
      -ms-flex-pack: center;
          justify-content: center;
  font-size: 4em;
  font-weight: 900;
  color: var(--base-dark);
  opacity: .5;
}

.trap {
  position: absolute;
  z-index: -1;
  bottom: 0;
  border: 0.7em solid var(--base);
  border-color: var(--base-light) var(--base-dark) var(--base-dark) var(--base-light);
  border-bottom-width: 0;
  width: 65%;
  height: 8em;
  left: 50%;
  -webkit-transform-style: preserve-3d;
          transform-style: preserve-3d;
  -webkit-transform: translateX(-50%) rotateX(30deg);
          transform: translateX(-50%) rotateX(30deg);
  background-image: -webkit-repeating-linear-gradient(315deg, rgba(54, 54, 57, 0) 0, #222 7px, #222 6px, #222 7px), -webkit-repeating-linear-gradient(45deg, rgba(54, 54, 57, 0) 0, #666 7px, #666 6px, #666 7px);
  background-image: repeating-linear-gradient(135deg, rgba(54, 54, 57, 0) 0, #222 7px, #222 6px, #222 7px), repeating-linear-gradient(45deg, rgba(54, 54, 57, 0) 0, #666 7px, #666 6px, #666 7px);
  background-color: var(--base);
  background-size: 100%;
}

.track-list {
  position: absolute;
  top: 0;
  right: 0;
  color: #fff;
  cursor: pointer;
  border-radius: 0 0 0 .4em;
  overflow: hidden;
}
.track-list h4 {
  margin: 0;
  padding: 1ch;
  font-weight: 100;
  background: rgba(0, 0, 0, 0.4);
}
.track-list ul {
  margin: 0;
  padding: 0;
  box-shadow: 0 -1px 0 0 rgba(0, 0, 0, 0.1);
  background: rgba(0, 0, 0, 0.3);
  box-shadow: 0 0 1.5em -0.5em rgba(0, 0, 0, 0.2);
}
.track-list li {
  list-style: none;
  margin: 0;
  padding: 1ch;
  display: -webkit-box;
  display: -ms-flexbox;
  display: flex;
  -webkit-box-align: baseline;
      -ms-flex-align: baseline;
          align-items: baseline;
  white-space: nowrap;
}
.track-list li:hover {
  box-shadow: 0 0 2em 0 rgba(0, 0, 0, 0.2) inset;
}
.track-list li .fa {
  margin-right: 1ch;
}

[drawer] + * {
  max-height: 0;
  max-width: 0;
  overflow: hidden;
  -webkit-transition: 270ms ease-out;
  transition: 270ms ease-out;
  opacity: 0;
}

[drawer].open + * {
  opacity: 1;
  max-height: 500px;
  max-width: 500px;
}
JS
Vue.component('modal', {
  template: `
    
      
    
  `,
  props: [
    'showX',
    'showMask',
    'flipMe'
  ]
})

Vue.component('rad-slider', {
  template: `
    
{{degree}}°
`, props: { name: { type: String, required: true }, degree: { type: Number, default: 0 }, lockWith: { type: String }, eventName: { type: String, required: true } }, data: function(){ return { moving: false, dirty: false, delta: 0, buddy: null, previousDegree: this.degree } }, mounted: function(){ this.processDegree(this.degree, this.degree) if(this.lockWith){ this.buddy = document.querySelector('.rad-slider[name="'+this.lockWith+'"]') } }, updated: function(){ this.processDegree(this.degree, this.degree) }, methods: { getPointerDeg: function(e){ let x = e.touches && e.touches.length ? e.touches[0].clientX : e.clientX let y = e.touches && e.touches.length ? e.touches[0].clientY : e.clientY return Math.floor(Math.atan2(x - (this.metrics.left + this.metrics.width/2), y - (this.metrics.top + this.metrics.height/2))*(-180/Math.PI)) + 180 }, processDegree: function(value, previousValue){ this.degree = (value >= 360 ? value - 360 : (value < 0 ? value + 360 : value)) this.$el.style.setProperty('--degree', this.degree + 'deg') this.delta = this.degree - previousValue this.$emit(this.eventName, this.name, this.degree, this.delta, this.lockWith, this.buddy) }, start: function(e){ this.moving = true this.dirty = true this.metrics = e.target.getBoundingClientRect() this.pointer = this.getPointerDeg(e) - this.degree this.previousDegree = this.degree }, move: function(e){ if(this.moving){ let step = 1 let input = this.getPointerDeg(e) if(e.shiftKey && e.metaKey){ step = 45 } else if(e.shiftKey){ step = 15 } else if(e.metaKey){ step = 30 } this.degree = Math.ceil((this.getPointerDeg(e) - this.pointer) / step) * step if(this.previousDegree !== this.degree){ this.processDegree(this.degree, this.previousDegree) } this.previousDegree = this.degree } }, stop: function(e){ this.moving = false } } }) let _units = [ 'vmax', 'vmin', 'vw', 'vh', '%', 'em', 'px' ] let _translator = { c1: 'color B', c2: 'color A', bg: 'background' } let _tracks = [ { name: 'Basket Case', a: 305, b: 220, x: 75, y: 75, l: 5, lockstep: false, lineY: false, lineX: false, isolate: false, c1: '#9959cf', c2: '#40ccde', bg: '#e783b1', size: '100% 100%', line_y: 'var(--c2) var(--y)', line_x: 'var(--c1) var(--x)', unit_x: 'vmax', unit_y: 'vmax', unit_l: 'px' }, { name: 'Because I Said So', a: 0, b: 90, x: 2, y: 2, l: 2, lockstep: true, lineY: true, lineX: true, isolate: true, c1: '#dbf7ff', c2: '#dbf7ff', bg: '#ffffff', size: 'var(--x) var(--y)', line_y: 'var(--c2) var(--y)', line_x: 'var(--c1) var(--x)', unit_x: 'em', unit_y: 'em', unit_l: 'px' }, { name: 'College Rules', a: 0, b: 270, x: 85, y: 2, l: 3, lockstep: true, lineY: true, lineX: true, isolate: false, c1: '#ffebf3', c2: '#dbf7ff', bg: '#ffffff', size: '100% 100%', line_y: 'rgba(0,0,0, 0) calc(var(--y) - var(--l))', line_x: 'rgba(0,0,0, 0) calc(var(--x) - var(--l))', unit_x: 'vw', unit_y: 'em', unit_l: 'px' } ] let vm = new Vue({ el: 'main', data: { showModal: true, showMask: false, showX: true, flipMe: false, isPaletteOpen: false, currentKey: null, currentColor: '', color: { h: 0, s: 0, l: 0 }, tracks: _tracks, units: _units, translator:_translator, track: {}, params: {} }, mounted: function(){ this.playTrack(this.tracks[0].name) }, methods: { setSize: function(track){ track.size = (track.isolate ? `${track.x}${track.unit_x} ${track.y}${track.unit_y}`:'100% 100%') this.foo('size', track.size, '') }, setLineY: function(track){ let bg = this.hex2rgb(track.bg) if(track.lineY) { track.line_y = `rgba(${bg.r},${bg.g},${bg.b}, 0) calc(${track.y}${track.unit_y} - ${track.l}${track.unit_l})` //, rgba(${bg.r},${bg.g},${bg.b}, 0) ${track.y}${track.unit_y}` } else { track.line_y = `${track.c2} ${track.y}${track.unit_y}` } this.foo('line-y', track.line_y, '') }, setLineX: function(track){ let bg = this.hex2rgb(track.bg) if(track.lineX) { track.line_x = `rgba(${bg.r},${bg.g},${bg.b}, 0) calc(${track.x}${track.unit_x} - ${track.l}${track.unit_l})` //, rgba(${bg.r},${bg.g},${bg.b}, 0) ${track.x}${track.unit_x}` } else { track.line_x = `${track.c1} ${track.x}${track.unit_x}` } this.foo('line-x', track.line_x, '') }, setY: function(track){ this.foo('y', track.y, track.unit_y) this.setSize(track) this.setLineY(track) }, setX: function(track){ this.foo('x', track.x, track.unit_x) this.setSize(track) this.setLineX(track) }, setLine: function(track){ this.foo('l', track.l, track.unit_l) this.setLineY(track) this.setLineX(track) }, setXYUnit: function(track, key){ this.foo('unit-'+key, track.unit+"_"+key, '') this.setX(track) this.setY(track) }, setLUnit: function(track, key){ this.foo('unit-'+key, track.unit+"_"+key, '') this.setLine(track) }, setParams: function(track){ let bg = this.hex2rgb(track.bg) return { title: '', editors: '010', css: `body { min-height: 100vh; background-image: repeating-linear-gradient(${track.a}deg, rgba(${bg.r},${bg.g},${bg.b}, 0) 0, ${track.line_y}, ${track.c2} calc(${track.y}${track.unit_y} - ${track.l}${track.unit_l}), ${track.c2} ${track.y}${track.unit_y} ), repeating-linear-gradient(${track.b}deg, rgba(${bg.r},${bg.g},${bg.b}, 0) 0, ${track.line_x}, ${track.c1} calc(${track.x}${track.unit_x} - ${track.l}${track.unit_l}), ${track.c1} ${track.x}${track.unit_x} ); background-color: ${track.bg}; background-size: ${track.size}; }` } }, togglePlaylist: function(event){ event.target.classList.toggle('open') }, playTrack: function(name){ this.hidePalette() let track = this.tracks.find(function(item){ return item.name === name }) this.track = JSON.parse(JSON.stringify(track)) // cheap clone this.foo('a', this.track.a, 'deg') this.foo('b', this.track.b, 'deg') this.foo('c1', this.track.c1, '') this.foo('c2', this.track.c2, '') this.foo('bg', this.track.bg, '') this.foo('x', this.track.x, this.track.unit_x) this.foo('y', this.track.y, this.track.unit_y) this.foo('l', this.track.l, this.track.unit_l) this.setSize(this.track) this.setLineY(this.track) this.setLineX(this.track) }, foo: function(key, value, unit){ this.track[key] = value document.documentElement.style.setProperty('--' + key, value + unit) if(key === 'bg') { let rgbObject = this.hex2rgb(value) let rgb = `${rgbObject.r}, ${rgbObject.g}, ${rgbObject.b}` document.documentElement.style.setProperty('--' + key + '-rgb', rgb) } if(key == 'c1' || key === 'c2' || key === 'bg') { let contrast = this.brightness(value) < 165 ? '#fff' : '#212126'; document.documentElement.style.setProperty('--contrast', contrast) document.documentElement.style.setProperty('--' + key + '-contrast', contrast) } }, toggleModal: function(){ this.hidePalette() this.showModal = !this.showModal if(!this.showModal && this.flipMe){ this.flipModal() } }, flipModal: function(){ this.flipMe = !this.flipMe if(this.flipMe) { this.params = this.setParams(this.track) } }, rotate: function(name, degree, delta, lockWith, buddy){ this.foo(name, degree, 'deg') if(this.track.lockstep && buddy) { this.track[lockWith] += delta this.track[lockWith] = (this.track[lockWith] >= 360 ? this.track[lockWith] - 360 : (this.track[lockWith] < 0 ? this.track[lockWith] + 360 : this.track[lockWith])) buddy.style.setProperty('--degree', this.track[lockWith] + 'deg') this.foo(lockWith, this.track[lockWith], 'deg') } }, showPalette: function(key){ this.isPaletteOpen = true this.currentKey = key let hex = this.track[this.currentKey] this.color = this.hex2hsl(hex) this.updateColor(this.color) }, hidePalette: function(){ this.isPaletteOpen = false this.currentKey = null }, togglePalette: function(key){ if(key !== this.currentKey || !this.isPaletteOpen) { this.showPalette(key) } else { this.hidePalette() } }, updateColor: function(hsl){ this.currentColor = this.hsl2hex(parseInt(hsl.h), parseInt(hsl.s), parseInt(hsl.l)) this.foo(this.currentKey, this.currentColor, '') this.setLineY(this.track) this.setLineX(this.track) }, updateHue: function(name, degree){ this.color.h = degree this.updateColor(this.color) }, hex2rgb: function(hex){ if(hex) { hex = hex.replace('#', '') var r = (parseInt(hex.substring(0, 2), 16)|0) var g = (parseInt(hex.substring(2, 4), 16)|0) var b = (parseInt(hex.substring(4, 6), 16)|0) return {r:r, g:g, b:b} } }, rgb2hsl: function(r, g, b) { r /= 255, g /= 255, b /= 255 let max = Math.max(r, g, b), min = Math.min(r, g, b) let h, s, l = (max + min) / 2 if(max == min) { h = s = 0; // achromatic } else { let d = max - min s = l > 0.5 ? d / (2 - max - min) : d / (max + min) switch(max) { case r: h = (g - b) / d + (g < b ? 6 : 0); break; case g: h = (b - r) / d + 2; break; case b: h = (r - g) / d + 4; break; } } h = Math.floor(h*60+0.5)|0 s = Math.floor(s*100+0.5)|0 l = Math.floor(l*100+0.5)|0 return {h:h, s:s, l:l}; }, hex2hsl: function(hex) { let rgb = this.hex2rgb(hex) let hsl = this.rgb2hsl(rgb.r, rgb.g, rgb.b) return hsl }, hue2rgb: function(p, q, t){ if(t < 0) t += 1 if(t > 1) t -= 1 if(t < 1/6) return p + (q - p) * 6 * t if(t < 1/2) return q if(t < 2/3) return p + (q - p) * (2/3 - t) * 6 return p }, hsl2rgb: function(h, s, l){ let r, g, b, q, p h /= 360 s /= 100 l /= 100 if(s === 0) { r = g = b = l // achromatic } else { q = l < 0.5 ? l * (1 + s) : l + s - l * s p = 2 * l - q r = this.hue2rgb(p, q, h + 1/3) g = this.hue2rgb(p, q, h) b = this.hue2rgb(p, q, h - 1/3) } r = Math.min(Math.floor(r*256), 255) g = Math.min(Math.floor(g*256), 255) b = Math.min(Math.floor(b*256), 255) return {r:r, g:g, b:b} }, rgb2hex: function(r, g, b){ r = ('0' + parseInt(r).toString(16)).substr(-2) g = ('0' + parseInt(g).toString(16)).substr(-2) b = ('0' + parseInt(b).toString(16)).substr(-2) return '#'+r+''+g+''+b }, hsl2hex: function(h, s, l){ let rgb = this.hsl2rgb(h, s, l) return this.rgb2hex(rgb.r, rgb.g, rgb.b) }, brightness: function(hex) { let r = parseInt(hex.slice(1, 3), 16) let g = parseInt(hex.slice(3, 5), 16) let b = parseInt(hex.slice(5, 7), 16) return (r * 299 + g * 587 + b * 114) / 1000 } } })
Host Instantly Drag and Drop Website Builder

 

Description

I started out trying to make a background grid (like graph paper) using only one background gradient property and ended up with this killer mix tape for making all kinds of background grids and patterns.
Term
Mon, 11/27/2017 - 22:01

Related Codes

Pen ID
Pen ID
Pen ID