½ÃÀÛÆäÀÌÁö·Î Áñ°Üã±âÃß°¡
·Î±×ÀÎ
ȸ¿ø°¡ÀÔ l Ã⼮üũ l ¸¶ÀÌÆäÀÌÁö l CGIMALL
happycgi
ÀÚ·á½Ç »çÀÌÆ®µî·Ï ·©Å·100 ÇÁ·Î±×·¥¸®ºä °ü¸®ÀÚÃßõÀÚ·á Ãʺ¸°¡À̵å
Ä¿¹Â´ÏƼ
Àüü ÆîÃ帱â
Äü¸Þ´º¸µÅ© jquery , CSS , PHP , Javascript , ¹«·áÆùÆ® , ASP
»ó¼¼°Ë»ö
Ȩ > CSS > ±âŸȿ°ú > µå·¡±× µÇ´Â ¸ð´Þ â GSAP CodePen Home Moving a modal with GSAP Draggable & Tailwind CSS »ó¼¼Á¤º¸
»çÀÌÆ®µî·Ï
Ŭ¶ó¿ìµåű×
Javascript
PHP
ASP
CSS
html
mysql
jquery
image
API
Mobile
¸Þ´º
slide
°Ô½ÃÆÇ
ÇöÀçÁ¢¼ÓÀÚ ¸í »õ·Î°íħ
µå·¡±× µÇ´Â ¸ð´Þ â GSAP CodePen Home Moving a modal with GSAP Draggable & Tailwind CSS
¼Ò½ºÅë°èÁ¤º¸ ¿À·ù½Å°í ¹× ¹®ÀÇ
ÇØÇÇÆÀ
³×ƼÁð
Æ®À§ÅÍ·Î º¸³»±â ÆäÀ̽ººÏÀ¸·Î º¸³»±â
¼Ò½ººÐ·ù ±âŸȿ°ú
´Ù¿î·Îµå Ƚ¼ö 9 ȸ
°£´Ü¼³¸í GSAPÀ» ÀÌ¿ëÇÑ ¸ð´ÞÀÔ´Ï´Ù. µå·¡±×°¡ µÇ¸ç µå·¡±× ½Ã ¹é±×¶ó¿îµå »ö»óÀÌ º¯ÇÏ´Â È¿°ú°¡ Àû¿ëµË´Ï´Ù.
Æò°¡Çϱâ ÈǸ¢ÇÔ ¸Å¿ìÁÁÀ½ ÁÁÀ½ ±¦ÂúÀ½ º¸Åë º°·Î
ȨÆäÀÌÁö¹Ù·Î°¡±â ¼Ò½º´Ù¿î·Îµå µ¥¸ð ¹Ì¸®º¸±â ½ºÅ©·¦Çϱâ
 

GSAPÀ» ÀÌ¿ëÇÑ ¸ð´ÞÀÔ´Ï´Ù. 

µå·¡±×°¡ µÇ¸ç µå·¡±× ½Ã ¹é±×¶ó¿îµå »ö»óÀÌ º¯ÇÏ´Â È¿°ú°¡ Àû¿ëµË´Ï´Ù.

 

 

HTML ±¸Á¶

<div id="page" class="w-screen h-screen bg-zinc-800 transition-colors duration-500 p-2 md:p-10">


  <div id="wrapper" class="w-full h-full">


    <div id="modal" class="w-[80%] max-w-screen-md rounded-3xl bg-neutral-50 text-center antialiased px-5 md:px-20 py-10 shadow-2xl shadow-zinc-900 relative top-1/2 left-1/2 -translate-x-1/2 -translate-y-1/2">


      <span class="text-2xl">&#9995; &#8594; &#9994; &#8594; &#9995;</span>


      <h1 class="text-2xl lg:text-3xl font-bold text-neutral-900 my-4">

        Drag the modal

      </h1>


      <p class="text-base lg:text-xl text-neutral-500">

        Move this window anywhere you want in the page. Click on the button below to bring it back to its initial position.

      </p>


      <button type="button" id="reset" disabled class="px-8 py-4 mt-8 rounded-2xl text-neutral-50 bg-violet-800 hover:bg-violet-600 active:bg-violet-900 disabled:bg-neutral-900 disabled:cursor-not-allowed transition-colors">

        Reset the position

      </button>


      <svg viewBox="0 0 16 16" xmlns="http://www.w3.org/2000/svg" class="w-[16px] h-[16px] absolute right-6 top-6">

        <path d="m2 2 12 12m0-12-12 12" class="stroke-2 stroke-current" />

      </svg>


    </div>


  </div>

  

</div>



CSS ¼Ò½º

@import url('https://fonts.googleapis.com/css2?family=Manrope:wght@500;800&display=swap');


body {

  font-family: 'Manrope', sans-serif;

}



JS ¼Ò½º

ÀÚ¼¼ÇÑ ¼Ò½º´Â »çÀÌÆ®¿¡¼­ È®ÀÎÇÏ½Ç ¼ö ÀÖ½À´Ï´Ù.



÷ºÎÆÄÀÏÀ» ´Ù¿î·Îµå ¹Þ°Å³ª ÇØ´ç »çÀÌÆ®·Î À̵¿Çؼ­ Àüü ¼Ò½º¸¦ È®ÀÎÇÏ½Ç ¼ö ÀÖ½À´Ï´Ù.
³×ƼÁð ÀÇ°ß   ÀÌ¿ëÇϽŠÀÚ·áÀÇ Èı⸦ ÀÚÀ¯·Ó°Ô ÀÛ¼ºÇϼ¼¿ä. (»ó¾÷ÀûÀÎ ±¤°í ¹× µµ¹è¼º ±Û µîÀº »çÀüÅ뺸¾øÀÌ »èÁ¦µÉ ¼ö ÀÖ½À´Ï´Ù.)
³»¿ë ¾ÆÀ̵ð ÀÇ°ß³²±â±â
µî·ÏµÈ ÀÇ°ßÀÌ ¾ø½À´Ï´Ù.
1
À̸§
³»¿ë
:³×¸Â¾Æ¿ä: :È­³ª´Â±º¿ä: :Àá¿Í: :¿ì¿ïÇØ: :À̰ǾƳÄ: :¿ÕÇÏÇÏ: ¿Õ¿ôÀ½~ ³î·¥~
Æò°¡Çϱâ ÈǸ¢ÇÔ ¸Å¿ìÁÁÀ½ ÁÁÀ½ ±¦ÂúÀ½ º¸Åë º°·Î
µµ¹è¹æÁöÅ°
 51174526 º¸ÀÌ´Â µµ¹è¹æÁöÅ°¸¦ ÀÔ·ÂÇϼ¼¿ä.