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

              
                <div class="min-h-screen bg-gray-100 flex flex-col items-center">
<footer class="fixed bg-white bottom-2 p-4 mb-4 rounded-lg mx-auto w-auto shadow-2xl z-10 flex items-end"  style="height: 80px" 
      @mousemove="x = $event.clientX; y = $event.clientY" 
      @mouseleave="x=10000;y=10000" x-data="{
    x: 10000, y: 10000,
    scalefactor(el){
      let rect = el.getBoundingClientRect();
      let dx = Math.abs(this.x - (rect.left + rect.right)/2.0);
      let dy = Math.abs(this.y - (rect.top + rect.bottom)/2.0);
      let dist = Math.sqrt(dx ** 2 + dy ** 2);
      return Math.min(Math.max(1.0, (2.0 - (dist-20) / 120)), 2.0);
    },
    size(el){
      return String(Math.round(48 * this.scalefactor(el))) + 'px';
    }}">
 <div id="hoverarea" class="flex items-end gap-x-4" style="height: 96px">
   <button class="bg-green-500 text-white text-2xl font-bold rounded" :style="{ width: size($el), height: size($el) }" >A</button>
   <button class="bg-yellow-500 text-white text-2xl font-bold rounded" :style="{ width: size($el), height: size($el) }" >B</button>
   <button class="bg-red-500 text-white text-2xl font-bold rounded" :style="{ width: size($el), height: size($el) }" >C</button>
   <button class="bg-purple-500 text-white text-2xl font-bold rounded" :style="{ width: size($el), height: size($el) }" >D</button>
   <button class="bg-indigo-500 text-white text-2xl font-bold rounded" :style="{ width: size($el), height: size($el) }" >E</button>
   <button class="bg-pink-500 text-white text-2xl font-bold rounded" :style="{ width: size($el), height: size($el) }" >F</button>
   <button class="bg-red-500 text-white text-2xl font-bold rounded" :style="{ width: size($el), height: size($el) }" >G</button>
   <button class="bg-green-500 text-white text-2xl font-bold rounded" :style="{ width: size($el), height: size($el) }" >H</button>
 </div>
</footer>
</div>
              
            
!

CSS

              
                
              
            
!

JS

              
                
              
            
!
999px

Console