first commit

This commit is contained in:
armansansd
2023-07-12 16:31:19 +01:00
commit 3424b1927b
23306 changed files with 2217776 additions and 0 deletions
+23
View File
@@ -0,0 +1,23 @@
/*!
{
"name": "Low Battery Level",
"property": "lowbattery",
"tags": ["hardware", "mobile"],
"builderAliases": ["battery_level"],
"authors": ["Paul Sayre"],
"notes": [{
"name": "MDN Docs",
"href": "https://developer.mozilla.org/en-US/docs/Web/API/Navigator/battery"
}]
}
!*/
/* DOC
Enable a developer to remove CPU intensive CSS/JS when battery is low
*/
define(['Modernizr', 'prefixed'], function(Modernizr, prefixed) {
Modernizr.addTest('lowbattery', function() {
var minLevel = 0.20;
var battery = prefixed('battery', navigator);
return !!(battery && !battery.charging && battery.level <= minLevel);
});
});