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

              
                <!--Exploring How to Animate SVG based on the Tuts by Noah Blon on Nettuts. Just thought to try the new css3 animation I learned.  I used the icons 'Small Icons' by Nick Frost & Greg Lapin downloaded on icemelon just for demo purposes.-->

<html>
<head>
	<meta charset="UTF-8">
	<title>SVG Animate</title>
	<link href="styles.css" media="all" rel="stylesheet" type="text/css" />
</head>

<body>
  
  		<div class="wrap-packman">
  <svg class="svg-packman"  viewBox="0 0 50 52" xmlns="http://www.w3.org/2000/svg">

      		<path class="body"
      		d="M15 0c-8.284 0-15 6.715-15 14.996v8h.005c-.002 2.505-.005 8.888.005 9.004l4.99-3 5 3 5-3 5 3c2.48 0 2.518-3 5-3 2.48 0 2.488 3 4.971 3-.014-.005.014-6.498.025-9.004h.004v-8c0-8.281-6.716-14.996-15-14.996z">
      		</path>

    		<path class="eyewhite" 
    		d="M20.5 13.001c-1.934 0-3.5 1.566-3.5 3.5 0 1.933 1.566 3.499 3.5 3.499s3.5-1.566 3.5-3.499c0-1.934-1.566-3.5-3.5-3.5zm-11 0c-1.933 0-3.5 1.566-3.5 3.5 0 1.933 1.567 3.499 3.5 3.499s3.5-1.566 3.5-3.499c0-1.934-1.567-3.5-3.5-3.5z"></path>

   			<path class="eye" 
   			d="M20.5 15c-.828 0-1.5.672-1.5 1.501 0 .828.672 1.499 1.5 1.499s1.5-.671 1.5-1.499c0-.829-.672-1.501-1.5-1.501zm-11 0c-.828 0-1.5.672-1.5 1.501 0 .828.672 1.499 1.5 1.499s1.5-.671 1.5-1.499c0-.829-.672-1.501-1.5-1.501z"></path>

   			<path class="shade"
   			d="M2.003 14.996c0-7.945 6.184-14.429 13.997-14.946-.332-.022-.662-.05-1-.05-8.282 0-14.997 6.714-14.997 14.996 0 0-.003 16.857.01 17.004.923 0 1.503-.404 1.995-.912-.004-1.749-.005-16.092-.005-16.092z"></path>
   		</div>
</body>
</html>
              
            
!

CSS

              
                /*styles for Animation svg*/

html, body, div, span, applet, object, iframe,
h1, h2, h3, h4, h5, h6, p, blockquote, pre,
a, abbr, acronym, address, big, cite, code,
del, dfn, em, img, ins, kbd, q, s, samp,
small, strike, strong, sub, sup, tt, var,
b, u, i, center,
dl, dt, dd, ol, ul, li,
fieldset, form, label, legend,
table, caption, tbody, tfoot, thead, tr, th, td,
article, aside, canvas, details, embed,
figure, figcaption, footer, header, hgroup,
menu, nav, output, ruby, section, summary,
time, mark, audio, video {
  margin: 0;
  padding: 0;
  border: 0;
  font-size: 100%;
  font: inherit;
  vertical-align: baseline;
}
/* HTML5 display-role reset for older browsers */
article, aside, details, figcaption, figure,
footer, header, hgroup, menu, nav, section {
  display: block;
}
body {
  line-height: 1;
}
ol, ul {
  list-style: none;
}
blockquote, q {
  quotes: none;
}
blockquote:before, blockquote:after,
q:before, q:after {
  content: '';
  content: none;
}
table {
  border-collapse: collapse;
  border-spacing: 0;
}

/* Global */
html, body { height: 100%; }

svg { 
  width: 100%;
  height: 100%; 
}


.wrapper {
	background-color: #f2f2f2;
	width: 960px;
 	height: 80%;
 	padding: 20px;
	margin: 20px auto;
	position: relative; 
}

/*PACKMAN*/

.wrap-packman .svg-packman { 
  width: 300px; 
  display: inline-block; 
  vertical-align: top; 
  box-sizing: border-box; 
  padding: 20px;
  position: relative;

  animation:packglide 5s infinite;
  animation-timing-function: ease-in-out;

  -webkit-animation:packglide 6s infinite;
  -webkit-animation-timing-function: ease-in-out;  
}

.svg-packman .shade {
	fill: hsl(4,66%,53%);
	animation: shadeglow 6s ease-in-out 0 infinite alternate;
	-webkit-animation: shadeglow 6s ease-in-out 0 infinite alternate;
}

.svg-packman .body {
	fill: hsl(4, 66%, 59%);
	animation: glow 6s ease-in-out 0 infinite alternate;
	-webkit-animation: glow 6s ease-in-out 0 infinite alternate;
}


.svg-packman .eyewhite {
	fill: hsl(4, 0%, 100%);
}

.svg-packman .eye {
	fill: hsl(200, 45%, 30%);

	-webkit-animation-name: blink;
	-webkit-animation-duration: 5s;
	-webkit-animation-iteration-count: infinite; 
	-webkit-transform-origin:50% 50%;

	animation-name: blink;
	animation-duration: 5s;
	animation-iteration-count: infinite; 
}


/*PACKMAN ANIMATION*/

@keyframes packglide {
0%   {top:0px; left:0px; }
25%  {top:0px; left:150px; }
50%  {top:100px; left:150px; }
75%  {top:100px; left:0px; }
100% {top:0px; left:0px; }
}

@-webkit-keyframes packglide /* Safari and Chrome */
{
0%   {top:0px; left:0px; }
25%  {top:0px; left:150px; }
50%  {top:100px; left:150px; }
75%  {top:100px; left:0px; }
100% {top:0px; left:0px; }
}


@keyframes glow {
	0% {fill: hsl(4, 66%, 59%);}
	25% {fill: hsl(319, 50%, 50%);}
	50% {fill: hsl(217, 50%, 50%);}
	75% {fill: hsl(20, 60%, 54%);}
	100% {fill: hsl(4, 66%, 59%);}
}

@-webkit-keyframes glow {
	0% {fill: hsl(4, 66%, 59%);}
	25% {fill: hsl(319, 50%, 50%);}
	50% {fill: hsl(217, 50%, 50%);}
	75% {fill: hsl(20, 60%, 54%);}
	100% {fill: hsl(4, 66%, 59%);}
}


@keyframes shadeglow {
	0% {fill: hsl(4, 66%, 49%);}
	25% {fill: hsl(319, 50%, 40%);}
	50% {fill: hsl(217, 50%, 40%);}
	75% {fill: hsl(20, 60%, 44%);}
	100% {fill: hsl(4, 66%, 49%);}
}

@-webkit-keyframes shadeglow {
	0% {fill: hsl(4, 66%, 49%);}
	25% {fill: hsl(319, 50%, 40%);}
	50% {fill: hsl(217, 50%, 40%);}
	75% {fill: hsl(20, 60%, 44%);}
	100% {fill: hsl(4, 66%, 49%);}
}

@-webkit-keyframes blink { 
	0% { -webkit-transform: scaleX(1) scaleY(1); } 
	1% { -webkit-transform: scaleX(1.1) scaleY(0.1); } 
	2% { -webkit-transform: scaleX(1) scaleY(1); }
	24% { -webkit-transform: scaleX(1) scaleY(1); }
	25% { -webkit-transform: scaleX(1.1) scaleY(0.1); } 
	26% { -webkit-transform: scaleX(1) scaleY(1); }
	50% { -webkit-transform: scaleX(1) scaleY(1); }
	74% { -webkit-transform: scaleX(1) scaleY(1); }
	75% { -webkit-transform: scaleX(1.1) scaleY(0.1); } 
	76% { -webkit-transform: scaleX(1) scaleY(1); }
	100% { -webkit-transform: scaleX(1) scaleY(1);} 
}

@-keyframes blink { 
	0% { -webkit-transform: scaleX(1) scaleY(1); } 
	1% { -webkit-transform: scaleX(1.1) scaleY(0.1); } 
	2% { -webkit-transform: scaleX(1) scaleY(1); }
	24% { -webkit-transform: scaleX(1) scaleY(1); }
	25% { -webkit-transform: scaleX(1.1) scaleY(0.1); } 
	26% { -webkit-transform: scaleX(1) scaleY(1); }
	50% { -webkit-transform: scaleX(1) scaleY(1); }
	74% { -webkit-transform: scaleX(1) scaleY(1); }
	75% { -webkit-transform: scaleX(1.1) scaleY(0.1); } 
	76% { -webkit-transform: scaleX(1) scaleY(1); }
	100% { -webkit-transform: scaleX(1) scaleY(1);} 
}

              
            
!

JS

              
                
              
            
!
999px

Console