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

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

              
                <svg xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:cc="http://creativecommons.org/ns#" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:svg="http://www.w3.org/2000/svg" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 45 45" xml:space="preserve" version="1.1" id="flag" enable-background="new 0 0 45 45"> <metadata id="metadata8"> <rdf:RDF> <cc:Work rdf:about=""> <dc:format> image/svg+xml </dc:format> <dc:type rdf:resource="http://purl.org/dc/dcmitype/StillImage"/> </cc:Work> </rdf:RDF> </metadata> <defs id="defs6"> <clipPath id="clipPath16" clipPathUnits="userSpaceOnUse"> <path id="path18" d="M0 36 36 36 36 0 0 0 0 36Z"/> </clipPath> <clipPath id="clipPath28" clipPathUnits="userSpaceOnUse"> <path id="path30" d="M4 31C1.79 31 0 29.21 0 27L0 27 0 9C0 6.79 1.79 5 4 5l0 0 28 0c2.21 0 4 1.79 4 4l0 0 0 18c0 2.21-1.79 4-4 4l0 0-28 0z"/> </clipPath> <clipPath id="clipPath40" clipPathUnits="userSpaceOnUse"> <path id="path42" d="M0 36 36 36 36 0 0 0 0 36Z"/> </clipPath> </defs> <g transform="matrix(1.25,0,0,-1.25,0,45)" id="g10"> <g id="g12"> <g clip-path="url(#clipPath16)" id="g14"> <g transform="translate(36,9)" id="g20"> <path id="path22" d="m0 0c0-2.21-1.79-4-4-4l-28 0c-2.21 0-4 1.79-4 4l0 18c0 2.21 1.79 4 4 4l28 0c2.21 0 4-1.79 4-4L0 0Z" style="fill-rule:nonzero;fill:#eee"/> </g> </g> </g> <g id="g24"> <g clip-path="url(#clipPath28)" id="g26"> <path id="path32" d="M36 13 0 13 0 23 36 23 36 13Z" style="fill-rule:nonzero;fill:#005da4"/> <path id="path34" d="M36 5 0 5 0 13 36 13 36 5Z" style="fill-rule:nonzero;fill:#ed1c23"/> </g> </g> <g id="g36"> <g clip-path="url(#clipPath40)" id="g38"> <g transform="translate(11.125,28.0835)" id="g44"> <path id="path46" d="m0 0c-2.25 0-3.83-0.83-3.83-0.83 0 0 0.14-2 0.33-5.08C-3.31-9 0-10.08 0-10.08c0 0 3.31 1.08 3.5 4.17 0.19 3.08 0.33 5.08 0.33 5.08C3.83-0.83 2.25 0 0 0" style="fill-rule:nonzero;fill:#ed1c23"/> </g> <g transform="translate(14.5918,27.4136)" id="g48"> <path id="path50" d="m0 0c-0.59 0.24-1.85 0.67-3.47 0.67-1.62 0-2.88-0.43-3.47-0.67 0.01-0.21 0.14-2.5 0.3-5.16 0.17-2.79 3.17-3.77 3.17-3.77 0 0 3 0.98 3.17 3.77C-0.14-2.5-0.01-0.21 0 0" style="fill-rule:nonzero;fill:#004a77"/> </g> <g transform="translate(12.104,20.0801)" id="g52"> <path id="path54" d="M0 0C-0.35 0-0.52-0.21-1.04-0.21-1.56-0.21-1.65 0-2 0c-0.27 0-0.43-0.12-0.64-0.18 0.81-0.61 1.66-0.86 1.66-0.86 0.71 0.12 1.27 0.47 1.69 0.86C0.45-0.12 0.27 0 0 0" style="fill-rule:nonzero;fill:#fff"/> </g> <g transform="translate(10.146,21.4629)" id="g56"> <path id="path58" d="M0 0C0.33 0 0.63-0.26 0.98-0.26 1.33-0.26 1.58 0 1.96 0 2.28 0 2.7-0.42 3.32-0.18 3.6 0.29 3.73 0.66 3.73 0.66L2.48 2.46 1.85 1.7 0.98 3.37 0.15 1.7-0.46 2.49c0 0-0.54-0.64-1.44-1.85 0.11-0.29 0.25-0.53 0.41-0.77C-0.78-0.47-0.3 0 0 0" style="fill-rule:nonzero;fill:#fff"/> </g> <g transform="translate(13.104,20.7085)" id="g60"> <path id="path62" d="M0 0C-0.46 0-0.65 0.26-1 0.26-1.35 0.26-1.52 0-2.04 0-2.56 0-2.65 0.26-3 0.26-3.35 0.26-3.53 0-3.85 0c-0.12 0-0.25 0.04-0.37 0.09 0.13-0.17 0.25-0.34 0.39-0.48 0.39 0.03 0.67 0.27 0.88 0.27 0.33 0 0.63-0.28 0.98-0.28 0.35 0 0.6 0.28 0.98 0.28 0.23 0 0.52-0.24 0.89-0.27 0.11 0.14 0.21 0.28 0.29 0.42C0.12 0.02 0.07 0 0 0" style="fill-rule:nonzero;fill:#fff"/> </g> <g transform="translate(10.3184,27.1929)" id="g64"> <path id="path66" d="m0 0 0.22-0.23-0.31 0.07-0.09-0.3-0.09 0.3-0.31-0.07L-0.37 0-0.59 0.23-0.28 0.16-0.19 0.47-0.09 0.16 0.22 0.23 0 0Z" style="fill-rule:nonzero;fill:#fd0"/> </g> <g transform="translate(12.4121,27.1929)" id="g68"> <path id="path70" d="m0 0 0.22-0.23-0.31 0.07-0.09-0.3-0.09 0.3-0.31-0.07L-0.37 0-0.59 0.23-0.28 0.16-0.19 0.47-0.09 0.16 0.22 0.23 0 0Z" style="fill-rule:nonzero;fill:#fd0"/> </g> <g transform="translate(11.3276,25.7974)" id="g72"> <path id="path74" d="m0 0 0.22-0.23-0.31 0.07-0.09-0.3-0.09 0.3-0.31-0.07L-0.37 0-0.59 0.23-0.28 0.16-0.19 0.47-0.09 0.16 0.22 0.23 0 0Z" style="fill-rule:nonzero;fill:#fd0"/> </g> </g> </g> </g> </svg> 
              
            
!

CSS

              
                $duration = 5s

#flag
  width: 20%
  margin: 0 auto
  position: relative

 #path22 // white
   opacity: 1
   // fill: #ff00ff !important
   animation: fillWhite $duration linear 
 
  #path32 // blue
   opacity: 1
   animation: fillBlue $duration linear 
   
 #path34 // red
   opacity: 1
   animation: fillRed $duration linear 
   transform-origin: bottom
   
  #g36 // emblem
   animation: showEmblem $duration linear 
  
  @keyframes fillBlue {
   0% {transform: scaleX(0.1)}
   40%, 100% {transform: scaleX(1)}
 }
 
 @keyframes fillWhite { 
   0%, 50% {transform: scaleY(0)}
   50.01%, 100% {transform: scaleY(1)}
 } 
 
  @keyframes fillRed {
   0%, 40.01% {transform: scaleY(0)}
   50%, 100% {transform: scaleY(1)}
 }
 
  @keyframes showEmblem {
   0%, 60% {opacity: 0}
   70.1%, 100% {opacity: 1}
 } 
  
              
            
!

JS

              
                
              
            
!
999px

Console