Skip to content

Visualize Your Ideas With Code

2.2 KB
Raw Blame
.root {
  width: 100%;
  height: 100%;

  display: flex;
  flex-direction: column;
}

.viewport {
  width: 100%;
  height: 100%;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  flex-grow: 1;

  background-color: #000000;

  canvas {
    display: block;
  }

  &.pixelated canvas {
    image-rendering: pixelated;
  }
}

.renderingPreview {
  canvas {
    max-width: 100%;
    max-height: 100%;
  }
}

.alphaBackground canvas {
  background-color: rgba(0, 0, 0, 0.16);
  background-size: 80px;
  background-position: center;
  background-image: url('../../img/grid.svg');
}

.overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
}

.playback {
  background: var(--surface-color);
  display: grid;
  grid-template-columns: 1fr min-content 1fr;
  padding: 12px;
}

.time {
  color: rgba(255, 255, 255, 0.54);
  text-align: left;
}

.duration {
  color: rgba(255, 255, 255, 0.54);
  text-align: right;
}

.frames {
  margin: 0 8px;
  color: rgba(255, 255, 255, 0.32);
}

.controls {
  --input-background: var(--surface-color);
  bottom: auto;
  right: auto;
  padding: 12px;
  gap: 8px;
  display: flex;
}

.coordinates {
  display: none;
  .viewport:hover & {
    display: block;
  }
}

.inspectorOverlay {
  pointer-events: none;
  position: absolute;
  top: 0;
  right: -424px;
  bottom: 0;
  padding: 12px;
  max-width: 424px;
  width: 40%;
  transition: right var(--duration-normal) var(--timing-ease-in-out);

  &.open {
    right: 0;
  }
}

.inspector {
  pointer-events: auto;
  height: 100%;
  border-radius: var(--radius);
  overflow: hidden;
}

.inspectorHeader {
  margin-right: auto;

  svg {
    rotate: 180deg;
  }
}

.inspectorButton {
  position: absolute;
  top: 12px;
  right: -28px;
  padding: 16px 28px 16px 4px;
  background-color: var(--surface-color);
  border-radius: 50%;
  transition-property: right, top, padding;
  transition-duration: var(--duration-normal);
  transition-timing-function: var(--timing-ease-in-out);

  svg {
    transition: rotate var(--duration-normal) var(--timing-ease-in-out);
    rotate: 180deg;
  }

  &.open {
    right: 24px;
    top: 20px;
    padding: 8px;

    svg {
      rotate: 0deg;
    }
  }
}