Browse Source

Cleaned up custom stats.js styling in examples (thanks to @mrdoob for showing me this is possible ;).

alteredq 12 years ago
parent
commit
4500c593dd

+ 5 - 6
examples/webgl_animation_cloth.html

@@ -25,6 +25,11 @@
 				text-decoration: underline;
 				cursor: pointer;
 			}
+
+			#stats { position: absolute; top:0; left: 0 }
+			#stats #fps { background: transparent !important }
+			#stats #fps #fpsText { color: #aaa !important }
+			#stats #fps #fpsGraph { display: none }
 		</style>
 	</head>
 
@@ -304,14 +309,8 @@
 				//
 
 				stats = new Stats();
-				stats.domElement.style.position = 'absolute';
-				stats.domElement.style.top = '0px';
 				container.appendChild( stats.domElement );
 
-				stats.domElement.children[ 0 ].children[ 0 ].style.color = "#aaa";
-				stats.domElement.children[ 0 ].style.background = "transparent";
-				stats.domElement.children[ 0 ].children[ 1 ].style.display = "none";
-
 				//
 
 				window.addEventListener( 'resize', onWindowResize, false );

+ 5 - 7
examples/webgl_animation_skinning_morph.html

@@ -25,6 +25,11 @@
 			a {
 				color: #0af;
 			}
+
+			#stats { position: absolute; top:0; left: 0 }
+			#stats #fps { background: transparent !important }
+			#stats #fps #fpsText { color: #777 !important }
+			#stats #fps #fpsGraph { display: none }
 		</style>
 	</head>
 
@@ -155,15 +160,8 @@
 				// STATS
 
 				stats = new Stats();
-				stats.domElement.style.position = 'absolute';
-				stats.domElement.style.top = '0px';
-				stats.domElement.style.zIndex = 100;
 				container.appendChild( stats.domElement );
 
-				stats.domElement.children[ 0 ].children[ 0 ].style.color = "#777";
-				stats.domElement.children[ 0 ].style.background = "transparent";
-				stats.domElement.children[ 0 ].children[ 1 ].style.display = "none";
-
 				//
 
 				var loader = new THREE.JSONLoader();

+ 4 - 8
examples/webgl_camera.html

@@ -30,6 +30,10 @@
 
 			b { color: lightgreen }
 
+			#stats { position: absolute; top:0; left: 0 }
+			#stats #fps { background: transparent !important }
+			#stats #fps #fpsText { color: #777 !important }
+			#stats #fps #fpsGraph { display: none }
 		</style>
 	</head>
 	<body>
@@ -142,14 +146,6 @@
 				//
 
 				stats = new Stats();
-				stats.domElement.style.position = 'absolute';
-				stats.domElement.style.top = '0px';
-				stats.domElement.style.zIndex = 100;
-
-				stats.domElement.children[ 0 ].children[ 0 ].style.color = "#666";
-				stats.domElement.children[ 0 ].style.background = "transparent";
-				stats.domElement.children[ 0 ].children[ 1 ].style.display = "none";
-
 				container.appendChild( stats.domElement );
 
 				//

+ 4 - 8
examples/webgl_geometry_tessellation.html

@@ -26,6 +26,10 @@
 
 			a { color: red }
 
+			#stats { position: absolute; top:0; left: 0 }
+			#stats #fps { background: transparent !important }
+			#stats #fps #fpsText { color: #777 !important }
+			#stats #fps #fpsGraph { display: none }
 		</style>
 	</head>
 
@@ -222,16 +226,8 @@
 			container.appendChild( renderer.domElement );
 
 			stats = new Stats();
-			stats.domElement.style.position = 'absolute';
-			stats.domElement.style.top = '0px';
-
-			stats.domElement.children[ 0 ].children[ 0 ].style.color = "#555";
-			stats.domElement.children[ 0 ].style.background = "transparent";
-			stats.domElement.children[ 0 ].children[ 1 ].style.display = "none";
-
 			container.appendChild( stats.domElement );
 
-
 			//
 
 			window.addEventListener( 'resize', onWindowResize, false );

+ 4 - 7
examples/webgl_lensflares.html

@@ -32,6 +32,10 @@
 				color: #0080ff;
 			}
 
+			#stats { position: absolute; top:0; left: 0 }
+			#stats #fps { background: transparent !important }
+			#stats #fps #fpsText { color: #aaa !important }
+			#stats #fps #fpsGraph { display: none }
 		</style>
 	</head>
 
@@ -182,15 +186,8 @@
 				// stats
 
 				stats = new Stats();
-				stats.domElement.style.position = 'absolute';
-				stats.domElement.style.top = '0px';
-				stats.domElement.style.zIndex = 100;
 				container.appendChild( stats.domElement );
 
-				stats.domElement.children[ 0 ].children[ 0 ].style.color = "#aaa";
-				stats.domElement.children[ 0 ].style.background = "transparent";
-				stats.domElement.children[ 0 ].children[ 1 ].style.display = "none";
-
 				// events
 
 				window.addEventListener( 'resize', onWindowResize, false );

+ 6 - 7
examples/webgl_lights_hemisphere.html

@@ -29,8 +29,14 @@
 			a:hover {
 				color: #f00;
 			}
+
 			#footer { width: 100%; margin: 2em auto; text-align: center; position: absolute; bottom: 0 }
 			strong { color: red }
+
+			#stats { position: absolute; top:0; left: 0 }
+			#stats #fps { background: transparent !important }
+			#stats #fps #fpsText { color: #555 !important }
+			#stats #fps #fpsGraph { display: none }
 		</style>
 	</head>
 	<body>
@@ -233,15 +239,8 @@
 				// STATS
 
 				stats = new Stats();
-				stats.domElement.style.position = 'absolute';
-				stats.domElement.style.top = '0px';
-				stats.domElement.style.zIndex = 100;
 				container.appendChild( stats.domElement );
 
-				stats.domElement.children[ 0 ].children[ 0 ].style.color = "#777";
-				stats.domElement.children[ 0 ].style.background = "transparent";
-				stats.domElement.children[ 0 ].children[ 1 ].style.display = "none";
-
 				//
 
 				window.addEventListener( 'resize', onWindowResize, false );

+ 5 - 8
examples/webgl_lights_pointlights2.html

@@ -29,6 +29,11 @@
 			a:hover {
 				color: #0080ff;
 			}
+
+			#stats { position: absolute; top:0; left: 0 }
+			#stats #fps { background: transparent !important }
+			#stats #fps #fpsText { color: #aaa !important }
+			#stats #fps #fpsGraph { display: none }
 		</style>
 	</head>
 	<body>
@@ -229,14 +234,6 @@
 				// STATS
 
 				stats = new Stats();
-				stats.domElement.style.position = 'absolute';
-				stats.domElement.style.top = '0px';
-				stats.domElement.style.zIndex = 100;
-
-				stats.domElement.children[ 0 ].children[ 0 ].style.color = "#aaa";
-				stats.domElement.children[ 0 ].style.background = "transparent";
-				stats.domElement.children[ 0 ].children[ 1 ].style.display = "none";
-
 				container.appendChild( stats.domElement );
 
 				//

+ 7 - 7
examples/webgl_loader_ctm.html

@@ -12,6 +12,7 @@
 				margin: 0px;
 				overflow: hidden;
 			}
+
 			#info {
 				color: #fff;
 				position: absolute;
@@ -21,7 +22,13 @@
 				z-index: 100;
 				display:block;
 			}
+
 			#info a, .button { color: #f00; font-weight: bold; text-decoration: underline; cursor: pointer }
+
+			#stats { position: absolute; top:0; left: 0 }
+			#stats #fps { background: transparent !important }
+			#stats #fps #fpsText { color: #aaa !important }
+			#stats #fps #fpsGraph { display: none }
 		</style>
 	</head>
 
@@ -125,15 +132,8 @@
 				// STATS
 
 				stats = new Stats();
-				stats.domElement.style.position = 'absolute';
-				stats.domElement.style.top = '0px';
-				stats.domElement.style.zIndex = 100;
 				container.appendChild( stats.domElement );
 
-				stats.domElement.children[ 0 ].children[ 0 ].style.color = "#aaa";
-				stats.domElement.children[ 0 ].style.background = "transparent";
-				stats.domElement.children[ 0 ].children[ 1 ].style.display = "none";
-
 				// EVENTS
 
 				window.addEventListener( 'resize', onWindowResize, false );

+ 7 - 7
examples/webgl_loader_ctm_materials.html

@@ -15,7 +15,9 @@
 				font-size:13px;
 				text-align:center;
 			}
+
 			a { color:skyblue }
+
 			#info {
 				position: absolute;
 				top: 0px; width: 100%;
@@ -26,6 +28,11 @@
 				z-index:100;
 				display:block;
 			}
+
+			#stats { position: absolute; top:5px; left: 0; z-index: 100 }
+			#stats #fps { background: transparent !important }
+			#stats #fps #fpsText { color: #aaa !important }
+			#stats #fps #fpsGraph { display: none }
 		</style>
 	</head>
 
@@ -160,15 +167,8 @@
 				// STATS
 
 				stats = new Stats();
-				stats.domElement.style.position = 'absolute';
-				stats.domElement.style.top = '5px';
-				stats.domElement.style.zIndex = 100;
 				container.appendChild( stats.domElement );
 
-				stats.domElement.children[ 0 ].children[ 0 ].style.color = "#aaa";
-				stats.domElement.children[ 0 ].style.background = "transparent";
-				stats.domElement.children[ 0 ].children[ 1 ].style.display = "none";
-
 				// EVENTS
 
 				window.addEventListener( 'resize', onWindowResize, false );

+ 6 - 6
examples/webgl_loader_json_blender.html

@@ -24,8 +24,14 @@
 			}
 
 			a { color: red }
+
+			#stats { position: absolute; top:0; left: 0 }
+			#stats #fps { background: transparent !important }
+			#stats #fps #fpsText { color: #aaa !important }
+			#stats #fps #fpsGraph { display: none }
 		</style>
 	</head>
+
 	<body>
 		<div id="info">
 			<a href="http://threejs.org" target="_blank">three.js</a> -
@@ -159,14 +165,8 @@
 				// Stats
 
 				stats = new Stats();
-				stats.domElement.style.position = 'absolute';
-				stats.domElement.style.top = '0px';
 				container.appendChild( stats.domElement );
 
-				stats.domElement.children[ 0 ].children[ 0 ].style.color = "#aaa";
-				stats.domElement.children[ 0 ].style.background = "transparent";
-				stats.domElement.children[ 0 ].children[ 1 ].style.display = "none";
-
 				// Events
 
 				window.addEventListener( 'resize', onWindowResize, false );

+ 4 - 6
examples/webgl_marching_cubes.html

@@ -42,6 +42,10 @@
 		  display: none;
 		}
 
+		#stats { position: absolute; top:0; left: 0 }
+		#stats #fps { background: transparent !important }
+		#stats #fps #fpsText { color: #aaa !important }
+		#stats #fps #fpsGraph { display: none }
 	</style>
 </head>
 
@@ -174,14 +178,8 @@
 			// STATS
 
 			stats = new Stats();
-			stats.domElement.style.position = 'absolute';
-			stats.domElement.style.top = '0px';
 			container.appendChild( stats.domElement );
 
-			stats.domElement.children[ 0 ].children[ 0 ].style.color = "#888";
-			stats.domElement.children[ 0 ].style.background = "transparent";
-			stats.domElement.children[ 0 ].children[ 1 ].style.display = "none";
-
 			// COMPOSER
 
 			renderer.autoClear = false;

+ 4 - 9
examples/webgl_materials_bumpmap.html

@@ -34,8 +34,11 @@
 
 			#vt { display:none }
 			#vt, #vt a { color:orange; }
-			.code { }
 
+			#stats { position: absolute; top:0; left: 0 }
+			#stats #fps { background: transparent !important }
+			#stats #fps #fpsText { color: #aaa !important }
+			#stats #fps #fpsGraph { display: none }
 		</style>
 	</head>
 
@@ -191,14 +194,6 @@
 				if ( statsEnabled ) {
 
 					stats = new Stats();
-					stats.domElement.style.position = 'absolute';
-					stats.domElement.style.top = '0px';
-					stats.domElement.style.zIndex = 100;
-
-					stats.domElement.children[ 0 ].children[ 0 ].style.color = "#aaa";
-					stats.domElement.children[ 0 ].style.background = "transparent";
-					stats.domElement.children[ 0 ].children[ 1 ].style.display = "none";
-
 					container.appendChild( stats.domElement );
 
 				}

+ 4 - 8
examples/webgl_materials_bumpmap_skin.html

@@ -32,6 +32,10 @@
 				color:#fff;
 			}
 
+			#stats { position: absolute; top:0; left: 0 }
+			#stats #fps { background: transparent !important }
+			#stats #fps #fpsText { color: #aaa !important }
+			#stats #fps #fpsGraph { display: none }
 		</style>
 	</head>
 
@@ -199,14 +203,6 @@
 				if ( statsEnabled ) {
 
 					stats = new Stats();
-					stats.domElement.style.position = 'absolute';
-					stats.domElement.style.top = '0px';
-					stats.domElement.style.zIndex = 100;
-
-					stats.domElement.children[ 0 ].children[ 0 ].style.color = "#aaa";
-					stats.domElement.children[ 0 ].style.background = "transparent";
-					stats.domElement.children[ 0 ].children[ 1 ].style.display = "none";
-
 					container.appendChild( stats.domElement );
 
 				}

+ 5 - 7
examples/webgl_materials_cubemap_dynamic.html

@@ -22,6 +22,11 @@
 
 			.h { color: skyblue }
 			.c { display: inline; margin-left: 1em }
+
+			#stats { position: absolute; top:0; left: 0 }
+			#stats #fps { background: transparent !important }
+			#stats #fps #fpsText { color: #888 !important }
+			#stats #fps #fpsGraph { display: none }
 		</style>
 	</head>
 
@@ -206,15 +211,8 @@
 				// STATS
 
 				stats = new Stats();
-				stats.domElement.style.position = 'absolute';
-				stats.domElement.style.top = '0px';
-				stats.domElement.style.zIndex = 100;
 				container.appendChild( stats.domElement );
 
-				stats.domElement.children[ 0 ].children[ 0 ].style.color = "#888";
-				stats.domElement.children[ 0 ].style.background = "#000";
-				stats.domElement.children[ 0 ].children[ 1 ].style.display = "none";
-
 				// CUBE CAMERA
 
 				cubeCamera = new THREE.CubeCamera( 1, 100000, 128 );

+ 5 - 7
examples/webgl_materials_lightmap.html

@@ -15,6 +15,11 @@
 			}
 			h1 { }
 			a { color:skyblue }
+
+			#stats { position: absolute; top:0; left: 0 }
+			#stats #fps { background: transparent !important }
+			#stats #fps #fpsText { color: #abc !important }
+			#stats #fps #fpsGraph { display: none }
 		</style>
 	</head>
 
@@ -144,15 +149,8 @@
 				// STATS
 
 				stats = new Stats();
-				stats.domElement.style.position = 'absolute';
-				stats.domElement.style.top = '0px';
-				stats.domElement.style.zIndex = 100;
 				container.appendChild( stats.domElement );
 
-				stats.domElement.children[ 0 ].children[ 0 ].style.color = "#abc";
-				stats.domElement.children[ 0 ].style.background = "transparent";
-				stats.domElement.children[ 0 ].children[ 1 ].style.display = "none";
-
 				// MODEL
 
 				var loader = new THREE.JSONLoader();

+ 5 - 4
examples/webgl_materials_skin.html

@@ -32,6 +32,10 @@
 				color:#fff;
 			}
 
+			#stats { position: absolute; top:0; left: 0 }
+			#stats #fps { background: transparent !important }
+			#stats #fps #fpsText { color: #aaa !important }
+			#stats #fps #fpsGraph { display: none }
 		</style>
 	</head>
 
@@ -65,7 +69,7 @@
 
 			if ( ! Detector.webgl ) Detector.addGetWebGLMessage();
 
-			var statsEnabled = false;
+			var statsEnabled = true;
 
 			var container, stats, loader;
 
@@ -164,9 +168,6 @@
 				if ( statsEnabled ) {
 
 					stats = new Stats();
-					stats.domElement.style.position = 'absolute';
-					stats.domElement.style.top = '0px';
-					stats.domElement.style.zIndex = 100;
 					container.appendChild( stats.domElement );
 
 				}

+ 4 - 7
examples/webgl_materials_texture_anisotropy.html

@@ -33,6 +33,10 @@
 
 			a { color:red }
 
+			#stats { position: absolute; top:0; left: 0 }
+			#stats #fps { background: transparent !important }
+			#stats #fps #fpsText { color: #777 !important }
+			#stats #fps #fpsGraph { display: none }
 		</style>
 	</head>
 
@@ -161,15 +165,8 @@
 				// STATS1
 
 				stats = new Stats();
-				stats.domElement.style.position = 'absolute';
-				stats.domElement.style.top = '0px';
-				stats.domElement.style.zIndex = 100;
 				container.appendChild( stats.domElement );
 
-				stats.domElement.children[ 0 ].children[ 0 ].style.color = "#777";
-				stats.domElement.children[ 0 ].style.background = "transparent";
-				stats.domElement.children[ 0 ].children[ 1 ].style.display = "none";
-
 				document.addEventListener( 'mousemove', onDocumentMouseMove, false );
 
 			}

+ 4 - 7
examples/webgl_materials_texture_compressed.html

@@ -24,6 +24,10 @@
 				z-index:1000;
 			}
 
+			#stats { position: absolute; top:0; left: 0 }
+			#stats #fps { background: transparent !important }
+			#stats #fps #fpsText { color: #aaa !important }
+			#stats #fps #fpsGraph { display: none }
 		</style>
 	</head>
 	<body>
@@ -112,15 +116,8 @@
 				document.body.appendChild( renderer.domElement );
 
 				stats = new Stats();
-				stats.domElement.style.position = 'absolute';
-				stats.domElement.style.top = '0px';
-				stats.domElement.style.zIndex = 100;
 				document.body.appendChild( stats.domElement );
 
-				stats.domElement.children[ 0 ].children[ 0 ].style.color = "#777";
-				stats.domElement.children[ 0 ].style.background = "transparent";
-				stats.domElement.children[ 0 ].children[ 1 ].style.display = "none";
-
 				window.addEventListener( 'resize', onWindowResize, false );
 
 			}

+ 6 - 7
examples/webgl_morphnormals.html

@@ -12,7 +12,13 @@
 				margin: 0px;
 				overflow: hidden;
 			}
+
 			a { color: #f00 }
+
+			#stats { position: absolute; top:0; left: 0 }
+			#stats #fps { background: transparent !important }
+			#stats #fps #fpsText { color: #666 !important }
+			#stats #fps #fpsGraph { display: none }
 		</style>
 	</head>
 	<body>
@@ -134,13 +140,6 @@
 				//
 
 				stats = new Stats();
-				stats.domElement.style.position = 'absolute';
-				stats.domElement.style.top = '0px';
-
-				stats.domElement.children[ 0 ].children[ 0 ].style.color = "#666";
-				stats.domElement.children[ 0 ].style.background = "transparent";
-				stats.domElement.children[ 0 ].children[ 1 ].style.display = "none";
-
 				container.appendChild( stats.domElement );
 
 				//

+ 20 - 22
examples/webgl_morphtargets_md2.html

@@ -6,28 +6,33 @@
 		<meta name="viewport" content="width=device-width, user-scalable=no, minimum-scale=1.0, maximum-scale=1.0">
 		<style>
 		    body {
-			color: #fff;
-			font-family:Monospace;
-			font-size:13px;
-			text-align:center;
-			font-weight: bold;
-
-			background-color: #000;
-			margin: 0px;
-			overflow: hidden;
+				color: #fff;
+				font-family:Monospace;
+				font-size:13px;
+				text-align:center;
+				font-weight: bold;
+
+				background-color: #000;
+				margin: 0px;
+				overflow: hidden;
 		    }
 
 		    #info {
-			color:#fff;
-			position: relative;
-			margin: 0 auto -2.1em;
-			top: 0px;
+				color:#fff;
+				position: relative;
+				margin: 0 auto -2.1em;
+				top: 0px;
 
-			padding: 5px;
-			z-index:100;
+				padding: 5px;
+				z-index:100;
 		    }
 
 		    a { color: skyblue; }
+
+			#stats { position: absolute; top:0; left: 0 }
+			#stats #fps { background: transparent !important }
+			#stats #fps #fpsText { color: #aaa !important }
+			#stats #fps #fpsGraph { display: none }
 		</style>
 	</head>
 
@@ -146,15 +151,8 @@
 				// STATS
 
 				stats = new Stats();
-				stats.domElement.style.position = 'absolute';
-				stats.domElement.style.top = '0px';
-				stats.domElement.style.zIndex = 100;
 				container.appendChild( stats.domElement );
 
-				stats.domElement.children[ 0 ].children[ 0 ].style.color = "#aaa";
-				stats.domElement.children[ 0 ].style.background = "transparent";
-				stats.domElement.children[ 0 ].children[ 1 ].style.display = "none";
-
 				// EVENTS
 
 				window.addEventListener( 'resize', onWindowResize, false );

+ 5 - 7
examples/webgl_morphtargets_md2_control.html

@@ -28,6 +28,11 @@
 		    }
 
 		    a { color: skyblue; }
+
+			#stats { position: absolute; top:0; left: 0 }
+			#stats #fps { background: transparent !important }
+			#stats #fps #fpsText { color: #aaa !important }
+			#stats #fps #fpsGraph { display: none }
 		</style>
 	</head>
 
@@ -151,15 +156,8 @@
 				// STATS
 
 				stats = new Stats();
-				stats.domElement.style.position = 'absolute';
-				stats.domElement.style.top = '0px';
-				stats.domElement.style.zIndex = 100;
 				container.appendChild( stats.domElement );
 
-				stats.domElement.children[ 0 ].children[ 0 ].style.color = "#aaa";
-				stats.domElement.children[ 0 ].style.background = "transparent";
-				stats.domElement.children[ 0 ].children[ 1 ].style.display = "none";
-
 				// EVENTS
 
 				window.addEventListener( 'resize', onWindowResize, false );

+ 5 - 8
examples/webgl_performance_doublesided.html

@@ -12,6 +12,11 @@
 				font-weight: bold;
 				overflow:hidden;
 			}
+
+			#stats { position: absolute; top:0; left: 0 }
+			#stats #fps { background: transparent !important }
+			#stats #fps #fpsText { color: #eee !important }
+			#stats #fps #fpsGraph { display: none }
 		</style>
 	</head>
 	<body>
@@ -121,14 +126,6 @@
 				container.appendChild( renderer.domElement );
 
 				stats = new Stats();
-				stats.domElement.style.position = 'absolute';
-				stats.domElement.style.top = '0px';
-				stats.domElement.style.zIndex = 100;
-
-				stats.domElement.children[ 0 ].children[ 0 ].style.color = "#eee";
-				stats.domElement.children[ 0 ].style.background = "transparent";
-				stats.domElement.children[ 0 ].children[ 1 ].style.display = "none";
-
 				container.appendChild( stats.domElement );
 
 				document.addEventListener( 'mousemove', onDocumentMouseMove, false );

+ 5 - 6
examples/webgl_postprocessing_godrays.html

@@ -27,6 +27,11 @@
 				padding: 5px;
 				z-index:100;
 			}
+
+			#stats { position: absolute; top:0; left: 0 }
+			#stats #fps { background: transparent !important }
+			#stats #fps #fpsText { color: #888 !important }
+			#stats #fps #fpsGraph { display: none }
 		</style>
 	</head>
 
@@ -143,14 +148,8 @@
 				//
 
 				stats = new Stats();
-				stats.domElement.style.position = 'absolute';
-				stats.domElement.style.top = '0px';
 				container.appendChild( stats.domElement );
 
-				stats.domElement.children[ 0 ].children[ 0 ].style.color = "#888";
-				stats.domElement.children[ 0 ].style.background = "transparent";
-				stats.domElement.children[ 0 ].children[ 1 ].style.display = "none";
-
 				//
 
 				document.addEventListener( 'mousemove', onDocumentMouseMove, false );

+ 20 - 24
examples/webgl_shading_physical.html

@@ -6,28 +6,32 @@
 		<meta name="viewport" content="width=device-width, user-scalable=no, minimum-scale=1.0, maximum-scale=1.0">
 		<style>
 		    body {
-			color: #222;
-			font-family:Monospace;
-			font-size:13px;
-			text-align:center;
-			font-weight: bold;
-
-			background-color: #fff;
-			margin: 0px;
-			overflow: hidden;
+				color: #222;
+				font-family: Monospace;
+				font-size: 13px;
+				text-align: center;
+				font-weight: bold;
+
+				background-color: #fff;
+				margin: 0px;
+				overflow: hidden;
 		    }
 
 		    #info {
-			color:#000;
-			position: relative;
-			margin: 0 auto -2.1em;
-			top: 0px;
-			width: 550px;
-			padding: 5px;
-			z-index:100;
+				color: #000;
+				position: relative;
+				margin: 0 auto -2.1em;
+				top: 0px;
+				width: 550px;
+				padding: 5px;
+				z-index:100;
 		    }
 
 		    a { color: skyblue; }
+
+			#stats #fps { background: transparent !important }
+			#stats #fps #fpsText { color: #444 !important }
+			#stats #fps #fpsGraph { display: none }
 		</style>
 	</head>
 
@@ -381,14 +385,6 @@
 				// STATS
 
 				stats = new Stats();
-				stats.domElement.style.position = 'absolute';
-				stats.domElement.style.top = '0px';
-				stats.domElement.style.zIndex = 100;
-
-				stats.domElement.children[ 0 ].children[ 0 ].style.color = "#222";
-				stats.domElement.children[ 0 ].style.background = "transparent";
-				stats.domElement.children[ 0 ].children[ 1 ].style.display = "none";
-
 				container.appendChild( stats.domElement );
 
 				// EVENTS

+ 5 - 6
examples/webgl_terrain_dynamic.html

@@ -26,6 +26,11 @@
 			#loading { width: 100%; margin: 2em auto; text-align: center; position: absolute; top: 25em  }
 
 			#oldie a { color:#da0 }
+
+			#stats { position: absolute; top:0; left: 0 }
+			#stats #fps { background: transparent !important }
+			#stats #fps #fpsText { color: #aaa !important }
+			#stats #fps #fpsGraph { display: none }
 		</style>
 	</head>
 
@@ -464,14 +469,8 @@
 				// STATS
 
 				stats = new Stats();
-				stats.domElement.style.position = 'absolute';
-				stats.domElement.style.top = '0px';
 				container.appendChild( stats.domElement );
 
-				stats.domElement.children[ 0 ].children[ 0 ].style.color = "#aaa";
-				stats.domElement.children[ 0 ].style.background = "transparent";
-				stats.domElement.children[ 0 ].children[ 1 ].style.display = "none";
-
 				// EVENTS
 
 				onWindowResize();