Pen Settings

HTML

CSS

CSS Base

Vendor Prefixing

Add External Stylesheets/Pens

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.

+ add another resource

JavaScript

Babel includes JSX processing.

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

Packages

Add Packages

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.

Behavior

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.

Format on Save

If enabled, your code will be formatted when you actively save your Pen. Note: your code becomes un-folded during formatting.

Editor Settings

Code Indentation

Want to change your Syntax Highlighting theme, Fonts and more?

Visit your global Editor Settings.

HTML

              
                
              
            
!

CSS

              
                @import url('https://fonts.googleapis.com/css2?family=Meddon');

body {
	background-color: #000;
	overflow: hidden;
  display: flex;
  height: 100%;
  display: flex;
  align-items: center; 
  justify-content: center;
}

              
            
!

JS

              
                console.clear();

// Create a new PIXI application
const app = new PIXI.Application({
    width: 626,
    height: 442,
    backgroundColor: 0x1099bb,
});

// Append the canvas to the document <body>
document.body.appendChild(app.view);

// Our background image for the parchment
const url = 'https://media.gettyimages.com/photos/brown-paper-texture-background-picture-id1083325354?b=1&k=6&m=1083325354&s=612x612&w=0&h=dIdtEMpmjSVoSegRkXf2I43tQdojOcxjFzSyJ2JnD60=';

// Create out background and add to stage
const bg = PIXI.Sprite.from(url);
bg.width = app.screen.width;
bg.height = app.screen.height;
app.stage.addChild(bg);

// The display text
const text = "What dreams may come when we have shuffled off this mortal coil, must give us pause..."

// Style it (font is imported from GoogleFonts in CSS)
const textStyle = {
  fontFamily: 'Meddon',
  fontSize: 32,
  fill: 0x43403d,
  align: 'left',
  wordWrap: true,
  wordWrapWidth: 500,
  lineHeight: 60,
  padding: 10, // some fonts get clipped 
  
}

const quote = new PIXI.Text(text, textStyle);
quote.resolution = window.devicePixelRatio;
quote.anchor.set(0.5);
quote.x = app.screen.width/2;
quote.y = app.screen.height/2;

// Create a texture into which to write our text
let textTexture = new PIXI.RenderTexture(
  new PIXI.BaseRenderTexture({
    width: app.screen.width,
    height: app.screen.height
  })
)

// Our filters
const blurFilter = new PIXI.filters.BlurFilter();
const colorMatrix = new PIXI.filters.ColorMatrixFilter();

// Indentity Matrix for our target
const identMatrix = 	[
			1, 0, 0, 0, 0,
			0, 1, 0, 0, 0,
			0, 0, 1, 0, 0,
			0, 0, 0, 1, 0,
		];

// The colorMatrix values to enhance the contrast of the blur
const contrastMatrix = [
			1, 0, 0, 0,   0,
			0, 1, 0, 0,   0,
			0, 0, 1, 0,   0,
			0, 0, 0, 22, -7,
		];

// The container for our text
const textContainer = new PIXI.Container();
// Add the text graphics to it
textContainer.addChild(quote);

// Make a sprite from our texture
const textSprite = new PIXI.Sprite(textTexture);
// Render our text container into the texture
app.renderer.render(textContainer, textTexture);
// It is now safe to destroy our text Object to release memory
quote.destroy();


const sec = 3;
// Create our GSAP Timeline and respective Tweens
gsap.timeline({repeat: -1, yoyo: true, repeatDelay: 3})
.to(blurFilter, {
    blur: 0,
    duration: sec,
    ease: 'power1.Out'
})
.to(contrastMatrix,{
  endArray: identMatrix,
  duration: sec,
  ease: 'power1.Out'
}, "<")
.to(textSprite, {
  alpha: 1,
  duration: 0.5,
  ease: 'power1.Out'
},"<")

blurFilter.blur = 15;
colorMatrix.matrix = contrastMatrix;
textSprite.filters = [blurFilter, colorMatrix];
textSprite.alpha = 0; // start 
app.stage.addChild(textSprite);
              
            
!
999px

Console