This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
https://ascii-generator.site/ | |
░░░░░░░░░░░░▄▄░░░░░░░░░ | |
░░░░░░░░░░░█░░█░░░░░░░░ | |
░░░░░░░░░░░█░░█░░░░░░░░ | |
░░░░░░░░░░█░░░█░░░░░░░░ | |
░░░░░░░░░█░░░░█░░░░░░░░ | |
███████▄▄█░░░░░██████▄░ | |
▓▓▓▓▓▓█░░░░░░░░░░░░░░█░ | |
▓▓▓▓▓▓█░░░░░░░░░░░░░░█░ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import Handlebars from "https://esm.sh/handlebars"; | |
const template = Handlebars.compile(` | |
<style> | |
body{ | |
font-family: arial; | |
font-size: small; | |
} | |
.box { | |
border-radius:10px; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import Handlebars from "https://esm.sh/handlebars"; | |
Handlebars.registerHelper("AQI", function(aqi){ | |
if(aqi > 50){ | |
return 'moderate'; | |
} else if (aqi > 100){ | |
return 'unhealthy-sensitive'; | |
} else if (aqi > 150){ | |
return 'unhealthy'; | |
} else if (aqi > 200){ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import Handlebars from "https://esm.sh/handlebars"; | |
console.log(Handlebars) | |
const template = Handlebars.compile(` | |
<div>{{data.name}}</div> | |
{{#each data.crew}} | |
<li>{{role}}</li> | |
{{/each}} | |
`); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Rapid.onResponse(async (res) => { | |
const main = document.querySelector("main"); | |
if (!res) { | |
main.innerHTML = "<pre>Response is empty</pre>"; | |
return; | |
} | |
const data = await res.json(); | |
main.innerHTML = | |
`<div> ${data.results[0].name.first} ${data.results[0].name.last} </div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(function () { | |
"use strict"; | |
function createToast(message, imgUrl, imgAlt) { | |
// Namespace: Windows.UI.Notifications | |
if (typeof Windows !== 'undefined' && | |
typeof Windows.UI !== 'undefined' && | |
typeof Windows.UI.Notifications !== 'undefined') { | |
// Setup variables for shorthand | |
var notifications = Windows.UI.Notifications, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
.hide { | |
display:none; | |
} | |
.show { | |
display:block; | |
} | |
.message { | |
font-family:'Segoe UI', Arial, Helvetica, sans-serif; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
This function expects two hexStrings and relies on hexStrToRGBA to convert | |
to a JSON object that represents RGBA for the underlying Windows API to | |
understand. | |
Examples of valid values: | |
setAppBarColors('#FFFFFF','#000000'); | |
setAppBarColors('#FFF','#000'); | |
setAppBarColors('FFFFFF','000000'); | |
setAppBarColors('FFF','000'); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function createToast(message, imgUrl, imgAlt) { | |
// Namespace: Windows.UI.Notifications | |
if (typeof Windows.UI.Notifications === 'undefined') { | |
return; | |
} | |
// Setup variables for shorthand | |
var notifications = Windows.UI.Notifications, | |
templateType = notifications.ToastTemplateType.toastImageAndText01, | |
templateContent = notifications.ToastNotificationManager.getTemplateContent(templateType), | |
toastMessage = templateContent.getElementsByTagName('text'), |
NewerOlder