这里是 Frontend Focus 的中文翻译项目,每周在 己思 平台首发。
翻译及校对:richshaw2015,Yully Che
This is a good look at the performance gains you can expect when using variable fonts, with a focus on font requests, file sizes and time to first render. If you’re just starting to explore using variable fonts, this is a great related resource.
来源:Mandy Michael
Thanks to some recent changes in browsers, it’s now well worth setting width
and height
attributes on your images to prevent layout shifts and improve the experience of your site visitors.
来源:Barry Pollard
An estimated 1 million+ podcast episodes aren’t available over secure connections, and it’s about to become a problem.
来源:Dan Misener
This is a great deep-dive into the anatomy of the humble URL and how it came into being.
来源:Zack Bloom (Cloudflare)
Version 74 of Firefox arrived today. We’ve linked to the developer release notes as the headline features are minimal. Developer level changes include Feature Policy support enabled by default, TLS 1.0 and 1.1 support removed, text-underline-position
CSS property now enabled, and JavaScript gains the optional chaining operator.
来源:Mozilla
Due to the complex nature of web apps, it’s no longer correct to say the web is ‘accessible by default’. As Hidde points out, we need browser accessibility bugs to be prioritized.
来源:Hidde de Vries
There are thousands of Tartan patterns (the cloth that’s typically associated with Scotland) - here’s a look at how they were all digitally weaved with code (React).
来源:Paulina Hetman
Starting in Chrome 81, scrollers remain snapped when the page layout changes, no longer requiring event listeners to force snapping, which fixes a shortcoming of this feature.
来源:Yi Gu, Kaan Alsan, Adam Argyle
This detailed tutorial was first published last year but has recently been updated to include IntersectionObserver
methods.
const callback = function(entries) {
entries.forEach(entry => {
entry.target.classList.toggle("is-visible");
});
};
const observer = new IntersectionObserver(callback);
const targets = document.querySelectorAll(".show-on-scroll");
targets.forEach(function(target) {
observer.observe(target);
});
来源:CSS Animation
Related to the above item, here’s a decent overview of IntersectionObserver
, using the example of lazy loading elements.
来源:Leonardo Maldonado
Lukas White takes an in-depth look at DropzoneJS — a configurable JavaScript library that makes it easier to deal with file uploads.
来源:Lukas White
JavaScript has just gotten so serious nowadays, so I like to frequently link to tutorials like this that cover building neat Web page effects.. like we used JavaScript for back in the 90s 😄 18 minutes.
来源:Traversy Media
来源:Ryan Atkinson
来源:Google
来源:Theresa O’Connor
来源:Ryan Neufeld
This is a replacement for Microsoft’s deprecated Silverlight. It’s open-source and runs in current browsers via WebAssembly. Here’s the announcement post.
来源:Userware
Here’s a live demo.
来源:Sami Chniter
Written in Go but clearly aimed at JS/front-end dev use cases. ls-lint
provides a way to enforce rules for file naming and directory structures.
来源:Lucas Löffel
Used to to turn coordinates into human readable locations.
import requests
resp = requests.get("https://geo-info.co/45.6479,-74.3451")
json = resp.json()
print(json['city'])
来源:geo-info
来源:Chris Coyier
译者注:如需了解,请查看原文。
译者注:如需了解,请查看原文。
Copyright © 2015-2022 BY-NC-ND 4.0