JSFiddle - React, Tailwind, and code Playground
by grant
JavaScript
'use strict';
if ("undefined" !== typeof module && null != module.exports)
var moment = require("../protected/tests/js/node_modules/d3");
function toFrac(a) {
if (null === a)
return "?";
var c = Math.floor(a);
a -= c;
var b = "";
0 < c && (b += c.toString());
return .1 > a ? 0 < c ? c.toString() : "0" : .375 > a ? b + "\u00bc" : .625 > a ? b + "\u00bd" : .875 > a ? b + "\u00be" : (c + 1).toString()
}
var fa_weather_map = [{
string: "sun",
name: "sun"
}, {
string: "wind",
name: "wind"
}, {
string: "thunder",
name: "bolt"
}, {
string: "snow",
name: "snowflake"
}, {
string: "rain",
name: "cloud-rain"
}, {
string: "partly sunny",
name: "cloud-sun"
}, {
string: "cloud",
name: "cloud"
}];
function find(a, c) {
for (var b = 0; b < a.length; b++)
if (c(a[b]))
return a[b]
}
function getIcon(a) {
var c = find(fa_weather_map, function(b) {
return -1 != a.toLowerCase().indexOf(b.string)
});
return c ? c.name : null
}
function processHazard(a, c) {
if (null != a.url) {
var b = $("div#wwa-" + c);
if (void 0 === b[0]) {
b = $("div#wwa-template").clone();
b.find("div.title").append(a.name);
var f = "";
a.end && (f += " until " + moment.parseZone(a.end).format("ddd, MMM D h:mm A"));
b.find("small.timing").append(f);
b.find("div.card-header > div.see-more > a").attr("data-target", "#collapse-" + c);
b.find("div.card-header").attr("data-target", "#collapse-" + c).attr("aria-controls", "collapse-" + c);
b.find("div#collapse-").attr("aria-labelledby", "heading-" + c).attr("id", "collapse-" + c);
b.find("div#heading-").attr("id", "heading-" + c);
b.removeClass("d-none").removeAttr("id").attr("id", "wwa-" + c).appendTo("#accordion")
}
var e = b.find("div.card-body > span > a").attr("data-target",...