Widget:UsingFileDemos: Difference between revisions
From COMP15212 Wiki
Yuron [PHRhYmxlIGNsYXNzPSJ0d3BvcHVwIj48dHI+PHRkIGNsYXNzPSJ0d3BvcHVwLWVudHJ5dGl0bGUiPkdyb3Vwczo8L3RkPjx0ZD51c2VyPGJyIC8+YnVyZWF1Y3JhdDxiciAvPmludGVyZmFjZS1hZG1pbjxiciAvPnN5c29wPGJyIC8+PC90ZD48L3RyPjwvdGFibGU+] (talk | contribs) m (1 revision imported) |
W81054ch [PHRhYmxlIGNsYXNzPSJ0d3BvcHVwIj48dHI+PHRkIGNsYXNzPSJ0d3BvcHVwLWVudHJ5dGl0bGUiPkdyb3Vwczo8L3RkPjx0ZD51c2VyPGJyIC8+YnVyZWF1Y3JhdDxiciAvPmludGVyZmFjZS1hZG1pbjxiciAvPnN5c29wPGJyIC8+PC90ZD48L3RyPjwvdGFibGU+] (talk | contribs) m (1 revision imported) |
||
(One intermediate revision by one other user 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 | 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.