cssAudio - Activefile-genericCSS - ActiveGeneric - ActiveHTML - ActiveImage - ActiveJS - ActiveSVG - ActiveText - Activefile-genericVideo - ActiveLovehtmlicon-new-collectionicon-personicon-teamlog-outoctocatpop-outspinnerstartv

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. If you link to another Pen, it will include the CSS from that Pen. If the preprocessor matches, it will attempt to combine them before processing.

+ add another resource

You're using npm packages, so we've auto-selected Babel for you here, which we require to process imports and make it all work. If you need to use a different JavaScript preprocessor, remove the packages in the npm tab.

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

Use npm Packages

We can make npm packages available for you to use in your JavaScript. We use webpack to prepare them and make them available to import. We'll also process your JavaScript with Babel.

⚠️ This feature can only be used by logged in users.

Code Indentation


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.

              <div id="bubbleOne">
  <p>WOBBLY<br />BUTTON</p>
  <svg id="createStrat" viewBox="0 0 168 168">
    <g id="backdrop">
     <path id="backdrop-back" d="M165.2,84c0,22.6-9.3,42.2-24.2,57s-34.4,26-57,26s-44.1-9.2-58.9-24S1.7,106.6,1.7,84 S10.2,39.8,25,25S61.4,3,84,3s43.7,7.7,58.5,22.5S165.2,61.4,165.2,84z"/>
  fill: #71C7F2;
  opacity: 0.75;

#bubbleOne {
  -webkit-touch-callout: none;
  -webkit-user-select: none; /* Disable selection/copy in UIWebView */
  -webkit-tap-highlight-color: rgba(0,0,0,0);

#bubbleOne p{
  font-family: Arial, sans-serif;
              // --------  SHAKE ------------
var box1 = document.querySelectorAll("#bubbleOne")[0];

function shake(element, shakes, speed){
	var tl = new TimelineLite();
	TweenLite.set(element, {x:"+=0"}); // this creates a full _gsTransform on element
	var transforms = element._gsTransform;
  //store the transform values that exist before the shake so we can return to them later
  var initProps = {
  //shake a few times
  for(var i = 0; i < shakes; i++){
		tl.to(element, speed ,{x:initProps.x + R(-4,4), y:initProps.y + R(-2,2)})
  return tl;

function R(max,min){return Math.random()*(max-min)+min};

var tl = new TimelineMax({repeat:-1, yoyo:true});
tl.add(shake(box1, 50, 0.11))
// ---------- ROTATE SVG ------------

/* Store components for easy reference */
var backdrop = document.getElementById('backdrop-back');
var bubble1 = document.getElementById('bubbleOne');

/* Backdrop */
TweenMax.to(backdrop, 4, {
  rotation: 360,
  svgOrigin: '84 84',
  repeat: -1,
  ease: Linear.easeNone

var makeBubbleTimeline = function (ease, reverse, duration) {
  duration = duration || 0.4;
  return new TimelineMax()
    .to(bubble1, duration, {
      transformOrigin:"50% 50%",
      ease: ease
    }, 0);

/* bubble 1*/
var bubbleTimeline = new TimelineMax({ paused: true })

/* play or reverse timeline */
var bub = function () {
  if (!bubbleTimeline.isActive()) {

var bubdone = function () {

//event listeners for bubble button
bubble1.addEventListener('touchstart', bub);
bubble1.addEventListener('mousedown', bub);
bubble1.addEventListener('touchend', bubdone);
bubble1.addEventListener('mouseup', bubdone);

🕑 One or more of the npm packages you are using needs to be built. You're the first person to ever need it! We're building it right now and your preview will start updating again when it's ready.
Loading ..................