Pen Settings

HTML

CSS

CSS Base

Vendor Prefixing

Add External Stylesheets/Pens

Any URLs added here will be added as <link>s in order, and before the CSS in the editor. You can use the CSS from another Pen by using its URL and the proper URL extension.

+ add another resource

JavaScript

Babel includes JSX processing.

Add External Scripts/Pens

Any URL's added here will be added as <script>s in order, and run before the JavaScript in the editor. You can use the URL of any other Pen and it will include the JavaScript from that Pen.

+ add another resource

Packages

Add Packages

Search for and use JavaScript packages from npm here. By selecting a package, an import statement will be added to the top of the JavaScript editor for this package.

Behavior

Auto Save

If active, Pens will autosave every 30 seconds after being saved once.

Auto-Updating Preview

If enabled, the preview panel updates automatically as you code. If disabled, use the "Run" button to update.

Format on Save

If enabled, your code will be formatted when you actively save your Pen. Note: your code becomes un-folded during formatting.

Editor Settings

Code Indentation

Want to change your Syntax Highlighting theme, Fonts and more?

Visit your global Editor Settings.

HTML

              
                - title = 'Shiny Diamond'
- reference_post = 'https://dribbble.com/shots/5759838-Yaaas'
- reference_post_title = 'Yaaas!'
- author_name = 'Fraser Davidson'
- author_profile = 'https://dribbble.com/fraserdavidson'


figure
  .figure-content
  
    .diamond-wrap
      .diamond
      
        .diamond-side-top
          each sharp in Array(8)
            .diamond-top-sharp

        .diamond-side-bottom
          each sharp in Array(4)
            .diamond-bottom-sharp
              .diamond-bottom-sharp-color

    each _, i in Array(10)  
      .shine(id="shine-" + (i + 1))
        each sharp in Array(6)
          .shine-flare

  br

  figcaption
    strong.figcaption-title= title
    br
    .figcaption-description
      | inspired in
      |
      a.figcaption-hyperlink(href=reference_post target='_blank')
        = reference_post_title
      |
      | by
      |
      a.figcaption-hyperlink(href=author_profile target='_blank')
        = author_name

              
            
!

CSS

              
                .diamond-top-sharp:nth-child(1) {
  --color-start: #FB84A4;
}
.diamond-top-sharp:nth-child(2) {
  --color-start: #FFF;
  --color-middle: #FB84A4;
  --color-end: #FFF;
}
.diamond-top-sharp:nth-child(3) {
  --color-start: #FCD259;
  --color-middle: #FFF;
  --color-end: #FB84A4;
}
.diamond-top-sharp:nth-child(4) {
  --color-start: #F23B95;
  --color-middle: #FCD259;
  --color-end: #FFF;
}
.diamond-top-sharp:nth-child(5) {
  --color-start: #FB84A4;
  --color-middle: #F23B95;
  --color-end: #FCD259;
}
.diamond-top-sharp:nth-child(6) {
  --color-start: #FCD259;
  --color-middle: #FFEE8F;
  --color-end: #F23B95;
}
.diamond-top-sharp:nth-child(7) {
  --color-start: #FFEE8F;
  --color-middle: #FFF;
  --color-end: #FCD259;
}

.diamond-bottom-sharp:nth-child(1) {
  --color-start: #FFF;
  --color-middle: #FCD259;
  --color-end: #FFF;
}
.diamond-bottom-sharp:nth-child(2) {
  --color-start: #F23B95;
  --color-end: #FFF;
}
.diamond-bottom-sharp:nth-child(3) {
  --color-start: #FCD259;
  --color-middle: #FFF;
  --color-end: #F23B95;
}
.diamond-bottom-sharp:nth-child(4) {
  --color-start: #FB84A4;
  --color-middle: #F23B95;
  --color-end: #FCD259;
}

.shine:nth-child(1) {
  --offsetX: 80px;
  --offsetY: -100px;
}
.shine:nth-child(2) {
  --offsetX: 50px;
  --offsetY: 100px;
  --delay: 0.58721384s;
}
.shine:nth-child(3) {
  --offsetX: -75px;
  --scale: 1.5;
  --delay: 1.5318943s;
}
.shine:nth-child(4) {
  --offsetX: -100px;
  --offsetY: 50px;
  --delay: 1.55671289767s;
}
.shine:nth-child(5) {
  --offsetX: -150px;
  --offsetY: -50px;
  --scale: 0.75;
  --delay: 2.78632786123s;
}
.shine:nth-child(6) {
  --offsetX: 50px;
  --scale: 1.25;
  --delay: 2.584384531587s;
}
.shine:nth-child(7) {
  --offsetX: 150px;
  --offsetY: 50px;
  --scale: 0.5;
  --delay: 3.12738954s;
}
.shine:nth-child(8) {
  --offsetX: -25px;
  --offsetY: 25px;
  --delay: 3.5296732197s;
}
.shine:nth-child(9) {
  --offsetY: -100px;
  --delay: 4.19782464s;
}
.shine:nth-child(10) {
  --offsetX: -50px;
  --offsetY: 100px;
  --scale: 0.5;
  --delay: 4.541272397s;
}

.figure-content {
  background-color: #FABACB;
  display: flex;
  justify-content: center;
  align-items: center;
}

.diamond-wrap {
  filter: drop-shadow(0 0 20px #FFF) drop-shadow(0 0 0 #FFF);
  animation: diamond-shiny 1s infinite alternate;
}
@keyframes diamond-shiny {
  to {
    filter: drop-shadow(0 0 50px #FFF) drop-shadow(0 0 20px #FFF);
  }
}

.diamond {
  width: 400px;
  height: 350px;
  clip-path: polygon(0 100px, 70px 0, 330px 0, 400px 100px, 200px 350px);
  transform: scale(0.6);
}

.diamond-side-top {
  animation: diamond-side-top 1s linear infinite;
  display: flex;
}
@keyframes diamond-side-top {
  to {
    margin-left: -133.3333333333px;
  }
}

.diamond-top-sharp {
  width: 133.3333333333px;
  height: 100px;
  background-color: var(--color-start);
  animation: color-shine 1s linear infinite;
  flex: 0 0 auto;
}
.diamond-top-sharp + .diamond-top-sharp {
  margin-left: calc(-400px / 6);
}
.diamond-top-sharp:nth-child(even) {
  clip-path: polygon(0 0, 100% 0, 50% 100%);
}

.diamond-side-bottom {
  display: flex;
}

.diamond-bottom-sharp {
  width: 400px;
  height: 250px;
  flex: 0 0 auto;
}
.diamond-bottom-sharp:nth-child(1) {
  clip-path: polygon(0% 0, 33.3333333333% 0, 50% 100%);
  animation: diamond-bottom-sharp-0 1s linear infinite;
}
@keyframes diamond-bottom-sharp-0 {
  to {
    clip-path: polygon(-33.3333333333% 0, 0% 0, 50% 100%);
  }
}
.diamond-bottom-sharp:nth-child(2) {
  clip-path: polygon(33.3333333333% 0, 66.6666666667% 0, 50% 100%);
  animation: diamond-bottom-sharp-1 1s linear infinite;
}
@keyframes diamond-bottom-sharp-1 {
  to {
    clip-path: polygon(0% 0, 33.3333333333% 0, 50% 100%);
  }
}
.diamond-bottom-sharp:nth-child(3) {
  clip-path: polygon(66.6666666667% 0, 100% 0, 50% 100%);
  animation: diamond-bottom-sharp-2 1s linear infinite;
}
@keyframes diamond-bottom-sharp-2 {
  to {
    clip-path: polygon(33.3333333333% 0, 66.6666666667% 0, 50% 100%);
  }
}
.diamond-bottom-sharp:nth-child(4) {
  clip-path: polygon(100% 0, 133.3333333333% 0, 50% 100%);
  animation: diamond-bottom-sharp-3 1s linear infinite;
}
@keyframes diamond-bottom-sharp-3 {
  to {
    clip-path: polygon(66.6666666667% 0, 100% 0, 50% 100%);
  }
}
.diamond-bottom-sharp + .diamond-bottom-sharp {
  margin-left: -400px;
}

.diamond-bottom-sharp-color {
  width: 100%;
  height: 100%;
  background-color: var(--color-start);
  animation: color-shine 1s linear infinite;
}
@keyframes color-shine {
  50% {
    background-color: var(--color-middle, var(--color-start));
  }
  to {
    background-color: var(--color-end, var(--color-start));
  }
}

.shine {
  margin: var(--offsetY, 0) 0 0 var(--offsetX, 0);
  transform: scale(var(--scale, 1));
  position: absolute;
}

.shine-flare {
  width: 8px;
  height: 24px;
  margin: -24px 0 0 -4px;
  background-color: #FFF;
  border-radius: 4px;
  animation: shine-flare 2.4348764s ease-out infinite both;
  animation-delay: var(--delay, 0);
  transform: rotate(var(--angle, 0deg)) translateY(0);
  transform-origin: center bottom;
  visibility: hidden;
  position: absolute;
}
.shine-flare:nth-child(0) {
  --angle: 0deg;
}
.shine-flare:nth-child(1) {
  --angle: 72deg;
}
.shine-flare:nth-child(2) {
  --angle: 144deg;
}
.shine-flare:nth-child(3) {
  --angle: 216deg;
}
.shine-flare:nth-child(4) {
  --angle: 288deg;
}
@keyframes shine-flare {
  1% {
    visibility: visible;
  }
  8% {
    width: 8px;
    transform: rotate(var(--angle, 0deg)) translateY(-42px);
  }
  16% {
    width: 0;
    height: 0;
    transform: rotate(var(--angle, 0deg)) translateY(-54px);
    visibility: hidden;
  }
}

body {
  height: 100vh;
  background: #212;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
}

figcaption {
  margin: 0 5px;
  color: #FFF;
  font-size: 16px;
  font-weight: 300;
  font-family: "Roboto", sans-serif;
  position: absolute;
}

.figcaption-title {
  font-size: 1.3em;
}

.figcaption-hyperlink {
  color: #7FC;
}

.figure-content {
  width: 600px;
  height: 350px;
  border: 1px solid #333;
  border-radius: 2px;
  overflow: hidden;
  user-select: none;
  cursor: default;
}
              
            
!

JS

              
                // Looking for something?

              
            
!
999px

Console