Jump to content

MediaWiki:Gadget-WebGL2.js: Difference between revisions

From Apogea Wiki
Dane (talk | contribs)
Created page with "$(function() { $('.webgl-mount').each(function() { var mount = $(this); var scene = mount.data('scene'); var canvas = document.createElement('canvas'); canvas.width = mount.data('width') || 800; canvas.height = mount.data('height') || 600; canvas.className = 'webgl-canvas'; mount.append(canvas); // Your WebGL initialization here console.log('WebGL canvas created for scene:', scene); }); });"
 
Dane (talk | contribs)
No edit summary
Line 1: Line 1:
$(function() {
$(function() {
  $('.webgl-mount').each(function() {
console.log("WebGL2 Test");
      var mount = $(this);
      var scene = mount.data('scene');
$('.webgl-mount').each(function() {
 
var mount = $(this);
      var canvas = document.createElement('canvas');
var scene = mount.data('scene');
      canvas.width = mount.data('width') || 800;
      canvas.height = mount.data('height') || 600;
var canvas = document.createElement('canvas');
      canvas.className = 'webgl-canvas';
canvas.width = mount.data('width') || 800;
      mount.append(canvas);
canvas.height = mount.data('height') || 600;
 
canvas.className = 'webgl-canvas';
      // Your WebGL initialization here
mount.append(canvas);
      console.log('WebGL canvas created for scene:', scene);
  });
// Your WebGL initialization here
console.log('WebGL canvas created for scene:', scene);
});
});
});

Revision as of 19:05, 31 January 2026

$(function() {
	console.log("WebGL2 Test");
	
	$('.webgl-mount').each(function() {
		var mount = $(this);
		var scene = mount.data('scene');
		
		var canvas = document.createElement('canvas');
		canvas.width = mount.data('width') || 800;
		canvas.height = mount.data('height') || 600;
		canvas.className = 'webgl-canvas';
		mount.append(canvas);
		
		// Your WebGL initialization here
		console.log('WebGL canvas created for scene:', scene);
	});
});