Pen Settings

HTML

CSS

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. You can use the CSS from another Pen by using it's URL and the proper URL extention.

+ 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

              
                
	<head>
		<meta charset="utf-8">
		
		<meta name="format-detection" content="telephone=no">
		<meta name="apple-mobile-web-app-capable" content="yes">
		<meta name="apple-mobile-web-app-status-bar-style" content="black-translucent">

		<script type="text/javascript">
			// This automatically sets the right viewport scale on mobile devices
			(function() {
		 		var scale = 1 / window.devicePixelRatio
		 		var viewport = "width=device-width, height=device-height, initial-scale=" + scale + ", maximum-scale=" + scale + ", user-scalable=no"
		 		var iOS = /iPad|iPhone|iPod/.test(navigator.platform)
		 		if (iOS) { viewport += ", shrink-to-fit=no" }
		 		document.write("<meta name=\"viewport\" content=\"" + viewport + "\">")
			})()
		</script>

		<title>Prototype</title>
		<link rel="shortcut icon" href="images/favicon.png"/>
		
		<link rel="stylesheet" href="build/main.css">
	</head>

	<body>
	</body>

              
            
!

CSS

              
                * {
	margin: 0;
	padding: 0;
	border: none;
	-webkit-user-select: none;
	-webkit-tap-highlight-color: rgba(0,0,0,0);
}

.invi{
  visibility: hidden;
}

body {
	background-color: #fff;
	font: 28px/1em "Helvetica";
	color: gray;
	overflow: hidden;
	-webkit-tap-highlight-color: rgba(0,0,0,0);
}

a {
	color: gray;
}

body {
	cursor: url('../framer/images/cursor.png') 32 32, auto;
	cursor: -webkit-image-set(
		url('../framer/images/cursor.png') 1x,
		url('../framer/images/cursor@2x.png') 2x
	) 32 32, auto;
}

body:active {
	cursor: url('../framer/images/cursor-active.png') 32 32, auto;
	cursor: -webkit-image-set(
		url('../framer/images/cursor-active.png') 1x,
		url('../framer/images/cursor-active@2x.png') 2x
	) 32 32, auto;
}

.framerAlertBackground {
 	position: absolute; top:0px; left:0px; right:0px; bottom:0px;
 	z-index: 1000;
 	background-color: #fff;
}

.framerAlert {
	font:400 14px/1.4 "Helvetica Neue", Helvetica, Arial, sans-serif;
	-webkit-font-smoothing:antialiased;
	color:#616367; text-align:center;
 	position: absolute; top:40%; left:50%; width:260px; margin-left:-130px;
}
.framerAlert strong { font-weight:500; color:#000; margin-bottom:8px; display:block; }
.framerAlert a { color:#28AFFA; }
.framerAlert .btn {
	font-weight:500; text-decoration:none; line-height:1;
	display:inline-block; padding:6px 12px 7px 12px;
	border-radius:3px; margin-top:12px;
	background:#28AFFA; color:#fff;
}

::-webkit-scrollbar {
	display: none;
}

#test{
  font-size: 300px;
}
              
            
!

JS

              
                /*jshint esversion: 6 */

console.clear();
var log = console.log.bind(console);

//
// AUTO ALPHA GETTER/SETTER
// =======================================================================
Object.defineProperty(Layer.prototype, "autoAlpha", {
  get: function () { 
    return this.opacity; 
  },
  set: function (value) {            
    this.visible = !!value;
    this.opacity = value;
  },
  enumerable: true,
  configurable: true
});


// Device
Framer.Device = new Framer.DeviceComponent({
		deviceScale: "fit",
		deviceType: "google-pixel-very-silver",
		contentScale: 1
});

Framer.Device.setupContext();
Canvas.backgroundColor = "white"

// VARIABLES
// ==============================
var canvas, opacityValue;

// LAYERS
// ==============================
// Device background layer
canvas = new Layer({
	width: Screen.width,
	height: Screen.height,
	backgroundColor: 'transparent'
});

// Test layer
yolo = new Layer({
	width: Screen.width,
	height: 1000,
	backgroundColor: 'red',
	html: "<div id='test'>hahaha</div>"
});

TweenMax.to(yolo, 3, { 
  autoAlpha: 0,
  repeat: -1,
  repeatDelay: 1,
  yoyo: true
});

log("YOLO", yolo);

// testVar = yolo.querySelector("#test");

// Autoalpha (This will not work)
// TweenMax.to(yolo, 3, {autoAlpha: 0, repeat: -1});



// Can't add class to a Framer layer
// TweenMax.set(yolo, {className: "invi"});


// Framer way of adding a CSS class
// yolo.classList.add("invi")

// Autoalpha (This will work)
// TweenMax.to(yolo, 3, {x: 500, repeat: -1});

// Autoalpha (This will work)
// TweenMax.to(testVar, 3, {autoAlpha: 0, repeat: -1});
              
            
!
999px

Console