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.

            
              .birthday
    .birthday_inner
        .birthday_inner__modal
            .modal_image
                %img{:src => '/'}
            .modal_content
                %h1 Title
                %p Content
                %button OK, Let's go
        .birthday_inner__stage.stage1
            .intro_cake
                %img.intro{:src => 'https://s3-us-west-2.amazonaws.com/s.cdpn.io/217233/cake.png'}
            %button.start Let’s make a cake
        .birthday_inner__stage.stage2
            %h1 Let’s get mixing
            %h2 OK, so let's start by mixing all of our ingredients together in a big mixing bowl. Click the mix button below until the mixture is nice and smooth.
            .mix
                .mix_bowl
                    %img{:src => 'https://s3-us-west-2.amazonaws.com/s.cdpn.io/217233/bowl.png'}
                .mix_spoon
                    %img{:src => 'https://s3-us-west-2.amazonaws.com/s.cdpn.io/217233/spoon.png'}
            %button.mixer Click here to mix
        .birthday_inner__stage.stage3
            %h1 Let’s bake our base
            %h2 Alright, let’s get this mixture in the oven. Go ahead and drag the cake mix into the digital oven. Then put your feet up while it bakes.
            .oven
                %img{:src => 'https://s3-us-west-2.amazonaws.com/s.cdpn.io/217233/oven.png'}
            .tin
                %img{:src => 'https://s3-us-west-2.amazonaws.com/s.cdpn.io/217233/tin.png'}
        .birthday_inner__stage.stage4
            %h1 Let’s make the cake
            %h2 Build your cake in any order you want. Click an ingredient to add it to your cake. You can add more than one item e.g 2 vanilla sponges but only 5 bases and 6 fillings.  Hit the button at the bottom to finish your cake and add your candles. Make sure you leave some icing for the top of your cake!
            .svg
                %svg#Layer_1{"enable-background" => "new 0 0 213 46", :height => "46px", :space => "preserve", :version => "1.1", :viewbox => "0 0 213 46", :width => "213px", :x => "0px", :xmlns => "http://www.w3.org/2000/svg", "xmlns:xlink" => "http://www.w3.org/1999/xlink", :y => "0px"}
                    %g
                        %path{:d => "M19.943,18.94h4.68V8.711c0-2.13,0.72-3.21,1.56-3.21c0.87,0,1.59,1.17,1.59,1.59\r\n\t\tc0,0.45-0.81-0.27-0.81,2.25V28.15c0,0.51-0.39,0.69-0.84,0.69c-0.69,0-1.5-0.42-1.5-0.87v-6.93h-4.68v7.11\r\n\t\tc0,0.51-0.39,0.69-0.84,0.69c-0.69,0-1.5-0.42-1.5-0.87v-6.93h-2.13c-0.63,0-1.08-0.87-1.08-1.5c0-0.33,0.15-0.6,0.45-0.6h2.76\r\n\t\tV9.251c-3.69,0-6.36,2.55-6.36,6.569c0,2.52,1.2,4.14,1.59,4.14c0.18,0,0.21-0.15,0.36-0.15s0.18,0.27,0.18,0.48\r\n\t\tc0,1.26-1.11,2.34-1.979,1.709c-1.05-0.75-2.52-2.79-2.52-6.089c0-6.36,5.31-8.91,9.87-8.91c0.63,0,1.2,0.54,1.2,1.26V18.94z", :fill => "#010101"}
                        %path{:d => "M40.223,23.62c0.12-0.63,0.42-0.9,0.72-0.9c0.48,0,1.05,0.66,1.05,1.23c0,0.03,0,0.09-0.03,0.21\r\n\t\tc-0.51,1.98-1.71,4.68-4.29,4.68c-1.05,0-1.86-0.51-2.31-1.23c-0.6,0.69-1.44,1.23-2.58,1.23c-2.34,0-3.57-1.98-3.57-4.53\r\n\t\tc0-5.01,3.48-8.07,7.14-8.07c0.81,0,1.38,0.48,1.38,1.26c0,0.51-0.09,0.69-0.39,0.69c-0.27,0-0.57-0.06-0.87-0.06\r\n\t\tc-2.28,0-4.95,1.95-4.95,6.27c0,1.56,0.66,2.459,1.71,2.459c0.81,0,1.35-0.72,1.68-1.56v-4.62c0-0.57-0.12-0.75-0.12-0.96\r\n\t\tc0-0.3,0.36-0.51,0.78-0.51c0.99,0,1.62,0.6,1.62,1.32v4.95c0,0.66,0.3,1.38,1.02,1.38C39.413,26.86,39.953,24.94,40.223,23.62z", :fill => "#010101"}
                        %path{:d => "M42.623,28.69v9.75c0,1.11-0.99,1.32-1.59,1.32c-0.6,0-0.69-0.36-0.69-0.81V18.01c0-0.87-0.3-0.93-0.3-1.14\r\n\t\ts0.54-0.33,0.96-0.33c0.96,0,1.59,0.6,1.62,1.29c0.63-0.9,1.47-1.59,2.729-1.59c2.34,0,3.48,2.31,3.48,5.28\r\n\t\tc0,1.68-0.33,3.3-0.78,4.379c1.98-0.09,2.43-0.87,3.12-2.28c0.27-0.57,0.42-0.81,0.69-0.81c0.51,0,1.08,0.72,1.08,1.14\r\n\t\tc0,1.38-1.86,3.81-5.85,3.81c-0.81,0.87-1.98,1.38-3.03,1.38C43.343,29.14,42.863,28.96,42.623,28.69z M42.623,20.771v6.479\r\n\t\tc0.42-0.63,1.44-0.93,2.82-1.05c0.72-1.05,1.05-3.09,1.05-4.2c0-2.76-0.87-3.75-1.89-3.75C43.733,18.25,42.953,19.3,42.623,20.771z\r\n\t\t", :fill => "#010101"}
                        %path{:d => "M53.453,28.69v9.75c0,1.11-0.99,1.32-1.59,1.32c-0.6,0-0.69-0.36-0.69-0.81V18.01c0-0.87-0.3-0.93-0.3-1.14\r\n\t\ts0.54-0.33,0.96-0.33c0.96,0,1.59,0.6,1.62,1.29c0.63-0.9,1.47-1.59,2.729-1.59c2.34,0,3.48,2.31,3.48,5.28\r\n\t\tc0,1.68-0.33,3.3-0.78,4.379c1.98-0.09,2.43-0.87,3.12-2.28c0.27-0.57,0.42-0.81,0.69-0.81c0.51,0,1.08,0.72,1.08,1.14\r\n\t\tc0,1.38-1.86,3.81-5.85,3.81c-0.81,0.87-1.98,1.38-3.03,1.38C54.172,29.14,53.692,28.96,53.453,28.69z M53.453,20.771v6.479\r\n\t\tc0.42-0.63,1.44-0.93,2.82-1.05c0.72-1.05,1.05-3.09,1.05-4.2c0-2.76-0.87-3.75-1.89-3.75C54.563,18.25,53.782,19.3,53.453,20.771z\r\n\t\t", :fill => "#010101"}
                        %path{:d => "M73.372,22.72c0.48,0,1.05,0.66,1.05,1.23c0,0.03,0,0.18-0.03,0.3c-1.02,3.48-2.76,5.25-4.38,6.66v5.19\r\n\t\tc0,3.15-1.59,4.26-3.12,4.26c-1.68,0-2.88-1.53-2.88-3.45c0-3.03,1.74-4.56,3.72-6.3V26.8c-0.72,1.2-1.65,2.07-2.94,2.07\r\n\t\tc-2.01,0-3.18-1.71-3.18-4.32c0-3.18,1.08-6.75,1.08-6.75c0.21-0.51,0-1.11,1.59-1.11c1.47,0,0.6,1.2,0.48,1.65\r\n\t\tc-0.54,2.22-0.87,3.54-0.87,6.06c0,1.62,0.51,2.49,1.38,2.49c1.2,0,2.1-1.95,2.46-4.05v-4.83c0-0.57-0.12-0.75-0.12-0.96\r\n\t\tc0-0.3,0.36-0.51,0.78-0.51c0.99,0,1.62,0.6,1.62,1.32v10.53c1.08-1.2,2.04-2.7,2.64-4.77C72.832,22.99,73.072,22.72,73.372,22.72z\r\n\t\t M67.732,36.1v-3.21c-0.96,0.99-1.62,2.13-1.62,3.93c0,0.93,0.3,1.65,0.78,1.65C67.853,38.47,67.732,36.669,67.732,36.1z", :fill => "#010101"}
                        %path{:d => "M87.981,26.05c0.48,0,0.48-0.42,0.75-0.42s0.33,0.48,0.33,0.87c0,0.93-0.36,1.8-1.17,1.8h-6.75\r\n\t\tc-0.57,0-1.11-0.45-1.11-1.11c0-0.33,0.12-0.66,0.36-0.87c0.06-0.06,6.57-6.6,6.57-13.17c0-3.209-1.74-3.93-2.64-3.93\r\n\t\tc-1.38,0-2.85,1.05-2.85,3.93c0,1.98,0.84,3.51,1.29,3.51c0.15,0,0.21-0.15,0.3-0.15c0.06,0,0.12,0.09,0.09,0.27\r\n\t\tc-0.06,0.51-0.69,1.32-1.47,1.32c-1.5,0-2.52-2.76-2.52-4.95c0-4.229,2.67-6.149,5.22-6.149c3.42,0,4.92,3.21,4.92,6.24\r\n\t\tc0,5.16-3.51,10.2-5.67,12.81H87.981z", :fill => "#010101"}
                        %path{:d => "M92.512,7.781c0.03-0.24,0.21-0.3,0.33-0.3c0.78,0,2.25,0,3.03,0c1.68,0,2.58-0.03,2.58-0.03\r\n\t\tc0.48,0,0.51-0.3,0.75-0.3c0.24,0,0.3,0.48,0.3,0.75c0,0.93-0.33,1.8-1.14,1.8h-3.93l-0.33,3.78c0.39-0.3,1.02-0.57,1.8-0.57\r\n\t\tc1.68,0,4.32,1.32,4.32,7.41c0,6.21-2.43,8.52-4.8,8.52c-3.42,0-4.35-4.02-4.35-5.55c0-0.87,0.21-1.38,0.96-1.38\r\n\t\ts1.47,0.48,1.47,0.75c0,0.18-0.12,0.18-0.12,0.54c0,0.66,0.18,3.42,2.07,3.42c1.56,0,2.43-2.16,2.43-6.3\r\n\t\tc0-3.27-0.81-5.25-2.46-5.25c-1.23,0-1.59,1.05-2.34,1.05c-0.36,0-1.56-0.45-1.44-1.17L92.512,7.781z", :fill => "#010101"}
                        %path{:d => "M102.292,13.991v-5.07c0-0.87-0.3-0.93-0.3-1.14s0.54-0.33,0.96-0.33c0.99,0,1.62,0.6,1.62,1.32v5.25\r\n\t\tc1.83,0,3.93-0.03,5.97-0.12c0.84-0.9,0.57,1.98-0.21,2.01c-2.4,0.06-4.17,0.06-5.76,0.06v9.509c0,0.96,0.39,1.38,1.02,1.38\r\n\t\tc1.2,0,1.74-1.92,2.01-3.24c0.12-0.63,0.42-0.9,0.72-0.9c0.48,0,1.05,0.66,1.05,1.23c0,0.03,0,0.09-0.03,0.21\r\n\t\tc-0.51,1.98-1.71,4.68-4.29,4.68c-1.62,0-2.76-0.96-2.76-3.33v-9.54c-1.32,0-2.07-0.06-2.07-0.06c-0.96,0-1.5-2.01-0.63-2.01\r\n\t\tC99.592,13.9,100.672,13.96,102.292,13.991z", :fill => "#010101"}
                        %path{:d => "M107.722,9.521c0-0.87-0.3-0.93-0.3-1.14s0.54-0.33,0.96-0.33c0.99,0,1.62,0.6,1.62,1.32v9.84\r\n\t\tc0.81-1.68,1.89-2.97,3.36-2.97c2.01,0,2.49,1.65,2.49,3.03v6.209c0,0.27,0,1.38,0.78,1.38c1.2,0,1.74-1.92,2.01-3.24\r\n\t\tc0.36-1.83,1.979-0.42,1.74,0.54c-0.54,1.98-1.71,4.68-4.29,4.68c-1.59,0-2.52-1.29-2.52-2.82v-6.09c0-0.93-0.06-1.71-0.63-1.71\r\n\t\tc-0.87,0-2.729,2.58-2.939,4.95v4.379c0,0.57,0.03,1.29-0.84,1.29c-0.6,0-1.44-0.21-1.44-1.32V9.521z", :fill => "#010101"}
                        %path{:d => "M130.311,12.281c0-0.57-0.12-0.75-0.12-0.96c0-0.3,0.36-0.51,0.78-0.51c0.99,0,1.68,0.6,1.68,1.32V23.26\r\n\t\tc0,2.88,0.96,4.02,2.729,4.02c1.68,0,2.94-1.32,2.94-3.06c0-2.7-2.07-3.51-3.959-3.51c-0.54,0-1.05-2.25-0.15-2.25\r\n\t\tc1.41,0,4.86-0.93,4.86-5.28c0-2.28-1.47-4.62-5.16-4.62c-4.83,0-6.78,3.18-6.78,6.84c0,2.64,1.08,3.57,1.14,3.66\r\n\t\tc0.33-0.09,0.45,0.12,0.45,0.42c0,0.54-0.81,2.52-1.68,1.86c-0.48-0.45-2.19-2.25-2.19-5.76c0-5.61,3.69-9.27,9.03-9.27\r\n\t\tc4.53,0,7.5,2.55,7.5,6.81c0,3.27-1.68,5.28-3.87,6.45c1.74,0.51,3.149,2.01,3.149,4.59c0,3-2.28,5.19-5.25,5.19\r\n\t\tc-3.93,0-5.1-2.49-5.1-6.18V12.281z", :fill => "#010101"}
                        %path{:d => "M142.581,11.741c0-1.05,0.81-1.83,1.8-1.83c1.05,0,1.83,0.78,1.83,1.83c0,0.99-0.78,1.83-1.83,1.83\r\n\t\tC143.391,13.571,142.581,12.73,142.581,11.741z M145.071,25.48c0,0.27,0,1.38,0.78,1.38c1.2,0,1.74-1.92,2.01-3.24\r\n\t\tc0.36-1.83,1.98-0.42,1.74,0.54c-0.54,1.98-1.71,4.68-4.29,4.68c-1.59,0-2.52-1.29-2.52-2.82v-8.01c0-0.57-0.12-0.75-0.12-0.96\r\n\t\tc0-0.3,0.36-0.51,0.78-0.51c0.99,0,1.62,0.6,1.62,1.32V25.48z", :fill => "#010101"}
                        %path{:d => "M151.431,25.42c0-1.92,0.54-4.05,1.5-6.629h-2.28h-0.33c-0.03,1.17-0.21,3.78-0.75,5.52\r\n\t\tc-0.39,1.26-1.95,0.18-1.68-0.84c0.33-1.2,0.45-3.69,0.48-5.22c-0.75-0.42-1.29-1.05-1.29-1.92c0-0.84,0.72-1.38,1.5-1.38\r\n\t\tc0.72,0,1.56,0.36,1.89,1.59c0.99,0.12,1.29,0.12,1.59,0.12h1.56c0.36,0,1.56,0.99,1.44,1.68c0,0.36-1.35,3.9-1.35,6.9\r\n\t\tc0,0.84,0.39,1.62,1.2,1.62c1.38,0,1.89-1.92,2.16-3.24c0.12-0.63,0.42-0.9,0.72-0.9c0.48,0,1.05,0.66,1.05,1.23\r\n\t\tc0,0.09-0.03,0.15-0.03,0.21c-0.54,1.98-1.71,4.68-4.29,4.68C153.11,28.84,151.431,28.06,151.431,25.42z", :fill => "#010101"}
                        %path{:d => "M157.19,13.991v-5.07c0-0.87-0.3-0.93-0.3-1.14s0.54-0.33,0.96-0.33c0.99,0,1.62,0.6,1.62,1.32v5.25\r\n\t\tc1.83,0,3.93-0.03,5.97-0.12c0.84-0.9,0.57,1.98-0.21,2.01c-2.4,0.06-4.17,0.06-5.76,0.06v9.509c0,0.96,0.39,1.38,1.02,1.38\r\n\t\tc1.2,0,1.74-1.92,2.01-3.24c0.12-0.63,0.42-0.9,0.72-0.9c0.48,0,1.05,0.66,1.05,1.23c0,0.03,0,0.09-0.03,0.21\r\n\t\tc-0.51,1.98-1.71,4.68-4.29,4.68c-1.62,0-2.76-0.96-2.76-3.33v-9.54c-1.32,0-2.07-0.06-2.07-0.06c-0.96,0-1.5-2.01-0.63-2.01\r\n\t\tC154.49,13.9,155.57,13.96,157.19,13.991z", :fill => "#010101"}
                        %path{:d => "M162.62,9.521c0-0.87-0.3-0.93-0.3-1.14s0.54-0.33,0.96-0.33c0.99,0,1.62,0.6,1.62,1.32v9.84\r\n\t\tc0.81-1.68,1.89-2.97,3.36-2.97c2.01,0,2.49,1.65,2.49,3.03v6.209c0,0.27,0,1.38,0.78,1.38c1.2,0,1.74-1.92,2.01-3.24\r\n\t\tc0.36-1.83,1.979-0.42,1.74,0.54c-0.54,1.98-1.71,4.68-4.29,4.68c-1.59,0-2.52-1.29-2.52-2.82v-6.09c0-0.93-0.06-1.71-0.63-1.71\r\n\t\tc-0.87,0-2.729,2.58-2.939,4.95v4.379c0,0.57,0.03,1.29-0.84,1.29c-0.6,0-1.44-0.21-1.44-1.32V9.521z", :fill => "#010101"}
                        %path{:d => "M173.15,24.01c0-4.59,2.79-7.26,6.06-7.71v-6.78c0-0.87-0.3-0.93-0.3-1.14s0.54-0.33,0.96-0.33\r\n\t\tc0.99,0,1.62,0.6,1.62,1.32V25.48c0,0.66,0.3,1.38,1.02,1.38c1.2,0,1.74-1.92,2.01-3.24c0.12-0.63,0.42-0.9,0.72-0.9\r\n\t\tc0.48,0,1.05,0.66,1.05,1.23c0,0.03,0,0.09-0.03,0.21c-0.51,1.98-1.71,4.68-4.29,4.68c-1.02,0-1.83-0.48-2.28-1.17\r\n\t\tc-0.66,0.66-1.53,1.17-2.67,1.17C174.68,28.84,173.15,27.16,173.15,24.01z M179.21,25.69v-7.41c-1.95,0.36-3.75,1.77-3.75,5.52\r\n\t\tc0,2.16,0.96,3.06,2.01,3.06C178.25,26.86,178.82,26.35,179.21,25.69z", :fill => "#010101"}
                        %path{:d => "M195.14,23.62c0.12-0.63,0.42-0.9,0.72-0.9c0.48,0,1.05,0.66,1.05,1.23c0,0.03,0,0.09-0.03,0.21\r\n\t\tc-0.51,1.98-1.71,4.68-4.29,4.68c-1.05,0-1.86-0.51-2.31-1.23c-0.6,0.69-1.44,1.23-2.58,1.23c-2.34,0-3.57-1.98-3.57-4.53\r\n\t\tc0-5.01,3.48-8.07,7.14-8.07c0.81,0,1.38,0.48,1.38,1.26c0,0.51-0.09,0.69-0.39,0.69c-0.27,0-0.57-0.06-0.87-0.06\r\n\t\tc-2.28,0-4.95,1.95-4.95,6.27c0,1.56,0.66,2.459,1.71,2.459c0.81,0,1.35-0.72,1.68-1.56v-4.62c0-0.57-0.12-0.75-0.12-0.96\r\n\t\tc0-0.3,0.36-0.51,0.78-0.51c0.99,0,1.62,0.6,1.62,1.32v4.95c0,0.66,0.3,1.38,1.02,1.38C194.33,26.86,194.87,24.94,195.14,23.62z", :fill => "#010101"}
                        %path{:d => "M206.629,22.72c0.48,0,1.05,0.66,1.05,1.23c0,0.03,0,0.18-0.03,0.3c-1.02,3.48-2.76,5.25-4.38,6.66v5.19\r\n\t\tc0,3.15-1.59,4.26-3.12,4.26c-1.68,0-2.88-1.53-2.88-3.45c0-3.03,1.74-4.56,3.72-6.3V26.8c-0.72,1.2-1.65,2.07-2.94,2.07\r\n\t\tc-2.01,0-3.18-1.71-3.18-4.32c0-3.18,1.08-6.75,1.08-6.75c0.21-0.51,0-1.11,1.59-1.11c1.47,0,0.6,1.2,0.48,1.65\r\n\t\tc-0.54,2.22-0.87,3.54-0.87,6.06c0,1.62,0.51,2.49,1.38,2.49c1.2,0,2.1-1.95,2.46-4.05v-4.83c0-0.57-0.12-0.75-0.12-0.96\r\n\t\tc0-0.3,0.36-0.51,0.78-0.51c0.99,0,1.62,0.6,1.62,1.32v10.53c1.08-1.2,2.04-2.7,2.64-4.77\r\n\t\tC206.089,22.99,206.33,22.72,206.629,22.72z M200.99,36.1v-3.21c-0.96,0.99-1.62,2.13-1.62,3.93c0,0.93,0.3,1.65,0.78,1.65\r\n\t\tC201.11,38.47,200.99,36.669,200.99,36.1z", :fill => "#010101"}
            .options
                .sponges.inactive
                    %h3 Sponges
                    %h5 
                        %span 0
                        #{'/'} 5
                    .item
                        .item_inner.vanilla
                        %h4 Vanilla
                    .item
                        .item_inner.strawberry
                        %h4 Pink
                    .item
                        .item_inner.fruit
                        %h4 Fruit
                .fillings
                    %h3 Fillings/icing
                    %h5 
                        %span 0
                        #{'/'} 6
                    .item
                        .item_inner.jam
                        %h4 Jam
                    .item
                        .item_inner.cream
                        %h4 Cream
                    .item
                        .item_inner.choc
                        %h4 Choc
                    .item
                        .item_inner.lemon
                        %h4 Lemon
            .cakemake
                .base
            .startagain Start again
            %button.add Add the candle
            %button.sa Start again
                    
               
            
          
!
            
              *{
    box-sizing:border-box;
    font-weight:normal;
}
@import url(https://fonts.googleapis.com/css?family=Damion);
$pink: #e77572;

body{
    font-family: 'Damion', cursive;
    background: rgb(251,239,236);
    background: -moz-radial-gradient(center, ellipse cover,  rgba(251,239,236,1) 0%, rgba(218,180,180,1) 100%);
    background: -webkit-radial-gradient(center, ellipse cover,  rgba(251,239,236,1) 0%,rgba(218,180,180,1) 100%);
    background: radial-gradient(ellipse at center,  rgba(251,239,236,1) 0%,rgba(218,180,180,1) 100%);
    height:100vh;
    overflow:hidden;
    .birthday{
        .add{
            margin-top:40px;
            clear:both;
            font-family: 'Damion', cursive;
            background:transparent;
            border:2px solid $pink;
            color:$pink;
            font-size:22px;
            padding:14px 28px;
            border-radius:40px;
            transition:all .23s;
            outline:none;
            cursor:pointer;

            &:hover{
                background:$pink;
                color:white;
            }

        }
        &_inner{
            &__modal{
                width:500px;
                position:absolute;
                left:0;
                right:0;
                transition:all .4s;
                margin:auto;
                text-align:center;
                top:50%;
                transform:translateY(-50%) scale(0);
                background:white;
                border-radius:20px;
                z-index:2;
                padding:40px 40px 100px 40px;
                box-shadow: 0px 3px 10px 0px #E5B4B2;
                .modal_image{
                    position: absolute;
                    top: 0;
                    left: 0;
                    right: 0;
                    transform: translateY(-60%);
                    img{
                        width:100px;
                    }
                }
                h1{
                    color:$pink;
                    margin:0;
                }
                p{
                    font-family:'georgia';
                    font-size:13px;
                    color:#b9918e;
                }
                button{
                    background: #e77572;
                    color: white;
                    outline:none;
                    padding: 20px 20px 20px 20px;
                    border: none;
                    width: 100%;
                    font-size: 20px;
                    font-family: 'Damion', cursive;
                    position: absolute;
                    left: 0;
                    right: 0;
                    bottom: 0px;
                    -webkit-transition: all .2s;
                    transition: all .2s;
                    cursor: pointer;
                    border-bottom-right-radius: 20px;
                    border-bottom-left-radius: 20px;
                    &:hover{
                        background:darken($pink,5);
                    }
                }
            }
            .stage1{
                display:block;
            }
            &__stage{
                width:500px;
                position:absolute;
                left:0;
                right:0;
                margin:auto;
                text-align:center;
                top:50%;
                display:none;
                transform:translateY(-50%);
                h1{
                    color:$pink;
                    margin:0;
                }
                h2{
                    font-family: 'georgia';
                    font-size: 12px;
                    color: #b9918e;
                    line-height: 18px;
                    margin: 0;
                }
                .mix{
                    margin: 80px 0px 10px 0px;
                    position:relative;
                    &_spoon{
                        position: absolute;
                        top: -37px;
                        left: 200px;
                        -webkit-transform: rotate(0deg) translateX(15px) translateY(3px) rotate(0deg) scale(1);
                    }
                    .move{
                        animation: mix 1s 0s linear;
                    }
                }
                img.intro{
                    width:300px;
                    transform:scale(0);
                    animation:bounce .6s 1s forwards,moveup .6s 2s forwards;
                    position:relative;
                    top:0px;
                }
                .oven{
                    margin-top:50px;
                    margin-bottom:-40px;
                    img{
                        width:290px;
                        position: relative;
                        left: -10px;
                    }
                }
                .tin{
                    img{
                        width:90px;
                    }
                }
                .candle{
                    position:Relative;
                    opacity:0;
                    animation: candle 1s 1.3s forwards;
                    top:10px;
                    img{
                        width:10px;
                    }

                }
                .startagain{
                    position: absolute;
                    right: 0;
                    top: 350px;
                    font-size: 24px;
                    color:$pink;
                }
                .cakemake{
                    margin-top:230px;
                    clear:both;
                    text-align:center;
                    %piece{
                        height:40px;
                        margin:0 auto;
                        border-top-left-radius:6px;
                        border-top-right-radius:6px;
                        margin-bottom:-10px;
                        position:relative;
                        background-image: -webkit-repeating-linear-gradient(-45deg, transparent, transparent 5px, rgba(255,255,255,.2) 5px, rgba(255,255,255,.2) 10px);
                        div{
                            width:10px;
                            height:10px;
                            position:absolute;
                            background:Red;
                            border-radius:100px;
                            top:-5px;
                            z-index:4;

                            @for $i from 1 through 10{
                                &:nth-of-type(#{$i}){
                                    left: ($i - 1) * 20%;
                                    margin-left:6px;
                                }
                            }
                        }
                    }
                    %filling{
                        height:10px;
                        margin:0 auto;
                        border-top-left-radius:6px;
                        border-top-right-radius:6px;
                        margin-bottom:-1px;
                        position:relative;
                        z-index:1;
                        top: 9px;
                        div{
                            display:block;
                            width:12.5%;
                            float:left;
                            height:16px;
                            background:black;
                            border-radius:100%;
                        }
                    }
                    .base{
                        width:200px;
                        background-color:#ffd296;
                        @extend %piece;
                    }
                    .sponge{
                        width:200px;
                        @extend %piece;
                    }
                    .filling{
                        width:200px;
                        @extend %filling;
                    }
                    .sponge-vanilla{
                        background-color:#ffd296;
                        div{
                            background: #CAA068;
                        }
                    }
                    .sponge-strawberry{
                        background-color:#ff99a3;
                        div{
                            background: #E27983;
                        }

                    }
                    .sponge-fruit{
                        background-color:#d5ccb2;
                        div{
                            background: #A9A088;
                        }
                    }
                    .filling-jam{
                        background:#e75656;
                        div{
                            background:#e75656;
                        }
                    }
                    .filling-cream{
                        background:#fff;
                        div{
                            background:#fff;
                        }
                    }
                    .filling-choc{
                        background:#9f3d28;
                        div{
                            background:#9f3d28;
                        }
                    }
                    .filling-lemon{
                        background:#e8e086;
                        div{
                            background:#e8e086;
                        }
                    }
                }
                .options{
                    position:relative;
                    left:12px;
                    .sponges{
                        margin-right:40px;
                    }
                    .inactive{
                        opacity:0.6;
                        pointer-events:none;
                    }
                    .sponges,.fillings{
                        float:left;
                        position:relative;
                        h3{
                            text-align:left;
                            color:#a25a58;
                            font-size:20px;
                        }
                        h5{
                            float:right;
                            margin:0;
                            color:$pink;
                            position:absolute;
                            top:20px;
                            right:14px;
                            font-size:20px;
                        }
                        .item{
                            float:left;
                            margin-right:14px;
                            &_inner{
                                cursor:pointer;
                                width:50px;
                                height:50px;
                                border: 3px solid rgba(0, 0, 0, 0.07);
                                border-radius:8px;
                                margin-bottom:5px;
                                transition: all .12s;
                                &:hover{
                                    border: 3px solid white;
                                }
                            }
                            .vanilla{
                                background:#ffd296;
                            }
                            .strawberry{
                                background:#ff99a3;
                            }
                            .fruit{
                                background:#d5ccb2;
                            }
                            .jam{
                                background:#e75656;
                            }
                            .cream{
                                background:#fff;
                            }
                            .choc{
                                background:#9f3d28;
                            }
                            .lemon{
                                background:#e8e086;
                            }
                            h4{
                                margin:0;
                                color:$pink;
                            }
                        }
                    }
                }
                button{
                    clear:both;
                    font-family: 'Damion', cursive;
                    background:transparent;
                    border:2px solid $pink;
                    color:$pink;
                    font-size:22px;
                    padding:14px 28px;
                    border-radius:40px;
                    transition:all .23s;
                    outline:none;
                    cursor:pointer;

                    &:hover{
                        background:$pink;
                        color:white;
                    }
                }
                .start{
                    margin-top:30px;
                    animation: in .8s 2.9s forwards;
                    position:relative;
                    top:-20px;
                    opacity:0;
                }
            }
        }
    }
}

.sa{
    margin-top:70px;
    display:none;
}
.svg{
    margin-bottom:40px;

}
svg{
    width: 390px;
    height: 90px;
    margin-bottom:-20px;
    display:none;
}
@keyframes bounce{
    0%{transform:scale(0);}
    25%{transform:scale(1.06);}
    50%{transform:scale(.965);}
    75%{transform:scale(1.02);}
    100%{transform:scale(1);}
}

@keyframes in{
    from{opacity:0}
    to{opacity:1}
}

@keyframes moveup{
    from{top:0}
    to{top:-30px}
}

@keyframes mix {
    0%  {transform: translateX(0px)  ;}
    50%  { transform: translateX(28px)  ;}
    100%  { transform: translateX(0px) ;}
}

@keyframes candle {
    from{opacity:0}
    to{opacity:1}
}
.text{
    path{
        animation: dash_loader 4s 2s forwards;
    }
}
@keyframes dash_loader {
    to {
        stroke-dasharray: 920;
    }
}
path,polyline,line {
    stroke-dasharray: 718;
    stroke-dashoffset: 750;
    stroke-width: 1px;
    stroke-miterlimit: 40;
    stroke-linejoin: round;
    fill: none;
    stroke: #e77572;
    z-index: 1;
    opacity: 1;
}

            
          
!
            
              $('.start').click(function(){
    $('.stage1').fadeOut();
    fire_modal('https://s3-us-west-2.amazonaws.com/s.cdpn.io/217233/cake_modal.png','Let’s make a cake!','Since it’s your birthday, I find it only fitting that you get to make your own digital birthday cake. Start by making your cake mixture, then bake it in a digital oven and finally decorate. Have fun and happy birthday');
})

progress = 1;

$('.modal_content button').click(function(){
    progress++;
    close_modal(progress)
})

function close_modal(callback){
    modal.css('transform','translateY(-50%) scale(0)')
    setTimeout(function(){
        $('.stage' + callback).fadeIn();
    },600)
}


function fire_modal(imgurl,title,content){

    modal = $('.birthday_inner__modal');
    modal.find('h1').html(title);
    modal.find('img').attr('src',imgurl);
    modal.find('p').html(content);
    setTimeout(function(){
        modal.css('transform','translateY(-50%) scale(1)')
    },1000)


}


mixing = false;
mixtimes = 0;

$('.mixer').click(function(){
    if(mixing == false){
        mixing = true
        mixtimes++;
        $('.mix_spoon img').addClass('move')
        setTimeout(function(){
            $('.mix_spoon img').removeClass('move')
            mixing = false;
        },1000)
    }
    if(mixtimes == 6){
        $('.stage2').fadeOut();
        fire_modal('https://s3-us-west-2.amazonaws.com/s.cdpn.io/217233/mix_modal.png','Mix successful!','Congratulations, the mixture is perfect! After pouring the mixture into a baking tin, it’s now time to put it in our digital oven for about 3 seconds. That should be enough time for a nice spongy base.');

    }

})

$('.tin').draggable({
    revert:true
})
$( ".oven" ).droppable({
    drop: function( event, ui ) {
        $('.stage3').fadeOut();
        fire_modal('https://s3-us-west-2.amazonaws.com/s.cdpn.io/217233/oven_modal.png','Bake successfull!','Yes! You are a master chef. The base is fully baked and looks super yummy. Now its time to combine this base with lots of other ingredients like jam, marmalade, chocolate and more.');
    }
})

bases = 0;
fillings = 0;

$('.sponges .item_inner').click(function(){
    $('.sponges').addClass('inactive')
    $('.fillings').removeClass('inactive')
    t = $(this).attr('class').split(' ').pop();
    bases++
    if(bases < 6){
        add_sponge(t)
    }
})

$('.fillings .item_inner').click(function(){
    $('.fillings').addClass('inactive')
    $('.sponges').removeClass('inactive')
    f = $(this).attr('class').split(' ').pop();
    fillings++
    if(fillings < 7){
        add_filling(f)
    }
})

function add_sponge(t){

    $('.cakemake').prepend('<div style="width:' + (200 - (bases * 20)) + 'px" class="sponge sponge-' + t + '"><div></div><div></div><div></div><div></div><div></div></div>')
    $('.sponges h5 span').html(bases)
}

$('.startagain').click(function(){
    $('.cakemake').html('<div class="base"></div>');
    bases = 0;
    fillings = 0;
    $('.sponges h5 span').html(bases)
    $('.fillings h5 span').html(fillings)
     $('.fillings').removeClass('inactive')
    $('.sponges').addClass('inactive')
})
function add_filling(f){

    $('.cakemake').prepend('<div style="width:' + (200 - (bases * 20)) + 'px" class="filling filling-' + f + '"><div></div><div></div><div></div><div></div><div></div><div></div><div></div><div></div>')
    $('.fillings h5 span').html(fillings)
}

function fin(){
    $('h1,h2,.options,.startagain,.add').fadeOut();
    
    setTimeout(function(){
        $('.cakemake').fadeIn()
        $('.cakemake').animate({'margin-top':'0px'})
    },1000)
    add_candle()
    $('svg').addClass('text')
}

function add_candle(){
    var stages = $('.cakemake > div').length;
    var h = (stages/2) * 41 + 22 + 'px';
    console.log(stages)
    $('.cakemake').prepend('<div class="candle" ><img src="https://s3-us-west-2.amazonaws.com/s.cdpn.io/217233/candle.png" /></div>')
    $('svg').show()
    setTimeout(function(){
        $('.sa').fadeIn()
    },2200)
    
}

$('.add').click(function(){
    fin();
})

$('.sa').click(function(){
    window.location.reload();
})
            
          
!
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