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 class="abeamer-story" id=story>
  <div class="abeamer-scene" id=scene1>
    <img id=malaysia src="https://www.abeamer.com/files/by-date/2018/06/ad-example/kuala-lumpur-1820944_640.jpg" />
    <img id=thailand src="https://www.abeamer.com/files/by-date/2018/06/ad-example/phang-nga-bay-2076834_640.jpg" />
    <div id=discover>Discover</br>Thailand<br/><span id=only>ONLY</span> 499</div>
    <div id=explore>Explore</br>Malaysia<br/>ONLY 599</div>
    <div id=desc>Advertisement</div>
  </div>
</div>
            
          
!
            
              $abeamer-width: 480;
$abeamer-height: 200;

body,
html,
.abeamer-story,
.abeamer-scene {
  width: $abeamer-width + px;
  height: $abeamer-height + px;
}

#scene1 {
  font-size: 15px;
  font-family: sans-serif;
  background-color: #e0e0e0;
}

#thailand,
#malaysia {
  position: absolute;
  left: 0;
  top: 0;
}

#discover, #explore {
  font-family: 'Amatic SC', cursive;
  position: absolute;
  top: 35px;
  right: 6px;
  font-size: 44px;
  font-weight: bold;
  color: #fff;
  text-shadow: 0px 0px 2px #b3b3b3;
  opacity: 0;
}

#desc {
  position: absolute;
  top: 5px;
  right: 0;
  padding: 3px;
  transform: rotateY(90deg);
  transform-origin: right;
  background: #ff000087;
  color: #fff;
  border-radius: 2px 0px 0px 2px;
  font-size: 14px;
}
            
          
!
            
              
// twitter: https://twitter.com/ABeamerJS
// website: https://www.abeamer.com

/* ---------------
* To generate a png file sequence, gif or .mp4 file of your work:
* 1. Install ABeamer, read the instructions: https://www.abeamer.com/#get-started
* 2. Create a project using abeamer: abeamer create foo
* 3. Copy the:
*     - scss code to css/main.scss   (compile it)
*     - ts code to js/main.ts or if it's javascript to js/main.js
*     - html code inside the story to code inside the story in index.html
*     - the dimensions code at the top of scss code to abeamer.ini
* 4. To generate a file sequence: abeamer render foo
* 5. To generate an animated gif file (after step 4): abeamer gif foo
* 6. To generate a .mp4 file (after step 4): abeamer movie foo
* ---------------- */

$(window).on("load", () => {

  const story: ABeamer.Story = ABeamer.createStory(/*FPS:*/25);

  const scene1 = story.scenes[0];
  scene1
    .addAnimations([{
      selector: '#discover',
      advance: true,
      duration: '1s',
      props: [{
        prop: 'opacity',
      }, {
        prop: 'right',
        duration: '0.5s',
        position: '2s',
        value: 500,
      }],
    }, {
      selector: '#thailand',
      advance: true,
      props: [ {
        prop: 'left',
        duration: '0.5s',
        position: '2s',
        value: -500,
      }],
    },
    {
      selector: '#explore',
      props: [ {
        prop: 'opacity',
        duration: '1s',
      }],
    }])
    .addAnimations([{
      selector: '#desc',
      position: '2s',
      duration: '2s',
      props: [{
        prop: 'transform',
        valueFormat: 'rotateY(%fdeg)',
        valueStart: 90,
        value: 0,
      }],
    }])
    .addStills('0.4s');

  story.render(story.bestPlaySpeed());
});

            
          
!
999px
🕑 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 ..................

Console