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

JavaScript

Babel is required to process package imports. If you need a different preprocessor remove all packages first.

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

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.

HTML

              
                <div class="tree">

<svg version="1.1" xmlns="http://www.w3.org/2000/svg" 
    xmlns:xlink="http://www.w3.org/1999/xlink"  viewBox="0 0 1260 709"  >
	 <defs>
	     <mask id="msk1">
		 <rect  width="100%" height="100%" fill="black" />
		  <path fill="white"  transform="scale(0.85) translate(0 170)" fill="none" stroke="white" fill-opacity="0.8" stroke-width="2" stroke-dasharray="1540" stroke-dashoffset="1540" d="M 375 425 Q 450 300 375 300 L 200 300 A 50 50 0 1 1 200 125 L 600 125 A 50 50 0 1 1 600 300 Q 475 300 375 425 Z" >
		 </mask>
		 <filter id="shadow" x="-20%" y="-20%" width="140%" height="140%">
            <feDropShadow dx="4" dy="8" stdDeviation="4"/>
        </filter>
	   </defs>
      
	   <image id="img1" xlink:href="https://i.stack.imgur.com/JWPjk.jpg" width="100%" height="100%" opacity="1"   />
	
    <image id="SnowMaiden" transform="translate(750 310)"  xlink:href="https://i.stack.imgur.com/MAz5g.png" 
    		 width="60%"    height="60%" opacity="0" >
         <!-- Анимация появления снегурочки  --> 			
			<animate id="Maiden"
			  attributeName="opacity"
			  values="0;1"
			  begin="btn.click"
			  dur="2s"
			  repeatCount="1"
			  fill="freeze"
			  restart="whenNotActive"/>
		<!-- Анимация движения снегурочки  -->	  
            <animateTransform id="RunMaiden"
			  attributeName="transform"
			  type="translate"
			  values="750 310; 300 310"
			  begin="Maiden.end-1.2s"
			  dur="2s"
			  fill="freeze"
              restart="whenNotActive" />			
			  
		<!-- Анимация движения снегурочки после стихов мальчика  -->	  
            <animateTransform id="RunMaiden2"
			  attributeName="transform"
			  type="translate"
			  values="300 310; 100 310"
			  begin="an_fill_none.end"
			  dur="2s"
			  fill="freeze"
			  restart="whenNotActive" />				  
			  
			  
	</image>   
  <g id="MaidenWords">    
   	
    <!-- Контур  для слов снегурочки -->

  <path transform="scale(0.6) translate(450 400)" filter="url(#shadow)" fill="none" stroke="white" fill-opacity="0.8" stroke-width="2" stroke-dasharray="1549" stroke-dashoffset="1549" d="M 375 425 Q 450 300 375 300 L 200 300 A 50 50 0 1 1 200 125 L 600 125 A 50 50 0 1 1 600 300 Q 475 300 375 425 Z" >
<!-- анимация прорисовки контура слов снегурочки -->
  <animate id="Maiden_str"
	  attributeName="stroke-dashoffset"
	  values="1549;0"
	  begin="RunMaiden.end+0.5s"
	  dur="2s"
	  repeatCount="1"
	  fill="freeze"
	  restart="whenNotActive"/> 
    <!-- анимация заполнения фона контура -->  
  <animate id="Maiden_fill"
	  attributeName="fill"
	  values="transparent;white"
	  begin="Maiden_str.end"
	  dur="2s"
	  repeatCount="1"
	  fill="freeze"
	  restart="whenNotActive"/>
   </path>  
     <text id="txt1" transform="translate(400 400 )" style="font-size:24px;fill:#0D440D;font-family:Garamond; opacity:0;" 
	
		   x="0"
		   y="0">
		   <tspan x="-10" y="-50">Дети.Кто хочет подарков?</tspan>
		   <tspan x="-10" y="0">Читайте стихи про ёлочку! </tspan>
		   
	 </text>	
	  <!-- Анимация появления текста снегурочки -->
          <animate id="text_opacity"
		  xlink:href="#txt1"
			  attributeName="opacity"
			  values="0;1"
			  dur="1s"
			  begin="Maiden_fill.end"
			  fill="freeze"
			  restart="whenNotActive"	/> 
	     <!-- Исчезновение текста снегурочки -->
	       <animate id="disWordMaiden"
		    xlink:href="#MaidenWords"
			attributeName="opacity"
			values="1;0"
			dur="1s"
			begin="text_opacity.end+2s"
			fill="freeze"
			restart="whenNotActive"	/> 
     
	</g>
   
    	<!-- Анимация появления картинки мальчика, читающего стихи под ёлочкой на табуретке  --> 
<g transform="scale(0.6) translate(-320 470)">
   <image  id="img2" xlink:href="https://i.stack.imgur.com/MChyh.png" width="100%" height="100%" opacity="0" filter="url(#shadow)"  >
     <animate id="an_img"
	  attributeName="opacity"
	  values="0;1"
	  begin="disWordMaiden.end+1s"
	  dur="2s"
	  repeatCount="1"
	  fill="freeze"
	  restart="whenNotActive"/>  
   
 </image>   
  </g>   
     <!-- Контур для стихов мальчика -->

 <path transform="scale(0.6) translate(0 200)" filter="url(#shadow)" fill="none" stroke="white" fill-opacity="0.8" stroke-width="2" stroke-dasharray="1549" stroke-dashoffset="1549" d="M 375 425 Q 450 300 375 300 L 200 300 A 50 50 0 1 1 200 125 L 600 125 A 50 50 0 1 1 600 300 Q 475 300 375 425 Z" > 
<!-- анимация прорисовки контура для стихов -->
  <animate id="an_str"
	  attributeName="stroke-dashoffset"
	  values="1549;0"
	  begin="an_img.end+0.5s"
	  dur="2s"
	  repeatCount="1"
	  fill="freeze"
	  restart="whenNotActive"/> 
    <!-- анимация заполнения фона контура -->  
  <animate id="an_fill"
	  attributeName="fill"
	  values="transparent;white"
	  begin="an_str.end"
	  dur="2s"
	  repeatCount="1"
	  fill="freeze"
	  restart="whenNotActive"/> 
    <!-- анимация исчезновения контура-->	  
  <animate id="an_str_none"
	   attributeName="stroke-dashoffset"
	   values="0;1549"
	   begin="an_fill_none.end"
	   dur="2s"
	   repeatCount="1"
	   fill="freeze"
	   restart="whenNotActive"/>
      <!-- анимация исчезновения фона контура -->
  <animate id="an_fill_none"
	  attributeName="fill"
	  values="white;transparent"
	  begin="an_text.end"
	  dur="2s"
	  repeatCount="1"
	  fill="freeze"
	  restart="whenNotActive"/>
</path>  

  
<g id="btn" filter="url(#shadow)">
   <rect  x="0" y="10" rx="15" stroke="green" id="rec1" width="100px" height="40px" fill="greenyellow" />
    <text x="18" y="40" font-size="32"  fill="crimson"> Start </text>
 </g>
  
   
 
 
    <!-- Блок стихов -->
<svg xmlns="http://www.w3.org/2000/svg" version="1.1" 
width="30%" height="40%" viewBox="0 40 -200 100">
   
    
	  <text transform="translate(100 175 )" style="font-size:24px;fill:#0D440D;font-family:Garamond;
	  filter:"url(#shadow);" 
	
		   x="0"
		   y="0">
		   <tspan x="0" y="0">Нарядная, пушистая</tspan>
		   <tspan x="0" y="100">К нам ёлочка пришла</tspan>
		   <tspan x="0" y="150">И аромат душистый</tspan>
		   <tspan x="0" y="200">Домой к нам принесла!</tspan> 
		   <tspan x="0" y="250">Вокруг неё, зелёной,</tspan>
		   <tspan x="0" y="300">Мы водим хоровод,</tspan>
		   <tspan x="0" y="350">Сегодня встретим новый,</tspan>
		   <tspan x="0" y="400">Счастливый самый год!</tspan>
			 <!-- Анимация движения строчек стихов -->  
    <animateMotion id="an_text"
		path="M 0 0 L 0 -400"
		begin="an_fill.end+0.5s"
		dur="8s"
		repeatCount="1"
		fill="freeze"
		restart="whenNotActive" />
    </text> 
</svg>   
     <!-- Корзина с подарками -->  
  <image  id="img4" transform="translate(370 480)" xlink:href="https://i.stack.imgur.com/F4BVa.png" width="30%" height="30%" opacity="0" filter="url(#shadow)"  >
    <animate id="Basket_Op"
    	attributeName="opacity"
		values="0;1"
		dur="0.1s"
		begin="RunMaiden2.end"
        fill="freeze"
		restart="whenNotActive" />
	  <!-- Анимация Корзины с подарками к мальчику -->
	<animateTransform id="Basket_Up" attributeName="transform" type="translate" values="370 480; 70 480" dur="2s"  begin="Basket_Op.end" fill="freeze" /> 
	
	 <!-- Анимация исчезновения снегурочки  --> 			
			<animate id="No_Maiden"
			  attributeName="opacity"
			  xlink:href="#SnowMaiden"
			  values="1;0"
			  begin="Basket_Up.end-1s"
			  dur="2s"
			  repeatCount="1"
			  fill="freeze"
			  restart="whenNotActive"/>
	 
   </image>
 </svg>
</div>
              
            
!

CSS

              
                .tree {
  width:100%;
 height:100%;

 outline:1px solid green;
 position:relative;
 }
 .txt1 {
position:absolute; 

top:25%;
left:5%;
 
 }
 

              
            
!

JS

              
                
              
            
!
999px

Console