Widget:BarrierDemo: Difference between revisions

From COMP15212 Wiki
pc>Yuron
No edit summary
m 1 revision imported
 
(2 intermediate revisions by 2 users not shown)
Line 1: Line 1:
<noinclude>
<noinclude>
This widget serves as a demonstration for memory barriers.
This widget serves as a demonstration for memory barriers.
[{{canonicalurl:Special:ShowWidget|widget=BarrierDemo}} Dark-mode widget for embedding]


{{#widget:BarrierDemo}}
{{#widget:BarrierDemo}}
Line 17: Line 19:


// Set to use dark theme if the body's background color is too darkw
// Set to use dark theme if the body's background color is too darkw
var bodyColour = $("body").css("background-color").match(/rgba?\((.*)\)/)[1].split(',').map(Number);
var bodyColour = window.getComputedStyle(document.querySelector('body')).getPropertyValue("background-color").match(/rgba?\((.*)\)/)[1].split(',').map(Number);
var usingDarkTheme;
var usingDarkTheme;
if (bodyColour[3] === 0)
if (bodyColour[3] === 0)

Latest revision as of 07:22, 14 August 2019

This widget serves as a demonstration for memory barriers.

Dark-mode widget for embedding