- function random(min, max) {
-   return Math.round(Math.random() * (max - min)) + min;
- }
- function randDec(min, max) {
-   return random(min * 100, max * 100) / 100;
- }
- function randColor() {
-   let color = "";
-   for (let i = 0; i < 6; i++) {
-     color += random(0, 15).toString(16);
-   }
-   return color;
- }
- for (let i = 0; i < 100; i++)
  - let color = randColor();
  hr(style="--background-color: #" + color + "; " +
           "--top: " + randDec(10, 90) + "%; " +
           "--left: " + randDec(10, 90) + "%; " + 
           "--angle: " + random(0, 360) + "deg; " +
           "--content: \"This color is '#" + color + "'\";"
     title=color
     tabindex="0"
  )
View Compiled
@import url("https://fonts.googleapis.com/css?family=Montserrat:400,400i,700");

body {
  font-family: Montserrat, sans-serif;
  background-color: #1f1f1f;
  width: 100vw;
  height: 100vh;
  overflow: hidden;
  position: relative;
  &:after {
    content: "Click on the sticks! :)";
    background-color: #ffffff;
    padding: 20px 30px;
    position: absolute;
    top: 20px;
    left: 20px;
    z-index: 3;
    box-shadow: 0 0.25vmin 0.75vmin rgba(#000000, 0.5);
  }
}

hr {
  background-color: var(--background-color);
  width: 60vmin;
  height: 0.75vmin;
  margin: 0;
  border: none;
  outline: none;
  display: flex;
  align-items: center;
  justify-content: center;
  position: absolute;
  top: var(--top);
  left: calc(var(--left) - 30vmin);
  box-shadow: 0 0.25vmin 0.75vmin rgba(#000000, 0.5);
  transform: rotate(var(--angle));
  transition:
    width 375ms cubic-bezier(0.18, 0.89, 0.32, 1.28),
    height 375ms cubic-bezier(0.18, 0.89, 0.32, 1.28),
    top 375ms cubic-bezier(0.18, 0.89, 0.32, 1.28),
    left 375ms cubic-bezier(0.18, 0.89, 0.32, 1.28),
    box-shadow 375ms cubic-bezier(0.18, 0.89, 0.32, 1.28),
    transform 375ms cubic-bezier(0.18, 0.89, 0.32, 1.28);
  &:hover {
    transform: rotate(var(--angle))
      scaleX(1.5)
      scaleY(3.5);
    z-index: 1;
  }
  &:before {
    content: var(--background-color);
  }
  &:focus {
    width: 50vw;
    height: 50vh;
    top: calc(50% - 25vh);
    left: calc(50% - 25vw);
    transform: rotate(0deg);
    z-index: 2;
    box-shadow: 0 2vmin 4vmin rgba(#000000, 0.5);
    &:before {
      content: var(--content);
      color: #202020;
      text-align: center;
      background-color: #ffffff;
      padding: 20px 30px;
      margin: 0 20px;
      display: block;
      box-shadow: 0 0.4vmin 0.8vmin rgba(#000000, 0.3);
    }
  }
}
View Compiled
// Nothing to do here...

External CSS

This Pen doesn't use any external CSS resources.

External JavaScript

This Pen doesn't use any external JavaScript resources.