Pen Settings

HTML

CSS

CSS Base

Vendor Prefixing

Add External Stylesheets/Pens

Any URLs 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 its URL and the proper URL extension.

+ 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.

Behavior

Auto Save

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.

HTML

              
                <meta name="description" content="battle FIELD">
<html>
<script src="https://cdnjs.cloudflare.com/ajax/libs/gsap/2.0.1/TweenMax.min.js"></script>
<script src="https://code.jquery.com/jquery-3.1.0.js"></script>
  
<body>
  <svg width="1100" height='700' style="background:black">
    <g id="generalGi">
    <image id="field" width="1100" y="200" xlink:href="http://www.changunn.com/blog/wp-content/uploads/2018/07/battlefield_by_kekse0719-d6n8ki1.jpg"/>
    <image id="away" width="200" x="500" y="210" xlink:href="http://www.changunn.com/blog/wp-content/uploads/2018/07/oshanin-dmitiry-6-1600-1.png"/>
    <rect id="rect" class="lonely" width="1100" height="350" y="500" x="0"/>
    <image id="lill" x="-150" y="0" width="150" xlink:href="http://www.changunn.com/blog/wp-content/uploads/2018/07/Humming_Bird_Transparent_PNG_Clipart_Picture.png" />
<image id="tank" width="400"  x="-400" y="400" xlink:href="https://hsto.org/getpro/habr/post_images/770/49c/45e/77049c45e878fcd12daf6ea3e5bf3371.png"/>

     <g  id="giEna" >
     <text id="ancient" class='btnTxt' x="250" y= '100' >Αρχαία απεικόνιση του πολέμου των γαλαξιών!</text>
    <rect class="btnRect"  width="240" height = "30" x="120" y="200"/>
    <text class="btnTxt" x="125" y="220" cursor="pointer" >Ο κατεστραμένος κόσμος...</text></g>
    
    
    <g id="giDyo" transform="translate(0,50)">
    <rect class="btnRect"  width="240" height = "30" x="120" y="200"/>
    <text class="btnTxt" x="125" y="220" cursor="pointer">Το πουλί ρομπότ</text></g>
    
    
    <g id="giTria" transform="translate(0,100)" >
    <rect class="btnRect"  width="240" height = "30" x="120" y="200"/>
    <text class="btnTxt" x="125" y="220" cursor="pointer">Το βλαμμένο ρομπο - τανκ</text></g>
    
    <g id="giTessera" transform="translate(0,150)" >
    <rect class="btnRect"  width="240" height = "30" x="120" y="200"/><text class="btnTxt" x="125" y="220" ></text></g>
    

    </g>  
  
    
    //end of giGeneral..............  
    
    
    <g transform='translate:(-180,0)'>
    <text class="opening" id="txtEna" x="100" y='140'>Στην αρχή ήταν ο πόλεμος στους γαλαξίες!</text>    
    
    <text class="opening" id="txtDyo" x="100" y='200'>Οι κόσμοι καταστραφηκαν. Η μόλυνση από ραδιενέργεια</text> 
    
    
    <text class="opening" x="100" y='260'>εξαφάνισε κάθε μορφή ζωής!</text>
    
    
   <text class="opening" x="100" y='320'>Τα μηχανικά πουλιά σαρώνουν την περίμετρο</text>
    
    
    <text class="opening" x="100" y='380'>Τα αποβλακωμένα ρομπο - τανκς πυροβολούν ό,τι κινείται!</text>
    
    
    <text class="opening" x="100" y='440'>Μια προφητεία για μορφές ζωής που μεταλλάχτηκαν</text>
    
    <text class="opening" x="100" y='500'>θα ανατρέψει την αυτοκρατορία των ρομπότ!</text></g>
    
    <g id="openerBtn" transform="translate(0,350)" >
    <text id="formerTxt" x="25" y="220" cursor="pointer" >next</text></g>
    
    <rect  class="former" width="1100" height="700" y="50" x="0"/>
  
</svg>
</body>
</html>
              
            
!

CSS

              
                .opening {
  fill:red;
  font-size:40;
  
  }


#generalGi {
  visibility:hidden
}


.lonely{
  fill:black;
  opacity:0.5
}

.btnRect {
  fill:red;
  opacity: 0.5
}


.btnTxt {
  fill:white
}

#formerTxt {
  fill:white;
  font-size:40
}


              
            
!

JS

              
                var giEna = $("#giEna");
var giDyo = $("#giDyo");
var giTria = $("#giTria");

var lilG = $("#lill");
var values=[{x:0,y:1},{x:0,y:0}]
var $field = $("#field")
var $away = $("#away");
TweenMax.set($away,{scaleX:6, scaleY:2.5,transformOrigin:'50% 80%'})
TweenMax.set($field,{scaleY:2,transformOrigin:'50% 50%'})






//the black rect moves down and reveals opener text
var tl = new TimelineMax();
 tl.to(".former",26,{y:650})






 
$("#formerTxt").on("click",showAll)
function showAll(){
  $("#formerTxt").remove();
  tl = new TimelineMax();
  tl.set(".opening",{visibility:'hidden'})
  tl.set("#generalGi",{visibility:"visible"})
  
} 

giEna.on("click",awayView)
function awayView(){
  TweenMax.set(giEna,{visibility:"hidden"});
  TweenMax.to($away, 4,{scaleX:0, scaleY:0,transformOrigin:'50% 80%'}, 4)
}


giDyo.on("click",lilGuyGo)
function lilGuyGo()    
{
  TweenMax.set(giDyo,{visibility:"hidden"});
  tl = new TimelineMax();
   tl.progress(0)
     .clear()
     .set(lilG, 
         {
             transformOrigin:"10% 100%", 
             rotation:35
          });

   tl.to(lilG, 5 ,
         {
             rotation:30,
             repeat:-1,
             bezier:
               {
                 curviness: 1,
                 values:[{x:750,y:100},{x:1300,y:0}],
                 autoRotate: false,
	             },
             ease: Linear.easeInOut
         });
} 
//end of function lilGuyGo



giTria.on("click",tankGo)
function tankGo()
{
  TweenMax.set(giTria,{visibility:"hidden"});  
  var tl = new TimelineMax();
  tl.progress(0).clear();
  tl.add("go")
  tl.to("#tank",0.3,
      {bezier:
          {
          curviness:0,
          values:values
          },
          ease:Power1.easeInOut,
          repeat:-1
     },"go")

  tl.to("#tank",33,
        {
    x:1500,repeat:-1,ease:Linear.easeOut
  },
        "go")
}
//end of function tankGo
              
            
!
999px

Console