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.


  <button class="sticky">♠️</button>
  <button class="sticky">♣️</button>
  <button class="sticky">♦️️</button>
  <button class="sticky">♥️</button>


                * {
  cursor: none !important;

button {
  font-size: 40px;
  width: 60px;
  height: 60px;
  border-width: 0px;
  background-color: transparent;
  margin: 5px;
  display: inline-flex;
  justify-content: center;
  align-items: center;



                import gsap, { Power2 } from "";

const pointer = document.createElement("div");

// 見た目を整える = "20px"; = "20px"; = "50%"; = "gray"; = "0.5";

// 他の要素の上に表示されるように `z-index` の値を上げる = "100000";

// 初期位置をページの真ん中にする = "absolute"; = "translate(-50%, -50%)"; = "50%"; = "50%";

// ポインターに対してのマウスイベントを透過させる = "none";

// ページに表示する

window.addEventListener("mousemove", (event) => {
  const { pageX, pageY, clientX, clientY } = event;

  // マウス下の要素一覧を取得
  const elements = document.elementsFromPoint(clientX, clientY);
  // `sticky` クラスが付いている要素を探す
  const target = elements.find((el) => el.classList.contains("sticky"));

  if (target) {
    // sticky要素があった時はポインターを要素と同じ場所・大きさに変形させる
    const rect = target.getBoundingClientRect();
    const top = + rect.height / 2;
    const left = rect.left + rect.width / 2;
    const { width, height } = rect;
    const borderRadius = Math.min(rect.height, rect.width) * 0.1;, {
      duration: 0.1,
      ease: Power2.easeOut,
      overwrite: true
  } else {
    // sticky要素がない場合は元の形状に戻す, {
      width: 20,
      height: 20,
      borderRadius: "50%",
      duration: 0.1,
      ease: Power2.easeOut,
      overwrite: true

    // マウス座標に移動させる, {
      top: pageY,
      left: pageX,
      duration: 0.05,
      ease: Power2.easeOut