HTML preprocessors can make writing HTML more powerful or convenient. For instance, Markdown is designed to be easier to write and read for text documents and you could write a loop in Pug.
In CodePen, whatever you write in the HTML editor is what goes within the <body>
tags in a basic HTML5 template. So you don't have access to higher-up elements like the <html>
tag. If you want to add classes there that can affect the whole document, this is the place to do it.
In CodePen, whatever you write in the HTML editor is what goes within the <body>
tags in a basic HTML5 template. If you need things in the <head>
of the document, put that code here.
The resource you are linking to is using the 'http' protocol, which may not work when the browser is using https.
CSS preprocessors help make authoring CSS easier. All of them offer things like variables and mixins to provide convenient abstractions.
It's a common practice to apply CSS to a page that styles elements such that they are consistent across all browsers. We offer two of the most popular choices: normalize.css and a reset. Or, choose Neither and nothing will be applied.
To get the best cross-browser support, it is a common practice to apply vendor prefixes to CSS properties and values that require them to work. For instance -webkit-
or -moz-
.
We offer two popular choices: Autoprefixer (which processes your CSS server-side) and -prefix-free (which applies prefixes via a script, client-side).
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.
You can apply CSS to your Pen from any stylesheet on the web. Just put a URL to it here and we'll apply it, in the order you have them, before the CSS in the Pen itself.
You can also link to another Pen here (use the .css
URL Extension) and we'll pull the CSS from that Pen and include it. If it's using a matching preprocessor, use the appropriate URL Extension and we'll combine the code before preprocessing, so you can use the linked Pen as a true dependency.
JavaScript preprocessors can help make authoring JavaScript easier and more convenient.
Babel includes JSX processing.
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.
You can apply a script from anywhere on the web to your Pen. Just put a URL to it here and we'll add it, in the order you have them, before the JavaScript in the Pen itself.
If the script you link to has the file extension of a preprocessor, we'll attempt to process it before applying.
You can also link to another Pen here, and we'll pull the JavaScript from that Pen and include it. If it's using a matching preprocessor, we'll combine the code before preprocessing, so you can use the linked Pen as a true dependency.
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.
Using packages here is powered by esm.sh, which makes packages from npm not only available on a CDN, but prepares them for native JavaScript ESM usage.
All packages are different, so refer to their docs for how they work.
If you're using React / ReactDOM, make sure to turn on Babel for the JSX processing.
If active, Pens will autosave every 30 seconds after being saved once.
If enabled, the preview panel updates automatically as you code. If disabled, use the "Run" button to update.
If enabled, your code will be formatted when you actively save your Pen. Note: your code becomes un-folded during formatting.
Visit your global Editor Settings.
<link href='https://fonts.googleapis.com/css?family=Audiowide' rel='stylesheet' type='text/css'>
<div class="wrapper">
<div class="badge">
<div class="badge-hd">
<div class="badge-hd-title">YUKON</div>
</div>
<div class="badge-bd">
<svg id="js-rays" class="rays" preserveAspectRatio="xMinYMin meet" viewBox="0 0 350 300"></svg>
<div class="peak">
<?xml version="1.0" encoding="utf-8"?>
<!-- Generator: Adobe Illustrator 16.0.0, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
<svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
width="400px" height="400px" viewBox="0 0 400 400" enable-background="new 0 0 400 400" xml:space="preserve">
<path fill="#8AA597" d="M115.35,146.657c0.069,0.008,0.184-0.03,0.252-0.022c-0.023-0.054-0.015-0.1-0.03-0.153
c-0.069-0.03-0.146-0.053-0.207-0.084C115.357,146.497,115.35,146.566,115.35,146.657z"/>
<path fill="#8AA597" d="M99.372,157.554c0.176,1.528,2.889,3.813,4.593,3.943c8.497,0.672,10.889-2.644,11.385-14.839
C111.04,146.459,98.975,154.237,99.372,157.554z"/>
<path fill="#8AA597" d="M248.873,248.462c-3.057-4.959-8.016-9.422-9.139-14.74c-2.767-13.021-7.436-17.682-20.578-16.948
c-11.332,0.627-16.353-3.798-18.041-14.961c-0.481-3.225-2.407-8.643-4.08-8.803c-4.486-0.421-10.974-3.386-13.121,4.63
c-0.283,1.047-3.844,2.369-5.066,1.804c-5.448-2.545-10.606-5.731-17.667-9.697c0.657-2.659,1.429-7.335,2.996-11.729
c1.345-3.744,3.958-7.022,5.326-10.759c1.047-2.858-0.076-7.588,1.697-8.925c7.419-5.571,5.135-13.22,5.868-20.356
c0.283-2.774,1.124-6.044,2.896-8c5.242-5.738,13.785-8.933,13.38-18.767c-0.046-1.062,0.749-2.575,1.635-3.202
c9.346-6.655,3.386-14.709,3.615-24.467c-14.855,13.609-27.86,25.537-41.309,37.855c-4.523-5.25-8.046-6.495-13.663-0.604
c-5.089,5.333-10.468,11.324-20.158,11.217c-3.652-0.039-10.499,6.678-7.893,14.472c2.544,1.116,6.977,2.292,6.946,3.316
c-0.153,4.317-0.588,9.43-3.011,12.708c-7.519,10.17-16,19.63-24.834,30.237H81.331c2.514-4.157,4.073-6.725,5.624-9.292
c1.391-2.323,3.438-4.516,3.974-7.022c0.428-2.017-0.978-4.417-1.559-6.648c-2.308,0.917-5.196,1.253-6.785,2.873
c-2.827,2.889-4.401,7.061-7.343,9.789c-5.204,4.807-5.143,13.143-8.872,16.849c-7.488,7.42-17.88,12.065-27.447,17.17
c-4.18,2.231-11.393,1.918-9.307,8.772c1.604,5.295,6.228,9.712,9.75,14.327c0.428,0.558,3.187,0.382,3.485-0.184
c4.18-7.978,12.371-5.517,18.79-7.717c2.361-0.811,4.21-3.783,5.754-6.129c3.362-5.089,6.281-10.483,9.781-15.466
c0.245-0.344,4.845,1.154,5.655,2.721c1.559,2.973,1.833,6.609,2.636,9.979c1.016,0.39,2.04,0.779,3.049,1.161
c8.229-8.489,16.436-17.002,24.688-25.469c3.813-3.904,7.611-7.847,11.714-11.438c0.52-0.451,4.134,1.192,4.126,1.834
c-0.045,3.591-0.367,7.29-1.352,10.735c-1.353,4.776-4.226,9.231-4.929,14.045c-1.383,9.56,0.84,20.562-3.179,28.586
c-4.715,9.422-4.249,18.247-4.57,27.631c-0.137,4.157,0.627,7.97-5.12,10.591c-2.285,1.047-3.316,12.555-1.459,13.708
c13.731,8.482,28.571,14.848,44.984,16.444c7.137,0.695,14.732,0.283,21.258,2.689c9.674,3.569,11.393,3.768,10.262-6.326
c-2.071-18.622-5.555-37.091-8.505-55.605c-0.13-0.849-0.634-1.857-1.299-2.354c-10.01-7.542-5.586-18.484-6.449-28.104
c-0.115-1.254,2.605-2.759,4.019-4.142c1.452,1.543,3.377,2.857,4.271,4.676c3.752,7.665,7.099,15.527,10.858,23.184
c0.527,1.078,2.476,1.72,3.882,2.048c9.667,2.293,15.878,9.102,17.04,18.95c0.443,3.722-0.037,7.817,1.36,11.118
c4.294,10.141,9.231,20.021,14.099,29.908c0.802,1.635,2.529,2.819,3.828,4.21c1.238-1.788,3.568-3.591,3.537-5.364
c-0.152-9.154,5.701-14.595,11.898-19.439c5.287-4.126,11.453-7.113,15.962-9.842c-1.313-5.578-2.032-10.835-3.843-15.672
C254,256.256,251.287,252.382,248.873,248.462z M149.086,171.14c-6.289,6.06-10.064,8.222-17.063,3.156
c4.661-5.892,8.054-13.135,13.731-16.528c5.792-3.453,6.077-15.17,16.399-11.425c-0.012-0.054-0.02-0.105-0.032-0.159l0.237,0.229
c-0.07-0.027-0.136-0.045-0.205-0.07C164.743,158.364,156.716,163.792,149.086,171.14z"/>
<path fill="#2A2A2A" d="M386.942,196.776c-5.12-2.284-9.353-5.601-12.646-9.636c-0.428-0.122-0.811-0.313-1.23-0.45
c-1.17,0.091-2.346,0.175-3.584,0.175c-5.808,0-10.92-1.077-15.39-2.911c-4.058-0.994-7.236-3.034-9.483-5.846
c-2.574-2.247-4.638-4.921-6.449-7.756c-0.053-0.023-0.106-0.054-0.16-0.077c-3.423-1.711-6.234-4.111-8.756-6.77
c-4.227-1.696-7.879-4.081-10.951-6.977c-1.451-0.604-2.674-1.452-3.988-2.208c-5.578-1.949-10.186-5.097-13.838-9.024
c-0.336-0.176-0.688-0.275-1.017-0.451c-2.651-0.856-5.065-2.018-7.29-3.37c-4.248-1.719-7.916-4.126-10.973-7.083
c-3.179-1.528-6.136-3.324-8.559-5.616c-0.26-0.122-0.55-0.229-0.764-0.375c-6.549-4.462-12.982-9.2-18.896-14.465
c-9.819-8.765-19.723-17.552-28.625-27.21c-8.611-9.337-16-19.791-23.932-29.755c-1.689,1.261-3.377,2.514-5.066,3.775
c-5.372,5.135-10.835,10.186-16.054,15.474c-1.177,1.192-2.14,3.224-2.14,4.867c0.031,6.87-4.157,8.925-9.964,9.972
c-2.201,0.397-4.134,2.147-6.22,3.225c-2.636,1.345-5.387,3.653-7.978,4.463c-3.652,2.674-8.008,4.623-12.975,5.761
c-2.934,2.254-6.235,3.928-9.689,5.227c-0.367,0.428-0.749,0.81-1.124,1.246c-0.161,0.184-0.42,0.306-0.626,0.458
c-2.957,3.095-6.503,5.7-10.69,7.572c-1.75,2.01-3.699,3.867-5.93,5.456c-2.514,2.881-5.77,5.082-9.33,6.954
c-2.506,2.949-5.525,5.501-9.04,7.526c-2.262,2.033-4.745,3.852-7.596,5.28c-2.537,2.743-5.54,5.104-9.009,6.954
c-0.604,0.565-1.162,1.177-1.811,1.704c-2.438,2.888-5.303,5.448-8.726,7.442c-1.811,2.904-3.89,5.632-6.495,7.924
c0.642,8.597,0.015,18.202-2.361,21.724c-0.497,0.733-1.208,1.49-1.994,1.842c-7.275,3.201-14.58,6.327-21.885,9.444
c-0.856,0.367-1.91,0.352-2.659,0.833c-1.505,0.979-3.576,2.529-5.15,3.668c-4.554,5.165-10.774,8.963-18.522,10.729
c-1.796,2.712-3.958,5.173-6.465,7.32c1.017,1.673,2.094,3.316,3.026,5.035c3.928,7.175,6.694,14.992,10.667,22.137
c2.369,4.233,5.784,8.031,9.292,11.446c6.388,6.228,13.876,11.432,19.646,18.148c8.26,9.598,15.932,19.226,28.754,23.375
c6.052,1.956,11.477,5.952,17.063,9.245c6.984,4.111,13.364,10.331,20.868,12.234c10.591,2.689,19.118,12.478,31.352,9.299
c0.756-0.19,2.27,0.275,2.537,0.856c3.492,7.534,10.476,5.433,16.367,5.853c9.667,0.688,19.478,2.109,29.037,1.177
c21.113-2.062,43.455,5.602,63.262-7.572c1.154-0.771,3.171-0.849,4.6-0.497c13.166,3.24,22.84-6.166,33.943-9.834
c10.941-3.614,20.845-10.415,31.16-15.894c1.024-0.543,1.72-1.658,2.637-2.438c7.336-6.281,14.931-12.287,21.961-18.89
c6.479-6.098,12.439-12.761,18.484-19.302c6.066-6.563,11.867-13.364,17.934-19.921c5.814-6.288,11.928-11.89,13.693-21.28
c0.771-4.104,1.65-8.665,2.995-12.86c-1.581-1.269-3.133-2.583-4.577-4.004C391.672,206.259,388.822,201.682,386.942,196.776z
M243.479,286.041c-6.197,4.845-12.051,10.285-11.898,19.439c0.031,1.773-2.299,3.576-3.537,5.364
c-1.299-1.391-3.026-2.575-3.828-4.21c-4.867-9.888-9.805-19.768-14.099-29.908c-1.397-3.301-0.917-7.396-1.36-11.118
c-1.161-9.849-7.373-16.657-17.04-18.95c-1.406-0.328-3.354-0.97-3.882-2.048c-3.759-7.656-7.106-15.519-10.858-23.184
c-0.894-1.818-2.819-3.133-4.271-4.676c-1.414,1.383-4.134,2.888-4.019,4.142c0.863,9.62-3.561,20.562,6.449,28.104
c0.665,0.496,1.169,1.505,1.299,2.354c2.95,18.515,6.434,36.983,8.505,55.605c1.131,10.094-0.588,9.896-10.262,6.326
c-6.526-2.406-14.121-1.994-21.258-2.689c-16.414-1.597-31.253-7.962-44.984-16.444c-1.856-1.153-0.825-12.661,1.459-13.708
c5.747-2.621,4.982-6.434,5.12-10.591c0.321-9.384-0.145-18.209,4.57-27.631c4.019-8.023,1.795-19.026,3.179-28.586
c0.703-4.813,3.576-9.269,4.929-14.045c0.985-3.445,1.307-7.145,1.352-10.735c0.008-0.642-3.606-2.285-4.126-1.834
c-4.104,3.592-7.901,7.534-11.714,11.438c-8.252,8.467-16.459,16.979-24.688,25.469c-1.009-0.382-2.033-0.771-3.049-1.161
c-0.803-3.37-1.078-7.007-2.636-9.979c-0.81-1.566-5.41-3.064-5.655-2.721c-3.5,4.982-6.418,10.377-9.781,15.466
c-1.543,2.346-3.393,5.318-5.754,6.129c-6.418,2.2-14.61-0.261-18.79,7.717c-0.298,0.565-3.057,0.741-3.485,0.184
c-3.522-4.615-8.146-9.032-9.75-14.327c-2.086-6.854,5.127-6.541,9.307-8.772c9.567-5.104,19.959-9.75,27.447-17.17
c3.729-3.706,3.668-12.042,8.872-16.849c2.942-2.728,4.516-6.9,7.343-9.789c1.589-1.62,4.478-1.956,6.785-2.873
c0.581,2.231,1.987,4.631,1.559,6.648c-0.535,2.506-2.583,4.699-3.974,7.022c-1.551,2.567-3.11,5.135-5.624,9.292h13.342
c8.833-10.606,17.315-20.066,24.834-30.237c2.422-3.278,2.858-8.39,3.011-12.708c0.031-1.024-4.401-2.201-6.946-3.316
c0.015,0.054,0.007,0.1,0.03,0.153c-0.068-0.008-0.183,0.03-0.252,0.022c-0.497,12.196-2.888,15.512-11.385,14.839
c-1.704-0.13-4.417-2.415-4.593-3.943c-0.397-3.316,11.668-11.095,15.978-10.896c0-0.091,0.008-0.16,0.015-0.26
c0.061,0.031,0.138,0.054,0.207,0.084c-2.606-7.794,4.241-14.511,7.893-14.472c9.689,0.107,15.069-5.884,20.158-11.217
c5.617-5.892,9.139-4.646,13.663,0.604c13.449-12.318,26.454-24.246,41.309-37.855c-0.229,9.758,5.73,17.812-3.615,24.467
c-0.886,0.627-1.681,2.14-1.635,3.202c0.405,9.834-8.138,13.028-13.38,18.767c-1.772,1.956-2.613,5.227-2.896,8
c-0.733,7.137,1.551,14.786-5.868,20.356c-1.773,1.337-0.65,6.067-1.697,8.925c-1.368,3.737-3.981,7.015-5.326,10.759
c-1.566,4.394-2.338,9.07-2.996,11.729c7.061,3.966,12.219,7.152,17.667,9.697c1.223,0.565,4.784-0.757,5.066-1.804
c2.147-8.016,8.635-5.051,13.121-4.63c1.673,0.16,3.599,5.578,4.08,8.803c1.688,11.163,6.709,15.588,18.041,14.961
c13.143-0.733,17.812,3.928,20.578,16.948c1.123,5.318,6.082,9.781,9.139,14.74c2.414,3.92,5.127,7.794,6.725,12.065
c1.811,4.837,2.529,10.094,3.843,15.672C254.932,278.928,248.766,281.915,243.479,286.041z"/>
<path fill="#2A2A2A" d="M162.122,146.184c0.012,0.054,0.02,0.105,0.032,0.159c0.069,0.025,0.135,0.043,0.205,0.07L162.122,146.184z"
/>
<path fill="#2A2A2A" d="M162.153,146.343c-10.323-3.745-10.608,7.972-16.399,11.425c-5.677,3.393-9.07,10.637-13.731,16.528
c6.999,5.066,10.774,2.904,17.063-3.156C156.716,163.792,164.743,158.364,162.153,146.343z"/>
<path display="none" fill="#604747" stroke="#331818" d="M165.792,212.292l10.417-8.25l2.167-3l2.917-1.667l0.75-2.583
c0,0,2.417-2.083,2.667-2s3.667-1.167,3.667-1.167l5.5-5.833l10.417,9.417l9.5,6.583l11.666,0.583l6.25,15.584
c0,0-11.166,10.582-11.666,10.666s-34.084,2.084-34.75,2.167s-20.583-9.416-20.833-9.833S165.792,212.292,165.792,212.292z"/>
<path display="none" fill="#CC9E9E" stroke="#352020" d="M195.209,190.875l0.832,2.5l2,2l-0.582,1.333h-1.418l-0.832-2.083
l-0.5,2.083l-2.167,0.417l0.417,4.167l-0.833,1.166l-1.75,1l0.917,1h1.667l2.25-1.083l0.916,1.75l0.084,1.833l2.166-0.5
c0,0,2.166,1.001,2.166,1.334s0,3.083,0,3.083l1.418,1c0,0,1.75,0.417,1.75,0.75s0.416,1.749,0.416,2.333s-0.916,2.417-0.916,2.417
h-2l-0.584,3.25l-2.084,0.583l-1.291-2.166l-1.209-4.5l-0.832-2.334l-3.917-3.916l0.417,2.583l1.167,1l1,1.917l0.5,2.416v3v2
l-4,0.334l-4.417-1.5l-2.667-1.667l-1.25-1.333l1.833-3v-1.917l0.417-4.417l0.917-2.416l-2.333,2.666l-1.667,0.917l-1.5-0.75v-0.417
l-0.5,2.417l-1.917,1.167l-2.333-0.167l-1.25-0.833l-0.583-2.084l3.083-2l0.917-1.25l0.167-1.666l1.083-2.75l3.167-1.084
l0.833-1.666l1.75-1.334l1.083-1l2.917-0.583L195.209,190.875z"/>
</svg>
</div>
</div>
</div>
</div>
/* ------------------------------------------------------------
GENERAL
------------------------------------------------------------- */
body {
padding-top: 40px;
background-color: #e84f3e ;
font-family: 'Audiowide', cursive;
}
/* ------------------------------------------------------------
WRAPPER
------------------------------------------------------------- */
.wrapper {
width: 600px;
margin: 0 auto;
text-align: center;
}
/* ------------------------------------------------------------
BADGE
------------------------------------------------------------- */
.badge {
position: relative;
display: inline-block;
overflow: hidden;
width: 350px;
height: 425px;
border: 8px solid #2a2a2a;
border-radius: 125px 125px 200px 200px;
background-color: #8aa597;
}
.badge-hd {
height: 100px;
line-height: 100px;
background-color: #dfc299;
box-shadow: 0 2px 5px rgba(0,0,0,0.25);
}
.badge-hd-title {
font-size: 48px;
text-transform: uppercase;
font-wieght: 700;
color: #2a2a2a;
}
/* ------------------------------------------------------------
RAYS
------------------------------------------------------------- */
.rays {
width: 350px;
height: 300px;
}
.peak {
position: absolute;
bottom: -100px;
left: 0;
}
var RAY_QUANT = 50;
var RADIUS = 140;
var RADIUS_VARIENT = .5;
var ROTATE_SPEED = 70000;
var RAY_SPEED = 100;
var FILL_COLOR = 'rgba(232, 79, 62, .65)';
var STROKE_COLOR = 'rgba(232, 79, 62, .65)';
var STROKE_WIDTH = 3;
var RAY_EASE = mina.bounce;
var RAY_FREEQUENCY = .05;
/**
* Animates the vector rays visually
*
* @class RaysView
* @param {jQuery} $element A reference to the containing DOM element.
* @constructor
**/
function RaysView($element) {
/**
* A reference to the containing DOM element.
*
* @default null
* @property $element
* @type {jQuery}
* @public
*/
this.$element = $element;
this.init();
}
var proto = RaysView.prototype;
/**
* Initializes the UI Component View.
* Runs a single setupHandlers call, followed by createChildren and layout.
* Exits early if it is already initialized.
*
* @method init
* @returns {RaysView}
* @private
*/
proto.init = function() {
this.layout();
this.paper = new Snap('#js-rays');
this.totalGroup = this.paper.group();
this.createRays();
return this;
};
/**
* Performs measurements and applys any positioning style logic.
* Should be run anytime the parent layout changes.
*
* @method layout
* @returns {RaysView}
* @public
*/
proto.layout = function() {
this.centerX = this.$element.width() / 2;
this.centerY = this.$element.width() / 2;
this.lineX1 = 0;
this.lineY1 = 0;
this.lineX2 = 0;
this.lineY2 = 0;
return this;
};
//////////////////////////////////////////////////////////////////////////////////
// HELPER METHODS
//////////////////////////////////////////////////////////////////////////////////
/**
* creates each of the rays
*
* @method createRays
* @public
*/
proto.createRays = function() {
var i = 0;
var l = RAY_QUANT;
for (; i < l; i++) {
this.update(i);
}
this.animateGroup();
};
/**
* update coordinates for line placement
*
* @method update
* @public
*/
proto.update = function(i) {
var varient = RADIUS * RADIUS_VARIENT;
var minHeight = RADIUS - varient;
var r = Math.random() * (RADIUS - minHeight) + minHeight;
var x = this.centerX + r * Math.cos(2 * Math.PI * i / RAY_QUANT);
var y = this.centerX + r * Math.sin(2 * Math.PI * i / RAY_QUANT);
var lineCoords = {
lineX2: x,
lineY2: y,
endpointX: this.centerX + RADIUS * Math.cos(2 * Math.PI * i / RAY_QUANT),
endpointY: this.centerY + RADIUS * Math.sin(2 * Math.PI * i / RAY_QUANT)
}
this.draw(lineCoords);
};
/**
* draw the circle
*
* @method draw
* @public
*/
proto.draw = function(lineCoords) {
var line = this.paper.line(this.centerX, this.centerY, lineCoords.lineX2, lineCoords.lineY2);
var circ = this.paper.circle(lineCoords.lineX2, lineCoords.lineY2, 5);
var rayGroup = this.paper.group(line, circ).attr({
'fill': FILL_COLOR,
'stroke': STROKE_COLOR,
'stroke-width': STROKE_WIDTH
});
rayGroup.lineCoords = lineCoords;
this.animateRay(rayGroup);
this.totalGroup.add(rayGroup);
};
/**
* Animate a vector group
*
* @method animateRay
* @public
*/
proto.animateRay = function(group) {
var raySpeed = Math.random() * (ROTATE_SPEED * RAY_FREEQUENCY);
var line = group[0];
var circ = group[1];
var self = this;
setTimeout(function() {
if (group.reverse) {
line.animate({
x1: self.centerX,
y1: self.centerX,
x2: group.lineCoords.lineX2,
y2: group.lineCoords.lineY2
}, RAY_SPEED, mina.bounce, self.animateRay.bind(self, group));
circ.animate({
cx: group.lineCoords.lineX2,
cy: group.lineCoords.lineY2,
}, RAY_SPEED, RAY_EASE);
group.reverse = false;
} else {
line.animate({
x1: self.centerX,
y1: self.centerX,
x2: group.lineCoords.endpointX,
y2: group.lineCoords.endpointY
}, RAY_SPEED, RAY_EASE, self.animateRay.bind(self, group));
circ.animate({
cx: group.lineCoords.endpointX,
cy: group.lineCoords.endpointY,
}, RAY_SPEED, RAY_EASE);
group.reverse = true;
}
}, raySpeed);
};
/**
* Animate the entire group
*
* @method animateGroup
* @public
*/
proto.animateGroup = function() {
this.resetGroup();
var totalGroupAnim = this.totalGroup.animate({
transform: 'rotate(360, ' + this.centerX + ',' + this.centerY + ')'
}, ROTATE_SPEED, mina.linear, this.animateGroup.bind(this));
};
/**
* reset the group transform
*
* @method resetGroup
* @public
*/
proto.resetGroup = function() {
var t = new Snap.Matrix()
t.rotate(0, 300, 300)
this.totalGroup.transform(t);
};
var raysView = new RaysView($('#js-rays'));
Also see: Tab Triggers