Pen Settings

HTML

CSS

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

JavaScript

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

Packages

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.

Details

Privacy

Go PRO Window blinds lowered to protect code. Code Editor with window blinds (raised) and a light blub turned on.

Keep it secret; keep it safe.

Private Pens are hidden everywhere on CodePen, except to you. You can still share them and other people can see them, they just can't find them through searching or browsing.

Upgrade to PRO

Behavior

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.

Template

Make Template?

Templates are Pens that can be used to start other Pens quickly from the create menu. The new Pen will copy all the code and settings from the template and make a new Pen (that is not a fork). You can view all of your templates, or learn more in the documentation.

Template URL

Any Pen can act as a template (even if you don't flip the toggle above) with a special URL you can use yourself or share with others. Here's this Pen's template URL:

Screenshot

Screenshot or Custom Thumbnail

Screenshots of Pens are shown in mobile browsers, RSS feeds, to users who chose images instead of iframes, and in social media sharing.

This Pen is using the default Screenshot, generated by CodePen. Upgrade to PRO to upload your own thumbnail that will be displayed on previews of this pen throughout the site and when sharing to social media.

Upgrade to PRO

HTML

              
                <div id="kinoproSpot">

	<div id="spotOverlay"></div>
	
	<div id="spotOverlayTripio"></div>
	
	<div id="ball_mbet"><img src="http://opap-shop.gr/proothisi/test/kinopro_spot/images/ball-mbet.png"></div>
	
	<!-- first message -->
	<div id="spot_msg1" class="spot_msg">This is Msg 1</div>
	
	<!-- second message -->
	<div id="spot_msg2" class="spot_msg">This is Msg 2</div>
	
	<!-- third message -->
	<div id="spot_msg3" class="spot_msg">This is my 3rd Message</div>

<!-- forth message -->

	<div id="spot_msg4" class="spot_msg">This is my final message to you</div>
	<div id="spot_praktoreia"><em>Small footer text</em></div>
</div>
              
            
!

CSS

              
                @charset "utf-8";
/* CSS Document */

* {
  margin: 0px;
  padding: 0px;
}

body {
  background: #ffc000 !important;
}

@font-face {
  font-family: "RobotoCond";
  src: url(https://opap-shop.gr/libs/fonts/RobotoCondensed-Regular.ttf);
}

@font-face {
  font-family: "RobotoCondBold";
  src: url(https://opap-shop.gr/libs/fonts/RobotoCondensed-Bold.ttf);
}

#kinoproSpot {
  z-index: 90;
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  margin-left: auto;
  margin-right: auto;
  overflow: hidden;
  width: 1280px;
  height: 720px;
  margin: 0 auto;
  /*background: url(../images/bg.jpg) no-repeat top left;*/
}

#kinoproSpot #spotOverlay {
  z-index: 91;
  position: absolute;
  overflow: hidden;
  width: 100%;
  height: 100%;
  top: 0;
  left: 0;
  background: rgba(0, 0, 0, 0.6);
}

#kinoproSpot #spotOverlayTripio {
  z-index: 91;
  position: absolute;
  overflow: hidden;
  width: 100%;
  height: 100%;
  top: 0;
  left: 0;
  background: url(../images/overlay-tripio.png) no-repeat top left;
}

#kinoproSpot #ball_mbet {
  z-index: 93;
  position: absolute;
  width: 93px;
  height: 93px;
  top: 8px;
  left: 157px;
}

#kinoproSpot .spot_msg {
  white-space: nowrap;
  overflow: hidden;
  z-index: 92;
  position: absolute;
  top: 15px;
  left: 223px;
  font-family: RobotoCond, Arial, Helvetica, sans-serif;
  font-size: 50px;
  text-align: center;
  color: #fff;
  background: #13687d;
  border-radius: 7px;
  padding: 10px 45px;
  box-sizing: border-box;
  -webkit-box-shadow: -25px 18px 0px -1px rgba(1, 42, 58, 0.35);
  -moz-box-shadow: -25px 18px 0px -1px rgba(1, 42, 58, 0.35);
  box-shadow: -25px 18px 0px -1px rgba(1, 42, 58, 0.35);
}

#kinoproSpot .spot_msg span {
  font-family: RobotoCondBold, Arial, Helvetica, sans-serif;
  color: #ea9104;
}

#kinoproSpot #spot_msg4 {
  -webkit-box-shadow: -12px 13px 19px -6px rgba(2, 50, 70, 0.75);
  -moz-box-shadow: -12px 13px 19px -6px rgba(2, 50, 70, 0.75);
  box-shadow: -12px 13px 19px -6px rgba(2, 50, 70, 0.75);
}

#kinoproSpot #spot_praktoreia {
  z-index: 91;
  position: absolute;
  top: 93px;
  left: 585px;
  font-family: RobotoCond, Arial, Helvetica, sans-serif;
  font-size: 30px;
  text-align: center;
  color: #fff;
  background: #084b67;
  border-radius: 0 0 7px 7px;
  padding: 10px 15px;
}

#spot_msg1,
#spot_msg2 {
  width: 370px;
}

#spot_msg3 {
  width: 845px;
}

#spot_msg4 {
  width: 823px;
}

              
            
!

JS

              
                var MySpot = new function() {
  //use this to test if overwriting is happening
  TweenLite.onOverwrite = function() {
    console.log("overwrite")
  }
  
  var spotTL;
  var elements;

  $(function() {
    set_spotTL();
    elements = [
      $("#spotOverlay"),
      $("#ball_mbet"),
      $("#spot_msg1"),
      $("#spot_msg2"),
      $("#spot_msg3"),
      $("#spot_msg4"),
      $("#spotOverlayTripio"),
      $("#spot_praktoreia")
    ];
  });
  function Repeat() {
    console.log("Loop Ended");
  }

  function Complete() {
    console.log("Completed");
    spotTL.set(elements, { clearProps: "all" });
    spotTL.invalidate();
   
  }

  function set_spotTL() {
    if (window.TweenMax) {
      spotTL = new TimelineMax({
        paused: true,
        repeat:-1,
        onRepeat: Repeat,
        onComplete: Complete
      });
      spotTL
        .from($("#spotOverlay"), 1, { autoAlpha: 0 })
        .from($("#ball_mbet"), 1, { scale: 0.49, x: -10, y: -19, autoAlpha: 0 })
        .to($("#ball_mbet"), 2, { rotation: "1080", x: +415, overwrite:"none" }, "-=0.1")
        .from($("#spot_msg1"), 0.2, { autoAlpha: 0 }, "-=1.85")
        .from($("#spot_msg1"), 2, { width: 0 }, "-=1.90")
        .to($("#ball_mbet"), 2, { rotation: "0", x: 0, overwrite:"none" }, "+=1")
        .to($("#spot_msg1"), 1.8, { width: 0 }, "-=2")
        .to($("#spot_msg1"), 0.3, { autoAlpha: 0 }, "-=0.95")
        .to($("#ball_mbet"), 2, { rotation: "1080", x: +415, overwrite:"none" }, "-=0.1")
        .from($("#spot_msg2"), 0.2, { autoAlpha: 0 }, "-=1.85")
        .from($("#spot_msg2"), 2, { width: 0 }, "-=1.90")
        .to($("#ball_mbet"), 2, { rotation: "0", x: 0, overwrite:"none" }, "+=1")
        .to($("#spot_msg2"), 1.8, { width: 0 }, "-=2")
        .to($("#spot_msg2"), 0.3, { autoAlpha: 0 }, "-=0.95")
        .to($("#ball_mbet"), 2, { rotation: "2160", x: +890, overwrite:"none" }, "-=0.1")
        .from($("#spot_msg3"), 0.2, { autoAlpha: 0 }, "-=1.85")
        .from($("#spot_msg3"), 2, { width: 0 }, "-=1.95")
        .to($("#ball_mbet"), 2, { rotation: "0", x: 0, overwrite:"none" }, "+=1")
        .to($("#spot_msg3"), 1.9, { width: 0 }, "-=2")
        .to($("#spot_msg3"), 0.4, { autoAlpha: 0 }, "-=0.75")
        .to($("#ball_mbet"), 2, { rotation: "2160", x: +860, overwrite:"none" }, "-=0.1")
        .from($("#spot_msg4"), 0.2, { autoAlpha: 0 }, "-=1.85")
        .from($("#spot_msg4"), 2, { width: 0 }, "-=1.95")
        .from($("#spot_praktoreia"), 1, { autoAlpha: 0, y: -80 }, "+=1.5")
        .to($("#spot_praktoreia"), 1, { autoAlpha: 0, y: -80 }, "+=4")
        .to($("#ball_mbet"), 2, { rotation: "0", x: 0, overwrite:"none" }, "+=1")
        .to($("#spot_msg4"), 1.9, { width: 0 }, "-=2")
        .to($("#spot_msg4"), 0.4, { autoAlpha: 0 }, "-=0.75")
        .to($("#ball_mbet"), 1, { scale: 0.49, x: -10, y: -19, autoAlpha: 0, overwrite:"none" })
        .to($("#spotOverlayTripio"), 1, { autoAlpha: 0 }, "-=1");
      spotTL.play();
     spotTL.timeScale(6)
    }
  }
}();

              
            
!
999px
What did the colon say to the semicolon? Stop winking at me.

Console