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

              
                <div class="stars"></div>
<p class="blue">A long time ago in a galaxy far, far away....</p>
<div class="logo"></div>
<div class="crawl">
  <p class="center">Episode IV</p>
  <p class="center">A New Hope</p>
  <p>It is a period of civil war. Rebel spaceships, striking from a hidden base, have won their first victory against the evil Galactic Empire.</p>
  <p>During the battle, Rebel spies managed to steal secret plans to the Empire's ultimate weapon, the DEATH STAR, an armored space station with enough power to destroy an entire planet.</p>
  <p>Pursued by the Empire's sinister agents, Princess Leia races home aboard her starship, custodian of the stolen plans that can save her people and restore freedom to the galaxy....</p>
</div>
              
            
!

CSS

              
                // n is number of stars required
@function star-generator ($n) {
  // $value: '#{random(2000)}px #{random(2000)}px #FFF';
  $value: "#{random(2000)}px #{random(2000)}px #FFF";
  @for $i from 2 through $n {
    // $value: '#{$value} , #{random(2000)}px #{random(2000)}px #FFF';
    $value: "#{$value}, #{random(2000)}px #{random(2000)}px #FFF";
  }
  @return unquote($value);
  // @return #{$value};
  // @return $value;
}
@mixin element($width,$height:$width,$radius:$width,$background:transparent) { // creates a element element and requires width, then sets the height and radius if you don't pass them (defaults to a circle)
  background:$background;
  border-radius:$radius;
  content:"";
  display:block;
  height:$height;
  width:$width;
}
$shadows-small: star-generator(700);
$shadows-medium: star-generator(200);
$shadows-big: star-generator(100);

* {
  box-sizing:border-box; /* Box sizing. Thanks Chris Coyier! */
  position:relative;
}
body {
  background:#000;
  // background:radial-gradient(ellipse at bottom, #1b1b1b 0%, #0a0a0a 100%);
  // display:block;
  height:100vh;
  // overflow:hidden;
  // perspective:1000;
  text-align:center;
  
  // background-image:
  //   radial-gradient(2px 2px at 20px 30px, rgba(#fff,.6), rgba(#000, 0)), 
  //   radial-gradient(2px 2px at 40px 70px, rgba(#fff,.7), rgba(#000, 0)), 
  //   radial-gradient(2px 2px at 50px 160px, rgba(#fff,.5), rgba(#000, 0)), 
  //   radial-gradient(2px 2px at 90px 40px, rgba(#fff,.3), rgba(#000, 0)), 
  //   radial-gradient(2px 2px at 130px 80px, rgba(#fff,.5), rgba(#000, 0)), 
  //   radial-gradient(2px 2px at 160px 120px, rgba(#fff,.8), rgba(#000, 0)),
  //   ;
  // background-repeat: repeat;
  // background-size: 200px 200px;
  // content: "";
  // display: block;
  // height: 100vh;
  // position: absolute;
  // width: 100%;
}
body > * {
}
.stars {
  @include element(1px);
  animation:fade 120s linear 1 reverse;
  box-shadow: $shadows-small;
  // display:none;
  &:before {
    @extend .stars;
    @include element(2px);
    box-shadow: $shadows-medium;
  }
  &:after {
    @extend .stars;
    @include element(3px);
    box-shadow: $shadows-big;
  }
}
.blue {
  // animation:fade 5s linear infinite;
  animation:fade 5s linear 1;
  color:#0b43ff;
  // display:none;
  font-family:"Open Sans";
  font-size:6vmax;
  font-size:4em;
  font-weight:700;
  height:25vh;
  line-height:1.4;
  margin:auto;
  max-width:55vw;
  min-width:50vw;
  opacity:0;
  text-align:left;
  top:35vh;
}
.logo {
  // animation:fly 10s linear infinite;
  animation:fly 10s linear 1 7s;
  background-image:url("https://upload.wikimedia.org/wikipedia/commons/thumb/6/6c/Star_Wars_Logo.svg/694px-Star_Wars_Logo.svg.png");
  background-repeat:no-repeat;
  background-size:cover;
  background-position:center;
  bottom:0;
  // display:none;
  left:0;
  position:absolute;
  right:0;
  top:0;
  /* background-size:0; */
  height:100vh;
  visibility:hidden;
}
.crawl {
  // background:tomato;
  // bottom:0;
  font-size:2.75vmax;
  height:auto;
  height:10vmax;
  // left:20vw;
  margin:0 25vmax;
  // overflow:hidden;
  position:fixed;
  // right:20vw;
  text-align:justify;
  // transform:perspective(40em) rotateX(70deg);
  transform:perspective(100vmax) rotateX(70deg);
  transform-origin:bottom;
  // top:20rem;
  /* width:18em; */
  // width:80vmax;
  // &:before {
  //   @include element(100%,25%,0);
  //   background:
  //     linear-gradient(#0a0a0a,transparent)
  //     ;
  //   z-index:100;
  // }
}
.crawl p {
  // animation:crawl 10s linear infinite;
  animation:crawl 60s linear 1 0s; /* Put the animation on the p tag to make it follow the skewed shape. */
  // bottom:10vmax;
  bottom:-100vmax;
  color:#ffd032;
  font:700 1em/1.4em "Open Sans";
  // height:100%;
  margin:2vmax auto;
  position:relative;
  transform-origin:bottom;
  width:100%;
  // z-index:0;
  // &:before {
  //   @include element(100%,25%,0,dodgerblue);
  //   background:
  //     linear-gradient(blue,purple)
  //     ;
  //   position:absolute;
  //   z-index:100;
  // }
}
.center {
  text-align:center;
}
.center + .center {
  text-transform:uppercase;
}
img {
}
@keyframes fade {
  30% {opacity:1;}
  70% {opacity:1;}
  100% {opacity:0;}
}
@keyframes fly {
  from {
    background-size:100vmax;
    visibility:visible;
  }
  to {
    background-size:0vmax;
  }
}
@keyframes crawl {
  0% {
    bottom:-100vmax;
    /* visibility:visible; */
  }
  100% {
    bottom:70vmax;
  }
}

              
            
!

JS

              
                
              
            
!
999px

Console