wit [ASAP] Terahertz Spectroscopy of Gas Mixtures with Dual Quantum Cascade Laser Frequency Combs By dx.doi.org Published On :: Thu, 23 Apr 2020 04:00:00 GMT ACS PhotonicsDOI: 10.1021/acsphotonics.9b01758 Full Article
wit [ASAP] Exciton-Polaritons with Magnetic and Electric Character in All-Dielectric Metasurfaces By dx.doi.org Published On :: Thu, 30 Apr 2020 04:00:00 GMT ACS PhotonicsDOI: 10.1021/acsphotonics.0c00063 Full Article
wit [ASAP] Colored Radiative Cooling Coatings with Nanoparticles By dx.doi.org Published On :: Fri, 01 May 2020 04:00:00 GMT ACS PhotonicsDOI: 10.1021/acsphotonics.0c00513 Full Article
wit [ASAP] Probing the Radiative Electromagnetic Local Density of States in Nanostructures with a Scanning Tunneling Microscope By dx.doi.org Published On :: Wed, 06 May 2020 04:00:00 GMT ACS PhotonicsDOI: 10.1021/acsphotonics.0c00264 Full Article
wit [ASAP] Line-Scan Hyperspectral Imaging Microscopy with Linear Unmixing for Automated Two-Dimensional Crystals Identification By dx.doi.org Published On :: Wed, 06 May 2020 04:00:00 GMT ACS PhotonicsDOI: 10.1021/acsphotonics.0c00050 Full Article
wit Interactivity and Animation with Variable Fonts By feedproxy.google.com Published On :: Thu, 05 Dec 2019 12:00:00 +0000 Mandy Michael turns the corner on our variable font adventure and stumbles into a grotto of wonder and amazement. Not forgetting the need for a proper performance budget, Mandy shows how variable fonts can free your creativity from bygone technical constraints. If you read Jason’s introductory article about variable fonts, you’ll understand the many benefits and opportunities that they offer in modern web development. From this point on we’ll assume that you have either read Jason’s introduction or have some prior knowledge of variable fonts so we can skip over the getting started information. If you haven’t read up on variable fonts before jump over to “Introduction to Variable Fonts: Everything you thought you knew about fonts just changed” first and then come join me back here so we can dive into using variable fonts for interactivity and animations! Creative Opportunities If we can use variable fonts to improve the performance of our websites while increasing the amount of style variations available to us, it means that we no longer need to trade off design for performance. Creativity can be the driving force behind our decisions, rather than performance and technical limitations. Cookie text effect font: This Man is a Monster, by Comic Book Fonts. My goal is to demonstrate how to create interactive, creative text on the web by combining variable fonts with CSS and JavaScript techniques that you may already be familiar with. With the introduction of variable fonts, designs which would have previously been a heavy burden on performance, or simply impossible due to technical limitations, are now completely possible. Still I Rise Poem by Maya Angelou, Demo emphasising different words with variable fonts. View on Codepen. Variable fonts demo with CSS Grid using multiple weights and font sizes to emphasise different parts of the message. View on Codepen. The tone and intent of our words can be more effectively represented with less worry over the impacts of loading in “too many font weights” (or other styles). This means that we can start a new path and focus on representing the content in more meaningful ways. For example, emphasising different words, or phrases depending on their importance in the story or content. Candy Cane Christmas Themed Text Effect with FS Pimlico Glow by Font Smith. View on Codepen. Note: using variable fonts does not negate the need for a good web font performance strategy! This is still important, because after all, they are still fonts. Keep that in mind and check out some of the great work done by Monica Dinculescu, Zach Leatherman or this incredible article by Helen Homes. Variable Fonts & Animations Because variable fonts can have an interpolated range of values we can leverage the flexibility and interactive nature of the web. Rather than using SVG, videos or JavaScript to accomplish these effects, we can create animations or transitions using real text, and we can do this using techniques we may already be familiar with. This means we can have editable, selectable, searchable, copy-pastable text, which is accessible via a screenreader. Grass Variable Font Demo Growing Grass Variable Font Text. Demo on Codepen. This effect is achieved using a font called Decovar, by David Berlow. To achieve the animation effect we only need a couple of things to get started. First, we set up the font-family and make use of the new property font-variation-settings to access the different axes available in Decovar. h1 { font-family: "Decovar"; font-variation-settings: 'INLN' 1000, 'SWRM' 1000; } For this effect, we use two custom axis – the first is called “inline” and is represented by the code INLI and the second is “skeleton worm” represented by the code SWRM. For both axes, the maximum value is 1000 and the minimum value is 0. For this effect, we’ll make the most of the full axis range. Once we have the base set up, we can create the animation. There are a number of ways to animate variable fonts. In this demo, we’ll use CSS keyframe animations and the font-variation-settings property, but you can also use CSS transitions and JavaScript as well. The code below will start with the “leaves” expanded and then shrink back until it disappears. @keyframes grow { 0% { font-variation-settings: 'INLN' 1000, 'SWRM' 1000; } 100% { font-variation-settings: 'INLN' 1000, 'SWRM' 0; } } Once we have created the keyframes we can add the animation to the h1 element, and that is the last piece needed in order to create the animation. h1 { font-family: "Decovar"; font-variation-settings: 'INLN' 1000, 'SWRM' 1000; animation: grow 4s linear alternate infinite; } What this demonstrates is that typically, to accomplish effects like this, the heavy lifting is done by the font. We really only need a few lines of CSS for the animation, which if you think about it, is pretty incredible. There are all sorts of interesting, creative applications of variable fonts, and a lot of incredible fonts you can make the most of. Whether you want to create that “hand-writing” effect that we often see represented with SVG, or something a little different, there are a lot of different options. Duos Writer: Hand Writing Demo of hand writing variable font, Duos Writer by Underware. Decovar: Disappearing Text See the Pen CSS-only variable font demo using Decovar Regular by Mandy Michael (@mandymichael) on CodePen. Cheee: Snow Text Snow Text Effect - Text fills up with snow and gets “heavier” at the bottom as more snow gathers. Featuring “Cheee” by OhNoTypeCo. View on Codepen. Variable Fonts, Media Queries and Customisation It’s not that these are just beautiful or cool effects, what they demonstrate is that as developers and designers we can now control the font itself and that that means is that variable fonts allow typography on the web to adapt to the flexible nature of our screens, environments and devices. We can even make use of different CSS media queries to provide more control over our designs based on environments, light contrast and colour schemes. Though the CSS Media Queries Level 5 Spec is still in draft stages, we can experiment with the prefers-color-scheme (also known as dark mode) media query right now! Dark Mode featuring Oozing Cheee by OhNoTypeCo Oozing Dark Mode Text featuring “Cheee” by OhNoTypeCo. View Demo on Codepen. The above example uses a font called “Cheee” by OhNoTypeCo and demonstrates how to make use of a CSS Transition and the prefers-color-scheme media query to transition the axis of a variable font. h1 { font-family: “Cheee" font-variation-settings: "TEMP" 0; transition: all 4s linear; } @media (prefers-color-scheme: dark) { h1 { font-variation-settings: "TEMP" 1000; } } Dark mode isn’t just about changing the colours, it’s important to consider things like weight as well. It’s the combination of the weight, colour and size of a font that determines how legible and accessible it is for the user. In the example above, I’m creating a fun effect – but more practically, dark mode allows us to modify the contrast and styles to ensure better legibility and usability in different environments. What is even more exciting about variable fonts in this context is that if developers and designers can have this finer control over our fonts to create more legible, accessible text, it also means the user has access to this as well. As a result, users that create their own stylesheets to customise the experience to their specific requirements, can now adjust the pages font weight, width or other available axis to what best suits them. Providing users with this kind of flexibility is such an incredible opportunity that we have never had before! As CSS develops, we’ll have access to different environmental and system features that allow us to take advantage of our users unique circumstances. We can start to design our typography to adjust to things like screen width - which might allow us to tweak the font weight, width, optical size or other axes to be more readable on smaller or larger screens. Where the viewport is wide we can have more detail, when its smaller in a more confined space we might look at reducing the width of the font—this helps to maintain the integrity of the design as the viewport gets smaller or, to fit text into a particular space. See the Pen CSS is Awesome - Variable fonts Edition. by Mandy Michael (@mandymichael) on CodePen. We have all been in the situation where we just need the text to be slightly narrower to fit within the available space. If you use a variable font with a width axis you can slightly modify the width to adjust to the space available, and do so in a way that the font was designed to do, rather than using things like letter spacing which doesn’t consider the kerning of the characters. Variable Fonts, JavaScript and Interactive Effects We can take these concepts even further and mix in a little JavaScript to make use of a whole suite of different interactions, events, sensors and apis. The best part about this is whether you are using device orientation, light sensors, viewport resizes, scroll events or mouse movement, the base JavaScript doesn’t really change. To demonstrate this, we’ll use a straightforward example – we’ll match our font weight to the size of our viewport – as the viewport gets smaller, the font weight gets heavier. Demo: As the viewport width changes, the weight of the text “Jello” becomes heavier. We’ll start off by setting our base values. We need to define the minimum and maximum axis values for the font weight, and the minimum and maximum event range, in this case the viewport size. Basically we’re defining the start and end points for both the font and the event. // Font weight axis range const minAxisValue = 200 const maxAxisValue = 900 // Viewport range const minEventValue = 320px const maxEventValue = 1440px Next we determine the current viewport width, which we can access with something like window.innerWidth. // Current viewport width const windowWidth = window.innerWidth Using the current viewport width value, we create the new scale for the viewport, so rather than the pixels values we convert it to a range of 0 - 0.99. const windowSize = (windowWidth - minEventValue) / (maxEventValue - minEventValue) // Outputs a value from 0 - 0.99 We then take that new viewport decimal value and use it to determine the font weight based on viewport scale. const fontWeight = windowSize * (minAxisValue - maxAxisValue) + maxAxisValue; // Outputs a value from 200 - 900 including decimal places This final value is what we use to update our CSS. You can do this however you want – lately I like to use CSS Custom Properties. This will pass the newly calculated font weight value into our CSS and update the weight as needed. // JavaScript p.style.setProperty("--weight", fontWeight); Finally, we can put all this inside a function and inside an event listener for window resize. You can modify this however you need to in order to improve performance, but in essence, this is all you need to achieve the desired outcome. function fluidAxisVariation() { // Current viewport width const windowWidth = window.innerWidth // Get new scales for viewport and font weight const viewportScale = (windowWidth - 320) / (1440 - 320); const fontWeightScale = viewportScale * (200 - 900) + 900; // Set in CSS using CSS Custom Property p.style.setProperty("--weight", fontWeightScale); } window.addEventListener("resize", fluidAxisVariation); You can apply this to single elements, or multiple. In this case, I’m changing the paragraph font weights and different rates, but also reducing the width axis of the headline so it doesn’t wrap onto multiple lines. As previously mentioned, this code can be used to create all sorts of really amazing, interesting effects. All that’s required is passing in different event and axis values. In the following example, I’m using mouse position events to change the direction and rotation of the stretchy slinky effect provided by the font “Whoa” by Scribble Tone. See the Pen Slinky Text - WHOA Variable font demo by Mandy Michael (@mandymichael) on CodePen. We can also take the dark mode/colour schemes idea further by making use of the Ambient Light Sensor to modify the font to be more legible and readable in low light environments. This effect uses Tiny by Jack Halten Fahnestock from Velvetyne Type Foundry and demonstrates how we modify our text based by query the characteristics of the user’s display or light-level, sound or other sensors. It’s only because Variable fonts give us more control over each of these elements that we can fine-tune the font characteristics to maximise the legibility, readability and overall accessibility of our website text. And while these examples might seem trivial, they are great demonstrations of the possibilities. This is a level of control over our fonts and text that is unprecedented. Using device orientation to change the scale and weight of individual characters. View on Codepen. Variable Fonts offer a new world of interactivity, usability and accessibility, but they are still a new technology. This means we have the opportunity to figure out how and what we can achieve with them. From where I stand, the possibilities are endless, so don’t be limited by what we can already do – the web is still young and there is so much for us to create. Variable fonts open up doors that never existed before and they give us an opportunity to think more creatively about how we can create better experiences for our users. At the very least, we can improve the performance of our websites, but at best, we can make more usable, more accessible, and more meaningful content - and that, is what gets me really excited about the future of web typography with variable fonts. About the author Mandy is a community organiser, speaker, and developer working as the Front End Development Manager at Seven West Media in Western Australia. She is a co-organiser and Director of Mixin Conf, and the founder and co-organiser of Fenders, a local meetup for front-end developers providing events, mentoring and support to the Perth web community. Mandy’s passion is CSS, HTML and JS and hopes to inspire that passion in others. She loves the supportive and collaborative nature of the web and strives to encourage this environment through the community groups she is a part of. Her aim is to create a community of web developers who can share, mentor, learn and grow together. More articles by Mandy Full Article Code Design typography
wit Beautiful Scrolling Experiences – Without Libraries By feedproxy.google.com Published On :: Fri, 06 Dec 2019 12:00:00 +0000 Michelle Barker appears as one of a heavenly host, coming forth with scroll in hand to pronounce an end to janky scrolljacking! Unto us a new specification is born, in the city of TimBL, and its name shall be called Scroll Snap. Sponsor: Order any Standard paperback(s) and get a surprise gift card in the box for YOU. While supplies last, from your pals at A Book Apart! One area where the web has traditionally lagged behind native platforms is the perceived “slickness” of the app experience. In part, this perception comes from the way the UI responds to user interactions – including the act of scrolling through content. Faced with the limitations of the web platform, developers frequently reach for JavaScript libraries and frameworks to alter the experience of scrolling a web page – sometimes called “scroll-jacking” – not always a good thing if implemented without due consideration of the user experience. More libraries can also lead to page bloat, and drag down a site’s performance. But with the relatively new CSS Scroll Snap specification, we have the ability to control the scrolling behaviour of a web page (to a degree) using web standards – without resorting to heavy libraries. Let’s take a look at how. Scroll Snap A user can control the scroll position of a web page in a number of ways, such as using a mouse, touch gesture or arrow keys. In contrast to a linear scrolling experience, where the rate of scroll reflects the rate of the controller, the Scroll Snap specification enables a web page to snap to specific points as the user scrolls. For this, we need a fixed-height element to act as the scroll container, and the direct children of that element will determine the snap points. To demonstrate this, here is some example HTML, which consists of a <div> containing four <section> elements: <div class="scroll-container"> <section> <h2>Section 1</h2> </section> <section> <h2>Section 2</h2> </section> <section> <h2>Section 3</h2> </section> <section> <h2>Section 4</h2> </section> </div> Scroll snapping requires the presence of two main CSS properties: scroll-snap-type and scroll-snap-align. scroll-snap-type applies to the scroll container element, and takes two keyword values. It tells the browser: The direction to snap Whether snapping is mandatory scroll-snap-align is applied to the child elements – in this case our <section>s. We also need to set a fixed height on the scroll container, and set the relevant overflow property to scroll. .scroll-container { height: 100vh; overflow-y: scroll; scroll-snap-type: y mandatory; } section { height: 100vh; scroll-snap-align: center; } In the above example, I’m setting the direction in the scroll-snap-type property to y to specify vertical snapping. The second value specifies that snapping is mandatory. This means that when the user stops scrolling their scroll position will always snap to the nearest snap point. The alternative value is proximity, which determines that the user’s scroll position will be snapped only if they stop scrolling in the proximity of a snap point. (It’s down to the browser to determine what it considers to be the proximity threshold.) If you have content of indeterminate length, which might feasibly be larger than the height of the scroll container (in this case 100vh), then using a value of mandatory can cause some content to be hidden above or below the visible area, so is not recommended. But if you know that your content will always fit within the viewport, then mandatory can produce a more consistent user experience. See the Pen Simple scroll-snap example by Michelle Barker (@michellebarker) on CodePen. In this example I’m setting both the scroll container and each of the sections to a height of 100vh, which affects the scroll experience of the entire web page. But scroll snapping can also be implemented on smaller components too. Setting scroll snapping on the x-axis (or inline axis) can produce something like a carousel effect. In this demo, you can scroll horizontally scroll through the sections: See the Pen Carousel-style scroll-snap example by Michelle Barker (@michellebarker) on CodePen. The Intersection Observer API By implementing the CSS above, our web page already has a more native-like feel to it. To improve upon this further we could add some scroll-based transitions and animations. We’ll need to employ a bit of Javascript for this, using the Intersection Observer API. This allows us to create an observer that watches for elements intersecting with the viewport, triggering a callback function when this occurs. It is more efficient than libraries that rely on continuously listening for scroll events. We can create an observer that watches for each of our scroll sections coming in and out of view: const sections = [...document.querySelectorAll('section')] const options = { rootMargin: '0px', threshold: 0.25 } const callback = (entries) => { entries.forEach((entry) => { if (entry.intersectionRatio >= 0.25) { target.classList.add("is-visible"); } else { target.classList.remove("is-visible"); } }) } const observer = new IntersectionObserver(callback, options) sections.forEach((section, index) => { observer.observe(section) }) In this example, a callback function is triggered whenever one of our sections intersects the container by 25% (using the threshold option). The callback adds a class of is-visible to the section if it is at least 25% in view when the intersection occurs (which will take effect when the element is coming into view), and removes it otherwise (when the element is moving out of view). Then we can add some CSS to transition in the content for each of those sections: section .content { opacity: 0: } section.is-visible .content { opacity: 1; transition: opacity 1000ms: } This demo shows it in action: See the Pen Scrolling with Intersection Observer by Michelle Barker (@michellebarker) on CodePen. You could, of course, implement some much more fancy transition and animation effects in CSS or JS! As an aside, it’s worth pointing out that, in practice, we shouldn’t be setting opacity: 0 as the default without considering the experience if JavaScript fails to load. In this case, the user would see no content at all! There are different ways to handle this: We could add a .no-js class to the body (which we remove on load with JS), and set default styles on it, or we could set the initial style (before transition) with JS instead of CSS. Position: sticky There’s one more CSS property that I think has the potential to aid the scroll experience, and that’s the position property. Unlike position: fixed, which locks the position of an element relative to the nearest relative ancestor and doesn’t change, position: sticky is more like a temporary lock. An element with a position value of sticky will become fixed only until it reaches the threshold of its parent, at which point it resumes relative positioning. By “sticking” some elements within scroll sections we can give the impression of them being tied to the action of scrolling between sections. It’s pretty cool that we can instruct an element to respond to it’s position within a container with CSS alone! Browser support and fallbacks The scroll-snap-type and scroll-snap-align properties are fairly well-supported. The former requires a prefix for Edge and IE, and older versions of Safari do not support axis values. In newer versions of Safari it works quite well. Intersection Observer similarly has a good level of support, with the exception of IE. By wrapping our scroll-related code in a feature query we can provide a regular scrolling experience as a fallback for users of older browsers, where accessing the content is most important. Browsers that do not support scroll-snap-type with an axis value would simply scroll as normal. @supports (scroll-snap-type: y mandatory) { .scroll-container { height: 100vh; overflow-y: scroll; scroll-snap-type: y mandatory; } section { height: 100vh; scroll-snap-align: center; } } The above code would exclude MS Edge and IE, as they don’t support axis values. If you wanted to support them you could do so using a vendor prefix, and using @supports (scroll-snap-type: mandatory) instead. Putting it all together This demo combines all three of the effects discussed in this article. Summary Spending time on scroll-based styling might seem silly or frivolous to some. But I believe it’s an important part of positioning the web as a viable alternative to native applications, keeping it open and accessible. While these new CSS features don’t offer all of the control we might expect with a fully featured JS library, they have a major advantage: simplicity and reliability. By utilising web standards where possible, we can have the best of both worlds: Slick and eye-catching sites that satisfy clients’ expectations, with the added benefit of better performance for users. About the author Michelle is a Lead Front End Developer at Bristol web agency Atomic Smash, author of front-end blog CSS { In Real Life }, and a Mozilla Tech Speaker. She has written articles for CSS Tricks, Smashing Magazine, and Web Designer Magazine, to name a few. She enjoys experimenting with new CSS features and helping others learn about them. More articles by Michelle Full Article UX css
wit It All Starts with a Humble <textarea> By feedproxy.google.com Published On :: Sun, 08 Dec 2019 12:00:00 +0000 Andy Bell rings out a fresh call in support of the timeless concept of progressive enhancement. What does it mean to build a modern JavaScript-focussed web experience that still works well if part of the stack isn’t supported or fails? Andy shows us how that might be done. Those that know me well know that I make a lot of side projects. I most definitely make too many, but there’s one really useful thing about making lots of side projects: it allows me to experiment in a low-risk setting. Side projects also allow me to accidentally create a context where I can demonstrate a really affective, long-running methodology for building on the web: progressive enhancement. That context is a little Progressive Web App that I’m tinkering with called Jotter. It’s incredibly simple, but under the hood, there’s a really solid experience built on top of a minimum viable experience which after reading this article, you’ll hopefully apply this methodology to your own work. What is a minimum viable experience? The key to progressive enhancement is distilling the user experience to its lowest possible technical solution and then building on it to improve the user experience. In the context of Jotter, that is a humble <textarea> element. That humble <textarea> is our minimum viable experience. Let me show you how it’s built up, progressively real quick. If you disable CSS and JavaScript, you get this: This result is great because I know that regardless of what happens, the user can do what they needed to do when the loaded Jotter in their browser: take some notes. That’s our minimum viable experience, completed with a few lines of code that work in every single browser—even very old browsers. Don’t you just love good ol’ HTML? Now it’s time to enhance that minimum viable experience, progressively. It’s a good idea to do that in smaller steps rather than just provide a 0% experience or a 100% experience, which is the approach that’s often favoured by JavaScript framework enthusiasts. I think that process is counter-intuitive to the web, though, so building up from a minimum viable experience is the optimal way to go, in my opinion. Understanding how a minimum viable experience works can be a bit tough, admittedly, so I like to use a the following diagram to explain the process: Let me break down this diagram for both folks who can and can’t see it. On the top row, there’s four stages of a broken-up car, starting with just a wheel, all the way up to a fully functioning car. The car enhances only in a way that it is still mostly useless until it gets to its final form when the person is finally happy. On the second row, instead of building a car, we start with a skateboard which immediately does the job of getting the person from point A to point B. This enhances to a Micro Scooter and then to a Push Bike. Its final form is a fancy looking Motor Scooter. I choose that instead of a car deliberately because generally, when you progressively enhance a project, it turns out to be way simpler and lighter than a project that was built without progressive enhancement in mind. Now that we know what a minimum viable experience is and how it works, let’s apply this methodology to Jotter! Add some CSS The first enhancement is CSS. Jotter has a very simple design, which is mostly a full height <textarea> with a little sidebar. A flexbox-based, auto-stacking layout, inspired by a layout called The Sidebar is used and we’re good to go. Based on the diagram from earlier, we can comfortably say we’re in Skateboard territory now. Add some JavaScript We’ve got styles now, so let’s enhance the experience again. A user can currently load up the site and take notes. If the CSS loads, it’ll be a more pleasant experience, but if they refresh their browser, they’re going to lose all of their work. We can fix that by adding some local storage into the mix. The functionality flow is pretty straightforward. As a user inputs content, the JavaScript listens to an input event and pushes the content of the <textarea> into localStorage. If we then set that localStorage data to populate the <textarea> on load, that user’s experience is suddenly enhanced because they can’t lose their work by accidentally refreshing. The JavaScript is incredibly light, too: const textArea = document.querySelector('textarea'); const storageKey = 'text'; const init = () => { textArea.value = localStorage.getItem(storageKey); textArea.addEventListener('input', () => { localStorage.setItem(storageKey, textArea.value); }); } init(); In around 13 lines of code (which you can see a working demo here), we’ve been able to enhance the user’s experience considerably, and if we think back to our diagram from earlier, we are very much in Micro Scooter territory now. Making it a PWA We’re in really good shape now, so let’s turn Jotter into a Motor Scooter and make this thing work offline as an installable Progressive Web App (PWA). Making a PWA is really achievable and Google have even produced a handy checklist to help you get going. You can also get guidance from a Lighthouse audit. For this little app, all we need is a manifest and a Service Worker to cache assets and serve them offline for us if needed. The Service Worker is actually pretty slim, so here it is in its entirety: const VERSION = '0.1.3'; const CACHE_KEYS = { MAIN: `main-${VERSION}` }; // URLS that we want to be cached when the worker is installed const PRE_CACHE_URLS = ['/', '/css/global.css', '/js/app.js', '/js/components/content.js']; /** * Takes an array of strings and puts them in a named cache store * * @param {String} cacheName * @param {Array} items=[] */ const addItemsToCache = function(cacheName, items = []) { caches.open(cacheName).then(cache => cache.addAll(items)); }; self.addEventListener('install', evt => { self.skipWaiting(); addItemsToCache(CACHE_KEYS.MAIN, PRE_CACHE_URLS); }); self.addEventListener('activate', evt => { // Look for any old caches that don't match our set and clear them out evt.waitUntil( caches .keys() .then(cacheNames => { return cacheNames.filter(item => !Object.values(CACHE_KEYS).includes(item)); }) .then(itemsToDelete => { return Promise.all( itemsToDelete.map(item => { return caches.delete(item); }) ); }) .then(() => self.clients.claim()) ); }); self.addEventListener('fetch', evt => { evt.respondWith( caches.match(evt.request).then(cachedResponse => { // Item found in cache so return if (cachedResponse) { return cachedResponse; } // Nothing found so load up the request from the network return caches.open(CACHE_KEYS.MAIN).then(cache => { return fetch(evt.request) .then(response => { // Put the new response in cache and return it return cache.put(evt.request, response.clone()).then(() => { return response; }); }) .catch(ex => { return; }); }); }) ); }); What the Service Worker does here is pre-cache our core assets that we define in PRE_CACHE_URLS. Then, for each fetch event which is called per request, it’ll try to fulfil the request from cache first. If it can’t do that, it’ll load the remote request for us. With this setup, we achieve two things: We get offline support because we stick our critical assets in cache immediately so they will be accessible offline Once those critical assets and any other requested assets are cached, the app will run faster by default Importantly now, because we have a manifest, some shortcut icons and a Service Worker that gives us offline support, we have a fully installable PWA! Wrapping up I hope with this simplified example you can see how approaching web design and development with a progressive enhancement approach, everyone gets an acceptable experience instead of those who are lucky enough to get every aspect of the page at the right time. Jotter is very much live and in the process of being enhanced further, which you can see on its little in-app roadmap, so go ahead and play around with it. Before you know it, it’ll be a car itself, but remember: it’ll always start as a humble little <textarea>. About the author Andy Bell is an independent designer and front-end developer who’s trying to make everyone’s experience on the web better with a focus on progressive enhancement and accessibility. More articles by Andy Full Article UX craft
wit European socialism: a concise history with documents / William Smaldone By library.mit.edu Published On :: Sun, 15 Mar 2020 08:09:28 EDT Dewey Library - HX236.5.S6293 2020 Full Article
wit Automation and utopia: human flourishing in a world without work / John Danaher By library.mit.edu Published On :: Sun, 29 Mar 2020 07:44:51 EDT Online Resource Full Article
wit Militarization: a reader / Roberto J. González, Hugh Gusterson, Gustaaf Houtman, editors ; in collaboration with Catherine Besteman, Andrew Bickford, Catherine Lutz, Katherine T. McCaffrey, Austin Miller, David H. Price, David Vine By library.mit.edu Published On :: Sun, 5 Apr 2020 07:47:23 EDT Dewey Library - U21.2.M558 2019 Full Article
wit Votes that count and voters who don't: how journalists sideline electoral participation (without even knowing it) / Sharon E. Jarvis and Soo-Hye Han By library.mit.edu Published On :: Sun, 26 Apr 2020 09:04:30 EDT Dewey Library - JK1965.J37 2018 Full Article
wit Shopian killings: Separatist leader Yasin Malik along with other JKLF leaders detained By archive.indianexpress.com Published On :: Sun, 22 Sep 2013 13:59:41 GMT Leaders were going to Shopian with relief material, including foodgrains and medicines. Full Article
wit Tense Meerut erupts, six hurt in clash with police at banned mahapanchayat By archive.indianexpress.com Published On :: Mon, 30 Sep 2013 14:53:21 GMT Angry mob, started pelting stones and damaged nine vehicles of police and administration. Full Article
wit Law catches up with Lalu, faces at least 3 years in jail in fodder scam case By archive.indianexpress.com Published On :: Mon, 30 Sep 2013 15:44:14 GMT RJD chief Lalu Prasad would also automatically cease to be a Lok Sabha member if sentenced to over two years. Full Article
wit Seven suspected SIMI operatives flee from MP jail with rifles By archive.indianexpress.com Published On :: Tue, 01 Oct 2013 05:02:37 GMT The prisoners were successful in fleeing after stabbing two security guards. Full Article
wit Jammu terror attack: Govt admits 'lapses' in dealing with infiltration information By archive.indianexpress.com Published On :: Thu, 10 Oct 2013 14:15:56 GMT Shinde said his Ministry has sought a report from the JandK govt on the possible lapses. Full Article
wit Assembly polls: With twisted truth, flexible logic, yoga guru Ramdev goes after Cong By archive.indianexpress.com Published On :: Thu, 10 Oct 2013 19:48:10 GMT At his yoga camps, the guru has offered no excuses while seeking votes for the BJP. Full Article
wit Bihar witnesses average rainfall of 125.3 mm due to Phailin By archive.indianexpress.com Published On :: Tue, 15 Oct 2013 09:57:11 GMT Bhojpur, Siwan and Patna districts experienced the heaviest rainfall as aftermath of cyclone Phailin. Full Article
wit People born with a silver spoon cannot understand what poverty means: Modi By archive.indianexpress.com Published On :: Sat, 19 Oct 2013 11:04:57 GMT The BJP PM candidate questioned the silence of Manmohan and Sonia over rising prices. Full Article
wit BSF lodges protest with Pakistan over ceasefire violations By archive.indianexpress.com Published On :: Sat, 19 Oct 2013 21:12:00 GMT BSF troops observed suspicious movement along IB near Kulian-Suchetpur outpost. Full Article
wit Homeguard jawans clash with policemen By archive.indianexpress.com Published On :: Mon, 21 Oct 2013 11:05:02 GMT Jawans attacked policemen deployed there, damaged a number of vehicles parked in the area. Full Article
wit KNPP unit 1 synchronised with southern power grid, generates 160 MW power By archive.indianexpress.com Published On :: Tue, 22 Oct 2013 13:24:25 GMT The synchronisation coincided with Prime Minister Manmohan Singh's three-day visit to Russia. Full Article
wit Bihar midday-meal tragedy: Principal, husband charged with murder in chargesheet By archive.indianexpress.com Published On :: Tue, 22 Oct 2013 15:36:33 GMT With as many as 23 students dead, all minors, both accused are presently in a jail in Chapra. Full Article
wit With GJM leaders in TMC fold, Mamata looks to win uphill battle By archive.indianexpress.com Published On :: Sat, 26 Oct 2013 20:19:16 GMT Trinamool Congress has opened four party offices in Darjeeling, claims to have '40,000 members'' Full Article
wit ATM attack: Karnataka govt to come out with guidelines on security By archive.indianexpress.com Published On :: Tue, 26 Nov 2013 09:41:39 GMT Out of the 2,500 ATMs in the city, 600 are unmanned. Full Article
wit Tehelka case: Tejpal Shares cell with two murder accused, five others on first night By archive.indianexpress.com Published On :: Sun, 01 Dec 2013 16:28:15 GMT Tejpal entered the lock-up around 2.30 am, after his check-up at the Goa Medical College Hospital. Full Article
wit Army opposes Pakistan's demand for troop withdrawal from Siachen Glacier By archive.indianexpress.com Published On :: Thu, 05 Dec 2013 15:05:38 GMT Army officials said that they would not like to move out from the glacier as it holds strategic importance. Full Article
wit High Court to Himachal govt: Shift 'officers with doubtful integrity' in 3 weeks By archive.indianexpress.com Published On :: Fri, 06 Dec 2013 16:12:01 GMT The court also asked the government for a compliance report before December 27. Full Article
wit Twitter reaction: Disappointment over SC's 'gay sex illegal' order By archive.indianexpress.com Published On :: Wed, 11 Dec 2013 06:27:46 GMT Supreme Court's verdict stating that Gay Sex is illegal has triggered a debate. Full Article
wit Diplomat arrest case: India softens stand, says it will find a solution with the US By archive.indianexpress.com Published On :: Fri, 20 Dec 2013 15:00:40 GMT Meanwhile, US has refused to apologise and drop visa fraud charges against Khobragade. Full Article
wit I wonder if I will be able to ever reunite with my husband, my kids. I miss them: Devyani By archive.indianexpress.com Published On :: Sun, 12 Jan 2014 01:25:17 GMT Controversy and its fallout were, Devyani said, more a personal than a professional loss for her. Full Article
wit Computational fluid dynamics for engineers [electronic resource] : from panel to Navier-Stokes methods with computer programs / Tuncer Cebeci [and others] By darius.uleth.ca Published On :: Long Beach, Calif. : Horizons Pub. ; Berlin : Springer, 2005 Full Article
wit Computer algebra and geometric algebra with applications [electronic resource] : 6th international workshop, IWMM 2004, Shanghai, China, May 19-21, 2004 and international workshop, GIAE 2004, Xian, China, May 24-28, 2004 : revised selected papers / Hongbo By darius.uleth.ca Published On :: Berlin ; New York : Springer, [2005] Full Article
wit Dynamical systems with applications using mathematica [electronic resource] / Stephen Lynch By darius.uleth.ca Published On :: Boston, Mass. : Birkhäuser ; [2007] Full Article
wit Discrete multivariate analysis [electronic resource] / Yvonne M. Bishop, Stephen Fienberg, Paul W. Holland ; with the collaboration of Richard J. Light and Frederick Mosteller By darius.uleth.ca Published On :: New York : Springer, [2007] Full Article
wit Differential geometry of curves and surfaces [electronic resource] : a concise guide / Victor Andreevich Toponogov ; with the editorial assistance of Vladimir Y. Rovenski By darius.uleth.ca Published On :: Boston : Birkhäuser, [2006] Full Article
wit The great transition : shifting from fossil fuels to solar and wind energy / Lester R. Brown ; with Janet Larsen, J. Matthew Roney, and Emily E. Adams, Earth Policy Institute By prospero.murdoch.edu.au Published On :: Brown, Lester R. (Lester Russell), 1934- author Full Article
wit Odor thresholds for chemicals with established health standards / edited by Sharon S. Murnane, Alex H. Lehocky, Patrick D. Owens By prospero.murdoch.edu.au Published On :: Full Article
wit Essential environment : the science behind the stories / Jay Withgott, Matthew Laposata By prospero.murdoch.edu.au Published On :: Withgott, Jay, author Full Article
wit Climate without nature : a critical anthropology of the anthropocene / Andrew M. Bauer (Stanford University), Mona Bhan (DePauw University) By prospero.murdoch.edu.au Published On :: Bauer, Andrew M., author Full Article
wit Why big fierce animals are rare : an ecologist's perspective / Paul Colinvaux ; with a new foreword by Cristina Eisenberg By prospero.murdoch.edu.au Published On :: Colinvaux, Paul, 1930- author Full Article
wit Biodiversity 1992 : the status of the Earth's living natural resources : a report / prepared by the World Conservation Monitoring Centre ; in collaboration with the World Resources Institute, the United Nations Environment Programme, IUCN-World Conser By prospero.murdoch.edu.au Published On :: World Conservation Monitoring Centre Full Article
wit Environmental impact assessment in the Arctic : a guide to best practice / Timo Koivurova, Pamela Lesser with Sonja Bickford, Paula Kankaanpää, Marina Nenasheva By prospero.murdoch.edu.au Published On :: Koivurova, Timo, author Full Article
wit What we know about climate change / Kerry Emanuel ; with a new foreword by Bob Inglis By prospero.murdoch.edu.au Published On :: Emanuel, Kerry A., 1955- author Full Article
wit The end of ice : bearing witness and finding meaning in the path of climate disruption / Dahr Jamail By prospero.murdoch.edu.au Published On :: Jamail, Dahr, author Full Article
wit Designing climate solutions : a policy guide for low-carbon energy / by Hal Harvey, with Robbie Orvis, Jeffrey Rissman, Michael O'Boyle, Chris Busch, and Sonia Aggarwal By prospero.murdoch.edu.au Published On :: Harvey, Hal, author Full Article
wit Environmental expertise : connecting science, policy, and society / [edited by] Esther Turnhout, Willemijn Tuinstra and Willem Halffman ; with contribution from Silke Beck [and 11 more] By prospero.murdoch.edu.au Published On :: Full Article
wit Asia-Pacific progress in sustainable energy : a global tracking framework 2017 regional assessment report / Kim Roseberry ; with the support of Remife De Guzman By prospero.murdoch.edu.au Published On :: Roseberry, Kimberly, author Full Article
wit Nintendo seen extending profit streak as housebound consumers switch on By www.business-standard.com Published On :: Thu, 30 Apr 2020 13:18:00 +0530 Nintendo "could sell multiples of what is in the inventory at the moment", said Serkan Toto, founder of game industry consultancy Kantan Games Full Article