Spaces:
Running
Running
| <html> | |
| <head> | |
| <meta charset="utf-8"> | |
| <title>Learn WebGL</title> | |
| </head> | |
| <style> | |
| html, | |
| body, | |
| canvas { | |
| height: 100%; | |
| width: 100%; | |
| display: flex; | |
| justify-content: center; | |
| align-items: center; | |
| margin: 0 | |
| } | |
| .divcanvas { | |
| width: 66%; | |
| height: 66%; | |
| position: relative; | |
| } | |
| .playpause { | |
| position: absolute; | |
| left: 0px; | |
| top: 0px; | |
| width: 100%; | |
| height: 100%; | |
| font-size: 60px; | |
| justify-content: center; | |
| align-items: center; | |
| color: rgba(255, 255, 255, 0.3); | |
| transition: opacity 0.2s ease-in-out; | |
| } | |
| .playpausehide, | |
| .playpause:hover { | |
| opacity: 0; | |
| } | |
| .iframe .divcanvas { | |
| display: block; | |
| } | |
| </style> | |
| <body onload="main()"> | |
| <div class="divcanvas"> | |
| <canvas id="canvas"></canvas> | |
| <div class="playpause">▶</div> | |
| </div> | |
| </body> | |
| <!-- | |
| for most samples webgl-utils only provides shader compiling/linking and | |
| canvas resizing because why clutter the examples with code that's the same in every sample. | |
| See https://webglfundamentals.org/webgl/lessons/webgl-boilerplate.html | |
| and https://webglfundamentals.org/webgl/lessons/webgl-resizing-the-canvas.html | |
| for webgl-utils, m3, m4, and webgl-lessons-ui. | |
| --> | |
| <script src="https://webglfundamentals.org/webgl/resources/webgl-utils.js"></script> | |
| <script src="./test.js"></script> | |
| </html> |