123

Pen Settings

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

You're using npm packages, so we've auto-selected Babel for you here, which we require to process imports and make it all work. If you need to use a different JavaScript preprocessor, remove the packages in the npm tab.

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

Use npm Packages

We can make npm packages available for you to use in your JavaScript. We use webpack to prepare them and make them available to import. We'll also process your JavaScript with Babel.

⚠️ This feature can only be used by logged in users.

Code Indentation

     

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.

HTML Settings

Here you can Sed posuere consectetur est at lobortis. Donec ullamcorper nulla non metus auctor fringilla. Maecenas sed diam eget risus varius blandit sit amet non magna. Donec id elit non mi porta gravida at eget metus. Praesent commodo cursus magna, vel scelerisque nisl consectetur et.

            
              //- ICONS -//
- var el = {}

svg(style="opacity:0;height:0")
  path#twitter-icon(d='M32,6.076c-1.177,0.522-2.442,0.875-3.771,1.034c1.355-0.812,2.396-2.099,2.887-3.632c-1.269,0.752-2.674,1.299-4.169,1.593c-1.197-1.276-2.904-2.073-4.792-2.073c-3.626,0-6.565,2.939-6.565,6.565c0,0.515,0.058,1.016,0.17,1.496C10.304,10.785,5.466,8.171,2.228,4.2c-0.565,0.97-0.889,2.097-0.889,3.3c0,2.278,1.159,4.287,2.921,5.465c-1.076-0.034-2.088-0.33-2.974-0.821c0,0.027,0,0.055,0,0.083c0,3.181,2.263,5.834,5.266,6.437c-0.551,0.15-1.131,0.23-1.729,0.23c-0.423,0-0.834-0.041-1.235-0.117c0.835,2.607,3.26,4.506,6.133,4.559c-2.247,1.761-5.078,2.811-8.153,2.811c-0.53,0-1.053-0.031-1.566-0.092c2.906,1.863,6.356,2.95,10.064,2.95c12.076,0,18.679-10.004,18.679-18.68c0-0.285-0.006-0.568-0.019-0.849C30.007,8.549,31.12,7.393,32,6.076z')
    g#myspace-icon
      path(d='M23.156,10.582c2.893,0,5.239-2.371,5.239-5.291C28.396,2.368,26.049,0,23.156,0c-2.895,0-5.239,2.368-5.239,5.291C17.917,8.211,20.262,10.582,23.156,10.582z M23.156,12c-2.483,0-4.626,1.449-5.661,3.553c-0.013-2.544-2.058-4.603-4.58-4.603c-1.748,0-3.267,0.988-4.038,2.44v-0.925c0-1.771-1.424-3.21-3.179-3.21c-1.756,0-3.179,1.438-3.179,3.21v6.841h5.814v6.128h8.497V32H29.48V18.387C29.48,14.86,26.648,12,23.156,12z M5.698,8.543c1.454,0,2.632-1.189,2.632-2.658S7.152,3.227,5.698,3.227S3.064,4.416,3.064,5.885S4.244,8.543,5.698,8.543z M12.914,9.922c2.097,0,3.796-1.716,3.796-3.831c0-2.117-1.699-3.833-3.796-3.833c-2.095,0-3.794,1.716-3.794,3.833C9.12,8.206,10.819,9.922,12.914,9.922z')
    g#quora-icon
      path(d='M23.098,26.838c0.76-0.439,1.656-1.047,2.504-1.798c2.726-2.44,4.659-6.508,4.659-11.344c0-5.135-2.24-9.502-5.579-11.641C22.571,0.728,20.197,0,16.901,0c-3.119,0-6.196,0.685-8.789,2.354C4.683,4.537,1.739,8.903,1.739,14.552c0,4.452,1.232,7.963,3.736,10.402c2.373,2.354,6.066,3.722,9.536,3.722c0.089,0,2.029,0.093,3.706-0.201c0.316-0.057,0.619-0.13,0.908-0.207c0.851,2.025,1.913,3.65,3.972,3.65c1.358,0.121,3.182,0.141,3.45-0.168s0.176-2.832,0.176-2.832S24.542,29.298,23.098,26.838z M11.566,23.155c-1.739-1.754-2.634-3.936-2.634-8.817c0-3.937,1.052-7.447,2.74-8.987c1.37-1.156,2.845-1.713,5.004-1.713c1.742,0,3.269,0.727,4.376,2.354c1.422,2.011,2.212,5.394,2.212,8.903c0,2.853-0.532,5.515-1.774,7.436c-1.67-2.934-4.835-2.915-7.151-2.839v3.28c0,0,2.618-0.625,3.926,2.003c-0.648,0.162-1.315,0.222-1.957,0.222C14.676,24.997,13.095,24.526,11.566,23.155z')
    g#blogging-icon
      path(fill-rule='evenodd', clip-rule='evenodd', d='M29.691,12.044h-1.213l0,0c0,0-0.217,0-0.251,0c-1.989,0-2.332-1.774-2.332-1.774l0.045,0.035C25.708,4.581,21.375,0.036,15.455,0v0.007h-4.799h0.068C4.825,0.045,0.064,4.764,0.064,10.693c0,0.022,0-0.022,0-0.022l0,0v10.664l0,0c0,5.925,4.736,10.625,10.655,10.661V32h10.655v-0.007c5.328-0.109,10.561-4.733,10.561-10.658l0,0v-7.187C31.936,13.011,30.827,12.044,29.691,12.044z M10.127,7.954c0.015,0,0,0.003,0,0.003l0,0h5.92l0,0c1.183,0.023,1.938,1.108,1.938,2.153c0,1.047-0.755,1.935-1.938,1.935l0,0h-5.92v-0.188c0,0-0.058,0.188-0.073,0.188c-1.061,0-2.14-0.903-2.14-1.966C7.915,9.019,9.066,7.954,10.127,7.954z M21.062,24.081L21.062,24.081H10.127v-0.062c0,0-0.058,0-0.073,0c-1.061,0-2.122-1.026-2.122-2.087c0-1.062,1.058-1.906,2.119-1.906c0.015,0,0.058,0,0.058,0h-0.002h11.081h-0.031c1.183,0,1.812,0.948,1.812,1.996C22.969,23.066,22.246,24.081,21.062,24.081z')
    g#youtube-icon
      path(fill-rule='evenodd', clip-rule='evenodd', d='M25.389,32H6.385c-3.021,0-5.469-2.67-5.469-5.962v-5.743c0-3.292,2.449-5.735,5.469-5.735h19.004c3.021,0,5.471,2.489,5.471,5.78v5.698C30.859,29.33,28.41,32,25.389,32z M10.377,17.388H5.138v1.627h1.766v9.567h1.707v-9.567h1.766V17.388z M14.902,20.731h-1.515v6.273c-0.143,0.18-0.298,0.327-0.47,0.443c-0.17,0.116-0.313,0.173-0.422,0.173c-0.142,0-0.246-0.042-0.312-0.131c-0.061-0.087-0.094-0.228-0.094-0.424v-6.335h-1.514v6.905c0,0.493,0.09,0.858,0.266,1.106c0.179,0.247,0.44,0.369,0.792,0.369c0.285,0,0.577-0.085,0.88-0.265c0.304-0.173,0.593-0.429,0.875-0.763v0.905h1.515V20.731z M21.248,22.475c0-0.676-0.126-1.191-0.38-1.544c-0.252-0.353-0.617-0.299-1.098-0.299c-0.235,0-0.893,0.063-1.124,0.196c-0.228,0.131-0.444,0.322-0.649,0.572v-3.832h-1.531V28.99h1.531v-0.633c0.197,0.255,0.416,0.439,0.647,0.56c0.23,0.121,0.92,0.18,1.219,0.18c0.447,0,0.793-0.382,1.028-0.693c0.238-0.313,0.356-0.762,0.356-1.346V22.475z M26.756,26.103h-1.558v0.377c0,0.486-0.053,0.798-0.151,0.942c-0.101,0.142-0.275,0.213-0.527,0.213c-0.241,0-0.412-0.082-0.513-0.251c-0.1-0.168-0.147-0.47-0.147-0.904v-1.557h2.896v-2.106c0-0.782-0.187-1.382-0.558-1.801c-0.372-0.417-0.905-0.625-1.599-0.625c-0.68,0-1.229,0.225-1.658,0.675c-0.43,0.45-0.645,1.037-0.645,1.751v3.71c0,0.797,0.197,1.423,0.585,1.873c0.389,0.454,0.925,0.681,1.604,0.681c0.755,0,1.322-0.213,1.699-0.638c0.384-0.431,0.571-1.068,0.571-1.916V26.103z M23.859,22.804c0-0.348,0.049-0.596,0.156-0.74c0.105-0.154,0.277-0.229,0.519-0.229c0.23,0,0.401,0.074,0.504,0.229c0.105,0.145,0.16,0.393,0.16,0.74v0.834h-1.339V22.804zM18.721,27.803c-0.127,0-0.247-0.031-0.364-0.089c-0.116-0.058-0.237-0.16-0.359-0.294v-5.146c0.104-0.112,0.207-0.198,0.312-0.252c0.105-0.055,0.213-0.08,0.321-0.08c0.204,0,0.786,0.072,0.897,0.215c0.106,0.145,0.158,0.354,0.158,0.635v4.266c0,0.265-0.045,0.452-0.131,0.568C19.469,27.745,18.908,27.803,18.721,27.803z M22.412,11.442c-0.306,0.352-0.626,0.622-0.962,0.806c-0.332,0.182-0.654,0.276-0.969,0.276c-0.388,0-0.677-0.131-0.873-0.39c-0.193-0.255-0.292-0.64-0.292-1.154v-7.22h1.668v6.623c0,0.203,0.038,0.351,0.107,0.441c0.068,0.093,0.184,0.139,0.34,0.139c0.122,0,0.278-0.061,0.467-0.182c0.187-0.122,0.359-0.276,0.514-0.464V3.761h1.672v8.638h-1.672V11.442z M15.565,12.616c-0.731,0-1.317-0.218-1.755-0.652s-0.657-1.017-0.657-1.751V5.735c0-0.671,0.224-1.202,0.673-1.599c0.449-0.396,1.055-0.594,1.814-0.594c0.691,0,1.257,0.209,1.701,0.625c0.439,0.419,0.661,0.96,0.661,1.617v4.462c0,0.739-0.217,1.315-0.648,1.738C16.92,12.406,16.324,12.616,15.565,12.616z M16.3,5.67c0-0.188-0.068-0.339-0.204-0.458c-0.136-0.116-0.315-0.173-0.537-0.173c-0.204,0-0.368,0.057-0.497,0.173c-0.126,0.119-0.19,0.271-0.19,0.458v4.706c0,0.237,0.06,0.419,0.178,0.549c0.119,0.132,0.289,0.195,0.509,0.195c0.227,0,0.406-0.065,0.54-0.198c0.133-0.132,0.2-0.315,0.2-0.546V5.67z M10.829,12.398H8.948V7.07L6.708,0h1.895l1.222,4.681h0.118L11.106,0h1.911l-2.188,6.852V12.398z')
    g#facebook-icon
      path(fill-rule='evenodd', clip-rule='evenodd', d='M23.418,11h-4.944V8c0-1.247,1.392-2,1.979-2c0.585,0,2.966,0,2.966,0V0l-4.094,0.001c-5.503,0-6.756,4.089-6.756,6.706L12.538,11H8.582v6h3.956c0,7.132,0,15,0,15h5.936c0,0,0-7.835,0-15h3.955L23.418,11z')
    g#foursquare-icon
      path(d='M31.851,2.002c-3.902,4.117-7.806,8.235-11.709,12.353c-0.05,0-0.1,0-0.149,0c-1.392-1.382-2.782-2.765-4.174-4.146c-0.028,0-0.057,0-0.085,0c-0.563,0.549-1.127,1.098-1.691,1.646c-0.036-0.008-0.071-0.015-0.107-0.021c-0.192-0.413-0.385-0.826-0.578-1.239C12.414,9.311,11.466,8.3,9.932,7.602C9.526,7.416,9.051,7.347,8.627,7.195c-1.029-0.368-3.153,0.008-3.875,0.32c-0.436,0.189-0.845,0.269-1.22,0.514c-1.3,0.847-2.528,2.039-3.083,3.611c-0.138,0.39-0.117,0.637-0.257,1.047c-0.267,0.784-0.255,2.596,0.021,3.377c0.797,2.244,2.136,4.008,4.388,4.851c0.475,0.179,1.037,0.259,1.541,0.406c0.319,0.094,0.729-0.074,0.963,0.086c2.875,2.863,5.751,5.728,8.626,8.591c0.014,0,0.028,0,0.043,0c2.397-2.386,4.794-4.772,7.192-7.159c0.635-0.634,1.27-1.268,1.905-1.902c0.221-0.221,0.668-0.501,0.77-0.812c0.026-0.165-0.73-0.841-0.877-1.048c0-0.007,0-0.014,0-0.021c0.837-0.863,1.917-1.563,2.868-2.308c0.778-0.609,1.511-1.378,2.333-1.924c0.27-0.178,1.975-1.466,2.033-1.646c0-3.718,0-7.438,0-11.155C31.95,2.017,31.9,2.009,31.851,2.002z M31.208,12.623c-1.555,1.247-3.11,2.493-4.666,3.74c-2.533,1.997-4.971,4.118-7.534,6.091c-0.876,0.674-1.708,1.412-2.59,2.095c-0.443,0.343-0.842,0.847-1.37,1.09c-0.552-0.246-1.159-1.021-1.605-1.433c-0.97-0.892-1.94-1.81-2.933-2.671c-0.347-0.301-1.273-0.971-1.477-1.325c-0.788-0.097-1.751,0.396-2.718,0.149c-1.609-0.41-2.725-0.917-3.703-1.923c-0.471-0.484-0.942-1.209-1.199-1.881c-0.178-0.467-0.27-0.986-0.407-1.496c-0.232-0.861,0.131-2.263,0.321-2.82c0.835-2.451,2.407-3.47,5.008-4.168c0.897-0.24,2.214,0.121,2.804,0.32c2.378,0.802,3.493,2.421,4.174,4.937c0.18,0.667,0.001,1.954-0.15,2.501c-0.048,0.176-0.387,0.815-0.342,0.983c0.556,0.911,1.113,1.823,1.669,2.735c0.227,0.406,0.435,1.002,0.792,1.282c0.516-0.328,1.249-1.269,1.669-1.753c0.96-1.104,2.103-2.055,3.018-3.205c0.856-0.884,1.712-1.767,2.568-2.65c2.868-3.049,5.737-6.099,8.604-9.147c0.242,0.114,0.15,1.524,0.15,1.945c0,1.581,0,3.164,0,4.744C31.294,11.284,31.435,12.269,31.208,12.623z')
    g#google-plus-icon
      path(fill-rule='evenodd', clip-rule='evenodd', d='M32,7.499h-5v5h-2v-5h-5v-2h5V0.5h2v4.999h5V7.499z M15.025,3.008c0.251,0.157,0.534,0.386,0.848,0.688c0.301,0.314,0.524,0.406,0.822,0.856c0.284,0.426,0.536,0.93,0.756,1.51c0.18,0.58,0.271,1.257,0.271,2.031c-0.024,1.419-0.35,2.553-0.975,3.404c-0.307,0.413-0.631,0.793-0.975,1.142c-0.38,0.348-0.785,0.702-1.214,1.063c-0.245,0.245-0.472,0.522-0.68,0.832c-0.245,0.322-0.368,0.696-0.368,1.122c0,0.413,0.126,0.754,0.377,1.025c0.213,0.258,0.421,0.483,0.623,0.677l1.396,1.103c0.868,0.685,1.629,1.438,2.281,2.264c0.617,0.839,0.938,1.935,0.963,3.288c0,1.923-0.881,3.625-2.641,5.107c-1.826,1.535-4.46,2.328-7.903,2.38c-2.882-0.026-5.034-0.618-6.455-1.776C0.717,28.643,0,27.349,0,25.843c0-0.734,0.233-1.552,0.7-2.452c0.453-0.902,1.273-1.694,2.46-2.375c1.333-0.734,2.732-1.224,4.198-1.468c1.453-0.206,2.659-0.321,3.619-0.348c-0.297-0.377-0.561-0.778-0.793-1.206c-0.271-0.414-0.406-0.914-0.406-1.498c0-0.35,0.052-0.642,0.155-0.875c0.09-0.246,0.174-0.473,0.251-0.681c-0.468,0.052-0.908,0.077-1.322,0.077c-2.19-0.025-3.86-0.69-5.008-1.992c-1.202-1.212-1.803-2.624-1.803-4.235c0-1.947,0.851-3.714,2.554-5.3c1.169-0.929,2.724-1.273,3.949-1.562c1.213-0.249,2.315-0.441,3.375-0.441H20l-2.374,1.499L15.025,3.008z M9.564,20.358c-0.852,0.116-1.723,0.304-2.614,0.562c-0.209,0.078-0.504,0.193-0.884,0.349c-0.38,0.167-0.766,0.406-1.159,0.716c-0.38,0.322-0.701,0.723-0.963,1.199c-0.302,0.504-0.452,1.109-0.452,1.819c0,1.393,0.655,2.54,1.965,3.443c1.245,0.903,2.948,1.368,5.109,1.394c1.939-0.025,3.419-0.438,4.441-1.238c0.996-0.787,1.494-1.799,1.494-3.037c0-1.007-0.341-1.884-1.022-2.632c-0.721-0.71-1.847-1.58-3.38-2.612c-0.262-0.026-0.57-0.039-0.924-0.039C10.966,20.256,10.429,20.281,9.564,20.358z M12.988,5.196c-0.389-0.763-0.707-1.092-1.324-1.578c-0.63-0.459-1.354-0.702-2.173-0.729C8.407,2.916,7.173,3.076,6.434,3.917C5.811,4.796,5.513,5.777,5.54,6.863c0,1.435,0.435,2.927,1.306,4.478c0.422,0.724,0.966,1.337,1.633,1.841c0.667,0.505,1.428,0.757,2.286,0.757c1.083-0.039,1.986-0.414,2.708-1.125c0.348-0.504,0.572-1.021,0.671-1.551c0.06-0.529,0.09-0.975,0.09-1.337C14.233,8.362,13.818,6.785,12.988,5.196z')
    g#linkedin-icon
      path(fill-rule='evenodd', clip-rule='evenodd', d='M25.113,31.985V20.734c0-2.805-0.803-4.622-3.215-4.622c-1.84,0-3.098,1.29-3.58,2.538c-0.177,0.446-0.506,0.948-0.506,1.572v11.763H11c0,0,0.1-19.763,0-21.99h6.813v4.091c-0.014,0.023,0.256,0.043,0.242,0.067l0.245-0.067l0,0c0.886-1.422,2.971-3.964,6.509-3.964c4.383,0,7.129,3.495,7.129,9.908V32L25.113,31.985z M0.083,9.996h6.784L7.02,32H0.062L0.083,9.996z M3.671,7.107c-1.951,0-3.532-1.591-3.532-3.554C0.139,1.591,1.721,0,3.671,0s3.532,1.591,3.532,3.553C7.203,5.516,5.622,7.107,3.671,7.107z')

//- MIXINS nad FUNCTIONS -//
- var random = function(a, b){
-   return Math.floor((Math.random() * ((b + 1) - a)) + a);
- }

mixin icon(el)
  div.icon(class=el.class, id=el.idAttribute, title=el.title)
    svg(viewBox="0 0 32 32")
      use(xlink:href="#" + el.path)

//- FERRIS WHEEL -//
- var icons = ['facebook', 'linkedin', 'google-plus', 'foursquare', 'quora', 'blogging', 'youtube', 'myspace' ]
.ferris-wheel#js-ferris-wheel.is-open
  svg.ferris-wheel--script-path(width='731px', height='560px', viewbox='0 0 731 560')
    defs
      path(id="ferris-script", fill='none', stroke='#E30613', stroke-width='2', stroke-miterlimit='10', d='M-522.865,1384.396L57.03,347.583c0,0,67.789-114.568,90.385-152.757l0,0C187.87,123.386,264.57,75.175,352.53,75.175c130.094,0,235.555,105.461,235.555,235.556c0,105.606-69.498,194.983-165.256,224.886L-721.942,922.059')
    text
      textPath(id="js-ferris-text", xlink:href="#ferris-script", startOffset="0") data harvested from 60+ social networks

  .ferris-wheel--core
    - for (var i=0; i<12; i++)
      - el = { class: 'n-'+i + ' n-'+icons[ i % icons.length ], id: '' }
      - icon = { path: icons[ i % icons.length ] + '-icon'  }
      .cabin(class=el.class, id=el.id)
        .cabin--handle
        .cabin--core
          .cabin--core2
            +icon(icon)
            .cabin--base
            - for (var j=0; j<random(2,3); j++)
              - el = { class: 'human-'+j, id: '' }
              .human(class=el.class, id=el.id)

    .ferris-wheel--circle1
    .ferris-wheel--circle2

    - var spikesCnt = 24
    - for (var i=0; i<spikesCnt; i++)
      .ferris-wheel--spike(class="n-" + i)

    - for (var i=0; i<spikesCnt; i++)
      .ferris-wheel--spike(class="s-" + i)

  .ferris-base
    .ferris-base--center
      - el = { path: 'twitter-icon'  }
      +icon(el)
    .ferris-base--top
    .ferris-base--main
    .ferris-base--spike.is-1
    .ferris-base--spike.is-2
    .ferris-base--handle

.ground
  .button#js-button toggle
            
          
!
            
              /* MIXINS */
*
  box-sizing border-box

center-shift(size)
  margin-top:  -(size/2)
  margin-left: -(size/2)
  position absolute
  left 50%
  top 50%

rect(size)
  width size
  height size

circle(size)
  rect size
  border-radius 50%

random(a,b)
  return math(math(0, 'random')*(b - a + 1) + a, 'floor')

/* ENVIROMENT */
fontSize = 16
PX = (1/fontSize)rem
/* grid size = 10px in rem equivalent */
gs = 10*PX

html
  font-size (fontSize)px

body
  background #6ED2D2 url('https://is.gd/Tv0ZyT') repeat top left
  position   relative

html, body
  height 100%

buttonColor = #DD5754
buttonHeight = 5*gs
.button
  background buttonColor
  border-radius 3*PX
  text-transform uppercase
  color white
  height buttonHeight
  line-height buttonHeight
  width  20*gs
  text-align center
  letter-spacing 2*PX
  &:hover
    background-color lighten(buttonColor,3)
    cursor pointer
  &:active
    background-color buttonColor

groundHeight = 12*gs
.ground
  position absolute
  left 0
  bottom 0
  height groundHeight
  width 100%
  background #493442 url('https://is.gd/Tv0ZyT') repeat bottom right
  
  .button
    margin-left  auto
    margin-right auto
    margin-top   ((groundHeight - buttonHeight)/2)
    position relative
    z-index 2

/* FERRIS WHEEL */
.human
  background-color #6e6e6e
  border-radius 50%
  height 26*PX
  width 10*PX
  position relative
  &:after
    content ''
    position absolute
    rect 7*PX
    background-color inherit
    top - 5*PX
    border-radius 50%
    left 50%
    margin-left - 3*PX

ferrisWheelTransitionCoef = .3s
.ferris-base
  margin-left 50px
  position relative
  width 238*PX
  height 39*PX
  
  .ferris-base--main
    background-color #ce5250
    rect 100%
    position relative
    z-index 1
    height 0%
    top 100%

    .is-open &
      height 100%
      top 0
      transition all ferrisWheelTransitionCoef linear

  baseTopColor = #9b2e2e
  topWidth = 108%
  baseTopHeight = 12*PX
  top-height
  .ferris-base--top
    position absolute
    height baseTopHeight
    background-color baseTopColor
    z-index 2
    width 0
    margin-left 50%
    overflow hidden
    opacity 0

    .is-open &
      width topWidth
      margin-left -4%
      overflow visible
      opacity 1
      transition all ferrisWheelTransitionCoef linear
      transition-delay ferrisWheelTransitionCoef

    triangleWidth = 8*PX
    &:before, &:after
      content ''
      position absolute
      border baseTopHeight solid rgba(baseTopColor, 0)
      border-left-width  triangleWidth
      border-right-width triangleWidth
      border-top-color baseTopColor
      top 0

    &:before
      left  - triangleWidth

    &:after
      right - triangleWidth
    
  baseSpikeHeight = 185*PX
  baseSpikeWidth  = 15*PX
  .ferris-base--spike
    height baseSpikeHeight - 30*PX
    width baseSpikeWidth
    background-color #b33333
    position absolute
    top - baseSpikeHeight + 23*PX
    left 50%
    margin-left - (baseSpikeWidth/2)
    transform-origin 50% top
    z-index 0
    height (baseSpikeHeight/2)
    opacity 0
    transition all .45s ease-out 
    
    translateSize = baseSpikeHeight
    &.is-1
      transform rotate(90deg) translateX(translateSize)
    &.is-2
      transform rotate(-90deg) translateX(- translateSize)

    .is-open &
      rotateAngle = 19deg
      transition all (1.5*ferrisWheelTransitionCoef) linear, opacity 0 linear
      transition-delay 2*ferrisWheelTransitionCoef
      height baseSpikeHeight
      opacity 1

      &.is-1
        transform rotate(rotateAngle)
      &.is-2
        transform rotate(- rotateAngle)
        
  .ferris-base--handle
    circle 30*PX
    background-color #ff6d6a
    position absolute
    left 50%
    margin-left - 15*PX
    top - baseSpikeHeight + 10*PX
    transform scale(0)

    .is-open &
      transform scale(1)
      transition all ferrisWheelTransitionCoef cubic-bezier(0.350, 1.650, 0.375, 0.790);
      transition-delay 4*ferrisWheelTransitionCoef

    size = 35%
    &:after
      content ''
      circle size
      center-shift size
      background-color #b72737
          
spikeHeight = 38*PX
cabinSize = 44*PX
ferrisWheelSize = 375
/* 4a3bad0ec6b13193efca6723a150cfba */
.ferris-wheel
  rect ferrisWheelSize*PX
  z-index 0
  position absolute
  bottom groundHeight + 14*PX
  left 50%
  margin-left -190*PX
  .ferris-wheel--script-path
    position absolute
    top  - 16*gs
    left - 20*gs
    text 
      fill #493542
      font-size 4*gs
  .ferris-wheel--core
    animation-fill-mode both
    animation ferris-wheel-rotate 30s linear infinite
  .cabin--core
    animation-fill-mode both
    animation ferris-cabin-rotate 30s linear infinite
  &.is-open 
    .ferris-base
      transform translateY(0)
      transition all 0 linear

    .ferris-base--center
      transform scale(1)
      transition all ferrisWheelTransitionCoef cubic-bezier(0.350, 1.650, 0.375, 0.790);
      transition-delay 4.5*ferrisWheelTransitionCoef

    .ferris-wheel--circle2
      transform scale(1)
      transition all ferrisWheelTransitionCoef cubic-bezier(0.350, 1.650, 0.375, 0.790);
      transition-delay 5*ferrisWheelTransitionCoef

    .ferris-wheel--circle1
      transform scale(1)
      transition all ferrisWheelTransitionCoef cubic-bezier(0.350, 1.650, 0.375, 0.790);
      transition-delay 5.5*ferrisWheelTransitionCoef

    .ferris-wheel--spike
      transition all ferrisWheelTransitionCoef linear
      transition-delay 6*ferrisWheelTransitionCoef
      height spikeHeight
      opacity 1

      spikeAngle = 60
      spikesCircleSize = (ferrisWheelSize*.69)
      cnt = 24
      PI = 3.141598
      step = (2*PI)/cnt
      rotateStep = 360/cnt
      rotateAngle = 0
      centerX = (ferrisWheelSize/2) - 1
      centerY = (ferrisWheelSize/2) 
      radius  = spikesCircleSize/2
      angle = 0
      for i in 0..(cnt - 1)
        &.n-{i}
          x = centerX + cos(angle)*radius
          y = centerY + sin(angle)*radius
          transform translateX(x*PX) translateY(y*PX - (spikeHeight/2)) rotate((rotateAngle - spikeAngle)deg)
          transform-origin 50% 50%
        
        rotateAngle = rotateAngle + rotateStep
        angle = angle + step
      
      rotateAngle = 0
      angle       = .16
      for i in 0..(cnt - 1)
        &.s-{i}
          x = centerX + cos(angle)*radius
          y = centerY + sin(angle)*radius
          transform translateX(x*PX) translateY(y*PX - (spikeHeight/2)) rotate((rotateAngle + spikeAngle)deg)
          transform-origin 50% 50%
        
        rotateAngle = rotateAngle + rotateStep
        angle = angle + step

    .cabin
      opacity 1
      transition-duration 0

      cnt = 12
      PI = 3.141598
      step = (2*PI)/cnt
      rotateStep = 360/cnt
      rotateAngle = 0
      centerX = ferrisWheelSize/2
      centerY = ferrisWheelSize/2
      radius  = ferrisWheelSize/2
      angle = 0
      .human
        transition top ferrisWheelTransitionCoef linear
      for i in 0..(cnt - 1)
        &.n-{i}
          .human-0
            top  - 5*PX
            right 20%
            transition-delay 7*ferrisWheelTransitionCoef + (random(0,25)/100)
          .human-1
            top  - random(0,5)*PX
            right 40%
            transition-delay 7*ferrisWheelTransitionCoef + (random(0,25)/100)
          .human-2
            top  - random(3,7)*PX
            right 60%
            transition-delay 7*ferrisWheelTransitionCoef + (random(0,25)/100)

    .cabin--handle
      height 40*PX
      transition all ferrisWheelTransitionCoef linear
      transition-delay 6*ferrisWheelTransitionCoef

    .cabin--core2
      transform scale(1)
      transition all ferrisWheelTransitionCoef linear
      transition-delay 6.5*ferrisWheelTransitionCoef

  .ferris-wheel--core
    rect 100%
    position absolute
    transform-origin 50% 50%

  .cabin--core
    transform-origin 50% 50%

  .ferris-base
    position absolute
    z-index 2
    left    20*PX
    bottom  - 15*PX
    transform translateY(300px)
    transition all ferrisWheelTransitionCoef line

  size = 115*PX
  .ferris-base--center
    background-color #ff6d6a
    circle size
    transform scale(0)
    z-index 0
    top - 222*PX
    position absolute
    left 50%
    margin-left - (size/2)
    
    iconSize = 67.5%
    .icon
      position absolute
      fill #fff
      rect iconSize
      left ((100% - iconSize)/1.65)
      top  ((100% - iconSize)/1.65)

  .ferris-wheel--spike
    width  3*PX
    height 0
    height spikeHeight
    background-color #9a3333
    position absolute
    z-index 0
    transform-origin 50% 50%
    opacity 0

    spikeAngle = 60
    spikesCircleSize = (ferrisWheelSize*.69)
    cnt = 24
    PI = 3.141598
    step = (2*PI)/cnt
    rotateStep = 360/cnt
    rotateAngle = 0
    centerX = (ferrisWheelSize/2) - 0
    centerY = (ferrisWheelSize/2)
    radius  = (spikesCircleSize/2) - 15
    angle = 0
    for i in 0..(cnt - 1)
      &.n-{i}
        x = centerX + cos(angle)*radius
        y = centerY + sin(angle)*radius
        transform translateX(x*PX) translateY(y*PX - (spikeHeight/2)) rotate((rotateAngle)deg)
      
      rotateAngle = rotateAngle + rotateStep
      angle = angle + step
    
    rotateAngle = 0
    angle       = .16
    for i in 0..(cnt - 1)
      &.s-{i}
        x = centerX + cos(angle)*radius
        y = centerY + sin(angle)*radius
        transform translateX(x*PX) translateY(y*PX - (spikeHeight/2)) rotate((rotateAngle)deg)
      
      rotateAngle = rotateAngle + rotateStep
      angle = angle + step


  circle1Size = 85%
  .ferris-wheel--circle1
    position absolute
    circle circle1Size
    border 17*PX solid #c94a4a
    left ((100% - circle1Size)/2)
    top  ((100% - circle1Size)/2)
    z-index 1
    transform scale(0)
    transition all ferrisWheelTransitionCoef linear
    transition-delay ferrisWheelTransitionCoef

  circle2Size = 65%
  .ferris-wheel--circle2
    position absolute
    circle circle2Size
    // border 10*PX solid #c94a4a
    border 10*PX solid white
    left ((100% - circle2Size)/2)
    top  ((100% - circle2Size)/2)
    z-index 1
    transform scale(0)
    transition all ferrisWheelTransitionCoef linear
    transition-delay 2*ferrisWheelTransitionCoef

  .cabin
    position absolute
    nw 0
    opacity 1
    // z-index 10

    .icon
      fill #3f797f
  
  cnt = 12
  PI = 3.141598
  step = (2*PI)/cnt
  rotateStep = 360/cnt
  rotateAngle = 0
  centerX = ferrisWheelSize/2
  centerY = ferrisWheelSize/2
  radius  = ferrisWheelSize/2
  angle = 0
  for i in 0..(cnt - 1)
    .n-{i}
      x = centerX + cos(angle)*radius
      y = centerY + sin(angle)*radius
      transform translateX(x*PX - (cabinSize/2)) translateY(y*PX - (cabinSize/2))
      .cabin--handle
        transform rotate((90 + rotateAngle)deg)
        z-index -1
      .human
        position absolute
        top 12*PX

      .human-0
        right 20%
      .human-1
        right 40%
      .human-2
        right 60%
    .n-google-plus, .n-youtube, .n-quora
      .icon
        fill #f46f53
    .n-blogging
      .icon
        fill #8fa2a8
    rotateAngle = rotateAngle + rotateStep
    angle = angle + step

.cabin
  // border-radius 50%
  rect cabinSize
  position relative
  .cabin--core, .cabin--core2
    rect 100%
    position absolute
    nw 0
   .cabin--core2
    transform scale(0)
    transition all ferrisWheelTransitionCoef linear
    transition-delay 0

  .human
    z-index 0
    position absolute

  iconSize = 60%
  .icon
    position absolute
    z-index 2
    rect iconSize
    left ((100% - iconSize)/2)
    top  ((100% - iconSize)/2)

  cabinHandleWidth = 18*PX
  .cabin--handle
    background-color #9a3333
    width  cabinHandleWidth
    position absolute
    left 50%
    top  50%
    margin-left - (cabinHandleWidth/2)
    z-index 0
    transform-origin 50% top
    height 0

  .cabin--base
    circle cabinSize
    position absolute
    background-color white
    z-index 1


@-moz-document url-prefix()
  .cabin
    .human
      animation cabinFix .2s linear infinite


@keyframes ferris-cabin-rotate
	0%
		transform rotate(0)

	100%
		transform rotate(360deg)

@keyframes ferris-wheel-rotate
	0%
		transform rotate(360deg)

	100%
		transform rotate(0)
  
@keyframes cabinFix
	0%
		transform translateZ(0)
	100%
		transform translateZ(1px)
            
          
!
            
              $carousel = $('#js-ferris-wheel')
$('#js-button').on('click', function(){
  $carousel.toggleClass('is-open');
});


            
          
!
999px
🕑 One or more of the npm packages you are using needs to be built. You're the first person to ever need it! We're building it right now and your preview will start updating again when it's ready.

Console