cssAudio - Activefile-genericCSS - ActiveGeneric - ActiveHTML - ActiveImage - ActiveJS - ActiveSVG - ActiveText - Activefile-genericVideo - ActiveLovehtmlicon-new-collectionicon-personicon-teamlog-outoctocatpop-outspinnerstartv

Pen Settings

CSS Base

Vendor Prefixing

Add External CSS

These stylesheets will be added in this order and before the code you write in the CSS editor. You can also add another Pen here, and it will pull the CSS from it. Try typing "font" or "ribbon" below.

Quick-add: + add another resource

Add External JavaScript

These scripts will run in this order and before the code in the JavaScript editor. You can also link to another Pen here, and it will run the JavaScript from it. Also try typing the name of any popular library.

Quick-add: + add another resource

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.

            
              body{
  margin:0;
  padding: 0;
  position: absolute;
  width: 100%;
  height: 100%;
  overflow: hidden;
}

            
          
!
            
              
// VARIABLER //

var square;
var circle;
var pattern;
var pattern1
var circle2;

var e;
var f;
var g;
var h;

SPF.set({

  at: 'back', // You can use 'back', 'mid' and 'fore'
  
  load: function(PIXI, input) {
    return [input.patterns.botanicorganic2];
  },
  
  
  // INIT //////////////////////////////////////////////////

  init: function(PIXI, input) {
    

// BAGGRUND //
    square = new PIXI.Graphics();
    square.beginFill(input.colors[17]);
    square.drawRect(0, 0, input.width, input.height);
    square.endFill();
    input.container.addChild(square)
   
    
// roterende billede //
    e = new PIXI.Sprite(input.graphics.wingwave);
              input.container.addChild(e);
              e.anchor.x = 0.5;
              e.anchor.y = 0.6;
              e.scale.x = 1.0;
              e.scale.y = 1.0;
      
    
 

    
// MOENSTER TIL MASKE //
    pattern = new PIXI.extras.TilingSprite(input.patterns.botanicorganic1, 1, 1);
    pattern.anchor.set(0);
    input.container.addChild(pattern);
    
    
    
// PINK CIRKEL (med maske) //
    circle = new PIXI.Graphics();
    circle.beginFill(input.colors[17]); // PINK CIRKEL //
    circle.drawCircle(0, 0, 185);
    circle.endFill();
    circle.x = 300;
    circle.y = 400;
    input.container.addChild(circle);
    pattern.mask = circle;
    
   
  
  
  
  
  
   },
  
  
  
// RENDER //////////////////////////////////////////////////
  
  
  render: function(PIXI, input) {
    
    
    
// FLAKKENDE BAGGRUND START //
    
    
      if (input.currentTime == null || input.currentTime <= 8) {
      
      var v = input.audio.frequencies()[100];
      square.alpha = v / 200;
     
      
      
    } else if (input.currentTime == null || input.currentTime <= 9) {
      
      circle.alpha = 1;
      square.clear();
      square.beginFill(input.colors[10]); // LILLA BAGGRUND //
      square.drawRect(0, 0, input.width, input.height);
      square.endFill();
     
      
      
    } else if (input.currentTime == null || input.currentTime <= 10) {
      
      //pattern.mask = null;
      pattern.alpha = 1;
      square.clear();
      square.beginFill(input.colors[10]); // GROEN BAGGRUND //
      square.drawRect(0, 0, input.width, input.height)
      
    }
    
      circle.x = input.mouseTouchPosition.x;
      circle.y = input.mouseTouchPosition.y;
    
    e.x = input.width/2;
            e.y = input.height/2;
            e.rotation += 0.001;
    
    f.x = input.width/1;
            f.y = input.height/1;
            f.rotation += 0.003;
    
    g.x = input.width/1;
            g.y = input.height/1;
            g.rotation += 0.002;
    

    
  },
  
      resize: function(PIXI, input) {
      pattern.width = input.width;
      pattern.height = input.height;
  },


  
  
  
});

SPF.set({
at: 'mid',

  init: function(PIXI, input) {

    var sprite = new PIXI.Graphics();
    sprite.beginFill(0xddc000);
    sprite.drawRect(0, 0, input.width, input.height);
    sprite.endFill();
    input.container.addChild(sprite);


    SPF.midgroundMask(true);

  },

  mouseDownTouchStart: function(PIXI, input) {
    SPF.midgroundMask(false);
  },

  mouseUpTouchEnd: function(PIXI, input) {
    SPF.midgroundMask(true);
  },
  
  
              

});



SPF.info({
    
    tip: "Scarlet Pleasure",
    title: "The Wave",
    firstName: "Cecilie",
    lastName: "Caroee",
    email: "cecilie.caroee@gmail.com",
    section: "s4"
});

SPF.start();





            
          
!
999px
Close

Asset uploading is a PRO feature.

As a PRO member, you can drag-and-drop upload files here to use as resources. Images, Libraries, JSON data... anything you want. You can even edit them anytime, like any other code on CodePen.

Go PRO

Loading ..................

Console