Pen Settings



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. You can use the CSS from another Pen by using it's URL and the proper URL extention.

+ 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 class="healthy-development">
        <div class="things-container">
          <div class="development-things">
            Things I need ...
          <div class="development-things">
            Things I don't need ...
          <div id="Dev_1" class="things-needed need">
          <div id="NonDev_1" class="things-needed dont-need">
          <div id="Dev_2" class="things-needed need">
          <div id="NonDev_2" class="things-needed dont-need">
          <div id="Dev_3" class="things-needed need">
          <div id="NonDev_3" class="things-needed dont-need">
          <div id="Dev_4" class="things-needed need">
          <div id="NonDev_4" class="things-needed dont-need">
          <div id="Dev_5" class="things-needed need">
          <div id="NonDev_5" class="things-needed dont-need">
        <div class="child-needs">
          <div id="Toy_car" class="child-things not-needed">
            Toy car
          <div id="Food" class="child-things needed">
          <div id="House" class="child-things needed">
          <div id="Umbrella" class="child-things not-needed">
          <div id="Desk" class="child-things not-needed">
          <div id="Clothes" class="child-things needed">
          <div id="Television" class="child-things not-needed">
          <div id="Play" class="child-things needed">
          <div id="Rest" class="child-things needed">


                pale-teal = #D5F6F6
light-teal = #A4D8D8
child-yellow = #efab2b
dark-teal = #157678
dark-green = #0B3F3F
marker-purple = #7e57c2

  display flex
  position relative
  flex 0 1 100%
  flex-wrap wrap
  justify-content center
  height 80vh

    margin-top 2em
    position relative
    width 80%
    display grid
    grid-template-columns:1fr 1fr;
    grid-template-rows:  1fr 1fr 1fr  1fr 1fr 1fr  ;
    height 53vh
    border 2px solid dark-green
    > div
      padding 0.5em
      font-size 1.6em
      text-align center
      border 2px solid dark-green
      background-color rgba(pale-teal, 0.8)
      color white
      background-color dark-teal
      background-color rgb(248, 164, 164)
      background-color #91db4a
    display flex
    height 25vh
    flex 0 1 80%
    flex-wrap wrap
    justify-content space-around
      flex 0 1 10%
      height 1.5em
      font-family: "Poppins-Light", sans-serif
      background-color white
      font-size 1.4em
      color light-navy
      margin 0.5em
      padding 0.25em 1.5em 0.25em 0.75em
      border-radius 0.75em
      box-shadow 0px 7px 15px rgba(0,0,0,0.5)
      background-color child-yellow
      font-family "Poppins-Bold", sans-serif
      color light-navy
      background-color green
      font-family "Poppins-Bold", sans-serif
      color white
      background-color child-yellow




/* Dragging buttons function */
// The drag-n-drop targets

let targets = $(".things-needed"); // Table targets

// The drag-n-drop buttons

var buttons = $(".child-things"); // drag buttons

// ------------------------------------------------------------

$.each(buttons, function(i, e) {
  var position = $(e).offset();
  e.originalLeft = position.left - 8;
  e.originalTop = - 8;

$.each(buttons, function(i, e) {
  gsap.set(e, { position: "absolute", left: e.originalLeft, top: e.originalTop });

var overlapThreshold = "50%";

  Draggable works by anchoring the buttons on the IDs of the targets. Without IDs, in the case where you are using classes to getElement, Draggable will not work.

Draggable.create(buttons, {
  bounds: ".healthy-development",
  edgeResistance: 0.65,
  type: "x,y",
  // throwProps: true,

  onDragStart: function() {
    if ("occupied");
  // changes the colour of the targets whilst dragging to give feedback that a
  // dragged object is going to snap to it
  onDrag: function() {
    for (let i = 0; i < targets.length; i++) {
      if (this.hitTest(targets[i], overlapThreshold)) {
      } else {
  onDragEnd() {
    let theDragged =;
    let theSpot = document.querySelector(".addRed");
    let isHitting = false;
    if (theSpot && this.hitTest(theSpot, overlapThreshold)) {
      isHitting = true;
    if (isHitting) {
      let p = $(theSpot).position();
      // tween onto target, 0.1, {
        left: p.left,
        x: 110,
        y: 30
      theDragged.targetAttachedTo = theSpot;
      snapMade = true;
    } else {
   , 0.1, {
        x: 0,
        y: 0,
        top: theDragged.originalTop,
        left: theDragged.originalLeft