Widget:UsingFileDemos: Difference between revisions

From COMP15212 Wiki
pc>Yuron
Remove checking for demo presence because of ordering
 
m 1 revision imported
 
(2 intermediate revisions by 2 users not shown)
Line 23: Line 23:
function drawDisks(ctx, col)
function drawDisks(ctx, col)
{
{
   ellipse(ctx, DISKS_X, DISKS_Y + 30, DISK_dx, DISK_dy, "white");
   ellipse(ctx, DISKS_X, DISKS_Y + 30, DISK_dx, DISK_dy, usingDarkTheme ? "black" : "white");
   ellipse(ctx, DISKS_X, DISKS_Y + 20, DISK_dx, DISK_dy, col);
   ellipse(ctx, DISKS_X, DISKS_Y + 20, DISK_dx, DISK_dy, col);
   ellipse(ctx, DISKS_X, DISKS_Y + 10, DISK_dx, DISK_dy, "white");
   ellipse(ctx, DISKS_X, DISKS_Y + 10, DISK_dx, DISK_dy, usingDarkTheme ? "black" : "white");
   ellipse(ctx, DISKS_X, DISKS_Y + 00, DISK_dx, DISK_dy, "white");
   ellipse(ctx, DISKS_X, DISKS_Y + 00, DISK_dx, DISK_dy, usingDarkTheme ? "black" : "white");
   ctx.fillStyle = "black";
   ctx.fillStyle = usingDarkTheme ? "white" : "black";
   ctx.font = "20px Calibri";
   ctx.font = "20px Arial";
   ctx.fillText("DISK", DISKS_X-20, DISKS_Y);
   ctx.fillText("DISK", DISKS_X-20, DISKS_Y);
}
}
Line 52: Line 52:
   context.fillStyle = col;
   context.fillStyle = col;
   context.fill();
   context.fill();
   context.fillStyle = "black";
   context.fillStyle = usingDarkTheme ? "white" : "black";
   context.stroke();
   context.stroke();
}
}

Latest revision as of 16:19, 13 August 2019

This widget MUST be included in any page that uses the ReadFile or WriteFile widgets.