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

Save Automatically?

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

              
                .container
  .sky
    .text #CODEVEMBER
    .stars
    .stars1
    .stars2
    .shooting-stars
              
            
!

CSS

              
                $starFieldWidth: 2560
$starFieldHeight: 2560
$starStartOffset: 600px

$starOneScrollDuration: 100s
$starTwoScrollDuration: 125s
$starThreeScrollDuration: 175s
$numStarOneStars: 1700
$numStarTwoStars: 700
$numStarThreeStars: 200
$numShootingStars: 10
$width: 100%

html
  height: 100%
  body
    width: 100%
    height: 100%
    margin: 0
.container
  display: block
  position: relative
  width: 100%
  height: 100%
  background: linear-gradient(to bottom, #020107 0%, #201b46 100%)
  .text
    color: #FFF
    position: absolute
    top: 50%
    right: 50%
    margin: -10px -75px 0 0
    font-size: 20px
    font-family: sans-serif
    font-weight: bold
  
@function create-stars($n)

  $stars: "#{random($starFieldWidth)}px #{random($starFieldHeight)}px #FFF"

  @for $i from 2 through $n
    $stars: "#{$stars} , #{random($starFieldWidth)}px #{random($starFieldHeight)}px #FFF"

  @return unquote($stars)

@mixin star-template($numStars, $starSize, $scrollSpeed)
  z-index: 10
  width: $starSize
  height: $starSize
  border-radius: 50%
  background: transparent
  box-shadow: create-stars($numStars)
  animation: animStar $scrollSpeed linear infinite
  &:after
    content: " "
    top: -$starStartOffset
    width: $starSize 
    height: $starSize
    border-radius: 50%
    position: absolute
    backgroud: transparent
    box-shadow: create-stars($numStars)
    
  
@mixin shooting-star-template($numStars, $starSize, $speed)
  z-index: 10
  width: $starSize
  height: $starSize + 80px
  border-top-left-radius: 50%
  border-top-right-radius: 50%
  position: absolute
  bottom: 0
  right: 0
  background: linear-gradient(to top, rgba(255,255,255,0), rgba(255,255,255,1))
  animation: animShootingStar $speed linear infinite
  
.stars
  @include star-template($numStarOneStars, 1px, $starOneScrollDuration)
.stars1
  @include star-template($numStarTwoStars, 2px, $starTwoScrollDuration)
.stars2
  @include star-template($numStarThreeStars, 3px, $starThreeScrollDuration)
.shooting-stars
  @include shooting-star-template($numShootingStars, 5px, 10s)
    
@keyframes animStar
  from
    transform: translateY(0px)
  to
    transform: translateY(-#{$starFieldHeight}px) translateX(-#{$starFieldWidth}px)
    

@keyframes animShootingStar
  from
    transform: translateY(0px) translateX(0px) rotate(-45deg)
    opacity: 1
    height: 5px
  to
    transform: translateY(-#{$starFieldHeight}px) translateX(-#{$starFieldWidth}px) rotate(-45deg)
    opacity: 1
    height: 800px
  
    
              
            
!

JS

              
                
              
            
!
999px

Console