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

              
                #mouse-cursor
.wrapper
  ul
    each val in ['Hello.', 'About.', 'Why.', 'Contact.']
      li(class="cursor-hover")
        a(href='/')= val
              
            
!

CSS

              
                @import url('https://fonts.googleapis.com/css?family=Montserrat:900')

$mouse: #FF1744
$bg: #000
$text: #FF1744

body
  background: $bg
  font-family: 'Montserrat', sans-serif
  overflow: hidden
  *
    box-sizing: border-box
#mouse-cursor
  position: absolute
  width: 20px
  height: 20px
  background: $bg
  border: 4px solid $mouse
  border-radius: 999px
  mix-blend-mode: difference
  pointer-events: none
  z-index: 999
  transition: top .025s ease, left .025s ease, transform 0.25s ease
.wrapper
  display: flex
  justify-content: center
  align-items: center
  height: 100vh
  width: 100vw
ul
  margin: 0
  padding: 0
  width: 65vw
  li
    list-style: none
    font-size: 80px
    margin-bottom: 25px
    display: table
    a
      color: $text
      text-decoration: none
      letter-spacing: 5px
      text-transform: lowercase
      transition: 0.5s ease
      &:hover
        letter-spacing: 15px
        
              
            
!

JS

              
                const handleMousePos = (e) => {
  const CURSOR = document.querySelector('#mouse-cursor');
  const HOVER = document.querySelectorAll('.cursor-hover');
  const { pageX: posX, pageY: posY } = e;

  const runMouseOver = () => {
    CURSOR.style.transform = 'scale(4)';
    CURSOR.style.background = '#FF1744';
  };
  HOVER.forEach(hover => hover.addEventListener('mouseenter', runMouseOver));

  const runMouseLeave = () => {
    CURSOR.style.transform = '';
    CURSOR.style.background = '';
  };
  HOVER.forEach(hover => hover.addEventListener('mouseleave', runMouseLeave));
  
  return (
    CURSOR.style.left = `${posX - 10}px`,
    CURSOR.style.top = `${posY - 10}px`  
  );
};
document.addEventListener('mousemove', handleMousePos);
              
            
!
999px

Console