Probably the most better downloads when soliciting for a webpage are customized fonts. There are lots of nice ways for lazy loading fonts to reinforce efficiency for the ones on deficient connections. Through getting perception into what fonts the person has to be had, we will be able to keep away from loading customized fonts. That is the place queryLocalFonts
is available in — an local JavaScript serve as to assemble person font data.
queryLocalFonts
is an async
serve as that calls for person permission by means of a browser urged when first accomplished. queryLocalFonts
returns an array of FontData
items which include details about all to be had fonts:
const localFonts = watch for window.queryLocalFonts(); // [FontData, FontData, ...] /* { circle of relatives: "Academy Engraved LET", fullName: "Academy Engraved LET Undeniable:1.0", postscriptName: "AcademyEngravedLetPlain", taste: "Undeniable", } */
If you need to focus on a selected font face, you’ll be able to additionally immediately question the postscriptName
assets:
const canelaFonts = watch for window.queryLocalFonts({ postscriptNames: ["Canela", "Canela-Bold"], }); // [FontData, FontData, ...]
With queryLocalFonts
you’ll be able to leverage a fonts a person already has as an alternative of downloading pricey customized fonts. The urged for permissions turns out adore it would deter customers from permitting the API, then again. It is so cool that this API exists even though!
LightFace: Facebook Lightbox for MooTools
One of the web components I’ve always loved has been Facebook’s modal dialog. This “lightbox” isn’t like others: no dark overlay, no obnoxious animating to size, and it doesn’t try to do “too much.” With Facebook’s dialog in mind, I’ve created LightFace: a Facebook lightbox…
Image Reflection with jQuery and MooTools
One delicate element that may make a large distinction on any internet design is the usage of symbol reflections. The use of them too frequently can develop into obnoxious however the use of reflections on huge, “masthead” photographs is a stylish enhancement. Sadly developing symbol reflections inside of your…