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 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.

Quick-add: + add another resource

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.

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
Loading ..................

Console