Pen Settings

HTML

CSS

CSS Base

Vendor Prefixing

Add External Stylesheets/Pens

Any URL's added here will be added as <link>s in order, and before the CSS in the editor. If you link to another Pen, it will include the CSS from that Pen. If the preprocessor matches, it will attempt to combine them before processing.

+ 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

              
                .dragon-radar
  %label.dragon-radar-button{for: 'screen-toggle'}
    .dragon-radar-button__knob
  %input#screen-toggle{type: 'checkbox'}
  .radar-screen
    .radar-screen__content--positions
      .current-position
      .ball-indicators
        .ball-indicator 2
        .ball-indicator 
        .ball-indicator 4
    .radar-screen__content--tracking
      .tracking-motion
        .ball-indicator 1
        .tracking-line
          - (1..12).each do |i|
            .track-indicator
    

              
            
!

CSS

              
                @import "bourbon"

=block($w, $h)
  display: block
  width: $w
  height: $h

// --- colors
$color-background: linear-gradient(#00a3cc, darken(#00a3cc, 20%))
$color-radar-body: #efefef
$color-screen-background: #009900
$color-screen-lines: #003300
$color-current-position: #cc0000
$color-ball-indicator: #ffff66
$color-brightness: lighten($color-ball-indicator, 20%)

// --- fonts
$font-radar: arial, helvetica, sans-serif

// --- global styles
body
  background: $color-background
 
input
  display: none
  
// --- radar general styling
.dragon-radar
  +block(50vh, 50vh)
  +transform(translateX(-50%) translateY(-50%) rotate(-25deg))
  +radial-gradient($color-radar-body 50%, darken($color-radar-body, 90%))
  border-radius: 50%
  box-shadow: inset 1vh -2vh 0px 0px transparentize(darken($color-radar-body, 40%), .4)
  margin: 50vh 0 0 50vw
  position: relative

  
.dragon-radar-button
  +block(10vh, 7vh)
  +border-bottom-radius(3vh)
  +transform(translateX(-50%) translateY(-65%))
  +radial-gradient($color-radar-body, darken($color-radar-body, 20%))
  box-shadow: inset 1vh -1vh 1vh .2vh darken($color-radar-body, 20%)
  cursor: pointer
  position: absolute
  left: 50%
  
  &:before
    +triangle(3vh 6.5vh, darken($color-radar-body, 25%), down-right)
    +transform(translateX(-95%))
    content: ''
    position: absolute

  &:after
    +triangle(3vh 6.5vh, darken($color-radar-body, 20%), down-left)
    +transform(translateX(95%))
    content: ''
    position: absolute
    right: 0


.dragon-radar-button__knob
  +block(10vh, 4vh)
  +border-top-radius(4.5vh)
  +transform(translateY(-130%))
  +radial-gradient($color-radar-body, darken($color-radar-body, 20%))
  +transition(transform .1s)
  box-shadow: inset 1vh -1vh 1vh .2vh darken($color-radar-body, 20%)
  position: absolute
  
  &:after
    +block(70%, 31%)
    +transform(translateX(-50%))
    +transition(height .1s)
    +linear-gradient(darken($color-radar-body, 50%), $color-radar-body)
    content: ''
    position: absolute
    top: 100%
    left: 50%
    z-index: 0
  
//  States for knob button
.dragon-radar-button:hover .dragon-radar-button__knob
  +transform(translateY(-150%))
  &:after
    height: 50% 
    
.dragon-radar-button:active .dragon-radar-button__knob
  +transform(translateY(-100%))
  &:after
    height: 0
  
// --- Screen styling
.radar-screen
  +block(85%, 85%)
  +transform(translateX(-50%) translateY(-50%) rotate(25deg))
  border: 1vh solid darken($color-radar-body, 35%)
  box-shadow: inset 0vh 0vh 5vh .2vh darken($color-screen-background, 30%)
  position: absolute
  top: 50%
  left: 50%
  border-radius: 50%
  background-color: $color-screen-background
  background-image: linear-gradient($color-screen-lines 0vh, transparent .2vh), linear-gradient(90deg, $color-screen-lines 0vh, transparent .2vh)
  background-size: 4.4vh 4.4vh
  overflow: hidden
  
  #screen-toggle:checked + &
    background-size: 6vh 6vh
    
// --- content designs
%radar-screen__content
  +block(100%, 100%)
  border-radius: 50%
  position: absolute
  
.radar-screen__content--positions
  @extend %radar-screen__content
  
  
.current-position
  +triangle(4vh 3vh, $color-current-position, up)
  +transform(translateX(-45%) translateY(-50%))
  content: ''
  position: absolute
  top: 50%
  left: 50%

%ball-indicator
  +animation(shadow-pulse 1.2s $ease-in-out-cubic)
  +animation-iteration-count(infinite)
  +block(2.6vh, 2.6vh)
  opacity: 0
  background: $color-ball-indicator
  border-radius: 50%
  color: $color-ball-indicator
  font-family: $font-radar
  font-size: 4vh
  text-indent: 3vh
  line-height: 5vh
  position: absolute
  
.ball-indicator
  @extend %ball-indicator
  
  .radar-screen__content--positions &
    &:nth-child(1)
      left: 10%
      top: 20%
    &:nth-child(2)
      left: 50%
      top: 35%
    &:nth-child(3)
      top: 80%
      left: 25%
    
  .radar-screen__content--tracking &
    +block(3.6vh, 3.6vh)
    +transform(translateX(-50%) translateY(-50%))
    text-indent: 4.5vh
    top: 50%
    left: 50%
    
.tracking-line
  +block(100%, 100%)
  position: relative
  top: -3vh
  
.track-indicator 
  +triangle(3vh, $color-ball-indicator, down)
  +animation(arrow-pulse 1.2s $ease-in-out-cubic)
  +animation-iteration-count(infinite)
  position: absolute
  top: 50%
  left: 50%
  
  @for $i from 0 through 12
    &:nth-child(#{$i})
      +transform(translateX($i * 3vh) translateY($i * -4vh) rotate(40deg))
  
.tracking-motion
  +block(100%, 100%)
  +animation(tracking-move 6s $ease-in-out-cubic)
  +animation-iteration-count(infinite)
  +transform(translateX(0) translateY(0))
  position: absolute
  
// --- animations
+keyframes(tracking-move)
  0%
    opacity: 1
    +transform(translateX(20%) translateY(-20%))
  90%, 95%
    opacity: 1
    +transform(translateX(-20%) translateY(20%))
  98%
    +transform(translateX(-20%) translateY(20%))
  99%
    opacity: 0
    +transform(translateX(0) translateY(0))


+keyframes(arrow-pulse)
  1%
    opacity: 0
  12%
    opacity: 1
    +triangle(3vh, $color-brightness, down)
  30%
    opacity: 1
    +triangle(3vh, $color-brightness, down)
  70%
    opacity: 1
    +triangle(3vh, $color-ball-indicator, down)
  75%
    opacity: 0
  
+keyframes(shadow-pulse)
  1%
    opacity: 0
  12%
    opacity: 1
    background-color: $color-brightness
    color: $color-brightness
    box-shadow: 0vh 0vh 3vh 3vh transparentize($color-brightness, .5)
    text-shadow: 0vh 0vh 3vh transparentize($color-brightness, .5)
  30%
    opacity: 1
    background-color: $color-brightness
    color: $color-brightness
    box-shadow: 0vh 0vh 3vh 3vh transparentize($color-brightness, .5)
    text-shadow: 0vh 0vh 3vh transparentize($color-brightness, .5)
  70%
    opacity: 1
    background-color: $color-ball-indicator
    color: $color-ball-indicator
    box-shadow: 0vh 0vh 0vh 0vh transparentize($color-ball-indicator, .5)
    text-shadow: 0vh 0vh 0vh transparentize($color-ball-indicator, .5)
  75%
    opacity: 0

.radar-screen__content--tracking
  @extend %radar-screen__content
  
// --- screen toggle logic
.radar-screen__content--positions
  display: block
  
.radar-screen__content--tracking
  display: none
  
#screen-toggle:checked + .radar-screen .radar-screen__content--positions
  display: none
  
#screen-toggle:checked + .radar-screen .radar-screen__content--tracking
  display: block
              
            
!

JS

              
                
              
            
!
999px

Console