Pen Settings



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


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


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.


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.


                <div id="stage" class="stage">
  <p>Mouse over image!!!</p>
  <div class="dual-background"><div class="open-image"></div>
  <div class="hidden-image"></div></div>


                .html {
  box-sizing: border-box;
*::after {
  box-sizing: inherit;
body {
  margin: 0;
  padding: 0;

p {
  color: red;
  font-size: 24px;
  margin: 10px 0;

.stage {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 100vh;

.dual-background {
  position: relative;
  width: 445px;
  height: 931px;
  &::before {
    content: '';

.open-image {
  width: 100%;
  height: 100%;
  background: left top no-repeat url('');

.hidden-image {
  position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
    opacity: 0;
    background: left top no-repeat url('');


                const stage = document.getElementById("stage");
const hiddenImage = document.getElementsByClassName("hidden-image")[0];

hiddenImage.addEventListener("mousemove", debounce(moveMak, 10));

function moveMak(e) {
  const rect = hiddenImage.getBoundingClientRect();

  const x = e.clientX - rect.left;
  const y = e.clientY -; = `mask-image: radial-gradient(circle at ${x}px ${y}px, 
#000, #000 50px, transparent 60px, transparent`; = 1;

hiddenImage.addEventListener("mouseleave", (e) => { = 0;

// debounce 関数
function debounce(callback, interval) {
  let debounceTimeoutId;

  return function(...args) {
    debounceTimeoutId = setTimeout(() => callback.apply(this, args), interval);