all

Vesicle adhesion in the electrostatic strong-coupling regime studied by time-resolved small-angle X-ray scattering

Soft Matter, 2020, 16,4142-4154
DOI: 10.1039/D0SM00259C, Paper
Open Access
Karlo Komorowski, Jannis Schaeper, Michael Sztucki, Lewis Sharpnack, Gerrit Brehm, Sarah Köster, Tim Salditt
We have used time-resolved small-angle X-ray scattering (SAXS) to study the adhesion of lipid vesicles in the electrostatic strong-coupling regime induced by divalent ions.
The content of this RSS Feed (c) The Royal Society of Chemistry




all

Wall entrapment of peritrichous bacteria: A mesoscale hydrodynamics simulation study

Soft Matter, 2020, Accepted Manuscript
DOI: 10.1039/D0SM00571A, Paper
S. Mahdiyeh Mousavi, Gerhard Gompper, Roland G. Winkler
Microswimmers such as E. Coli bacteria accumulate and exhibit an intriguing dynamics near walls, governed by hydrodynamic and steric interactions. Insight into the underlying mechanisms and predominant interactions demand a...
The content of this RSS Feed (c) The Royal Society of Chemistry




all

Copper, Brass, and Bronze Surfaces: A Guide to Alloys, Finishes, Fabrication, and Maintenance in Architecture and Art


 

A FULL-COLOR GUIDE FOR ARCHITECTS AND DESIGN PROFESSIONALS TO THE SELECTION AND APPLICATION OF COPPER, BRASS, AND BRONZE

Copper, Brass, and Bronze Surfaces, third in Zahner's Architectural Metals Series, provides a comprehensive and authoritative treatment of copper, brass, and bronze applications in architecture and art. If offers architecture and design professionals the information they need to ensure proper maintenance and fabrication techniques



Read More...





all

Cine industry welcomes govt.’s decision allowing post-production work

The announcement by the Tamil Nadu government allowing post-production work on films and television projects to resume from May 11 was welcomed by the




all

Coronavirus | Tamil Nadu tally goes past 6,000 with 600 new cases

Chennai adds 399 patients to its total




all

Madras High Court orders closure of all Tasmac liquor shops in Tamil Nadu

The Madras High Court on Friday directed the State government to close all 3,850 liquor shops run by the Tamil Nadu State Marketing Corporation (Tasma




all

[ASAP] Low-Threshold Lasing up to 360 K in All-Dielectric Subwavelength-Nanowire Nanocavities

ACS Photonics
DOI: 10.1021/acsphotonics.0c00166




all

[ASAP] Ultrafast Dynamics of Optically Induced Heat Gratings in Metals

ACS Photonics
DOI: 10.1021/acsphotonics.0c00224




all

[ASAP] Goodbye Juan José Sáenz (1960–2020): A Bright Scientific Mind, an Unusually Prolific Friend, and a Family Man

ACS Photonics
DOI: 10.1021/acsphotonics.0c00526




all

[ASAP] Exciton-Polaritons with Magnetic and Electric Character in All-Dielectric Metasurfaces

ACS Photonics
DOI: 10.1021/acsphotonics.0c00063




all

[ASAP] Strain-Correlated Localized Exciton Energy in Atomically Thin Semiconductors

ACS Photonics
DOI: 10.1021/acsphotonics.0c00626




all

It All Starts with a Humble <textarea>

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:

  1. We get offline support because we stick our critical assets in cache immediately so they will be accessible offline
  2. 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




all

MANHATTAN COM. ACCESS, ET AL. v. HALLECK, DEEDEE, ET AL.. Decided 06/17/2019




all

Reluctant warriors: Germany, Japan, and their U.S. alliance dilemma / Alexandra Sakaki, Hanns W. Maull, Kerstin Lukner, Ellis S. Krauss, Thomas U. Berger

Dewey Library - UA710.S135 2020




all

Red state blues: how the conservative revolution stalled in the states / Matt Grossmann

Dewey Library - JK2356.G76 2019




all

Homeland security and public safety: research, applications and standards / editors, Philip J. Mattson and Jennifer L. Marshall

Barker Library - UA23.H538 2019




all

Socialist Practice: Histories and Theories / Victor Wallis

Online Resource




all

The politics of recall elections Yanina Welp, Laurence Whitehead, editors

Online Resource




all

Tyranny comes home: the domestic fate of U.S. militarism / Christopher J. Coyne and Abigail R. Hall

Dewey Library - UA23.C685 2018




all

The end of strategic stability?: Nuclear weapons and the challenge of regional rivalries / Lawrence Rubin and Adam N. Stulberg, editors

Dewey Library - U263.E557 2018




all

Radar energy warfare and the challenges of stealth technology / Bahman Zohuri

Online Resource




all

Lord Cornwallis is dead: the struggle for democracy in the United States and India / Nico Slate

Dewey Library - JC423.G638 2019




all

Responsible parties: saving democracy from itself / Frances McCall Rosenbluth and Ian Shapiro

Dewey Library - JF2051.R67 2018




all

Framing referendum campaigns in the news / Marina Dekavalla

Dewey Library - JF497.G7 D45 2018




all

Legislative hardball: the house freedom caucus and the power of threat-making in Congress / Matthew N. Green

Dewey Library - JK1319.G744 2019




all

Poll power: the Voter Education Project and the movement for the ballot in the American South / Evan Faulkenbury

Dewey Library - JK2160.F38 2019




all

The three Ps of liberty: pragmatism, pluralism, and polycentricity / Allen Mendenhall

Online Resource




all

Praetorian: the rise and fall of Rome's imperial bodyguard / Guy de la Bedoyere

Hayden Library - U35.D45 2018




all

Democracies and authoritarian regimes / Andrea Kendall-Taylor, Natasha Lindstaedt, Erica Frantz

Dewey Library - JC348.K46 2019




all

Exploring political legacies Stephen Farrall, Colin Hay, Emily Gray

Online Resource




all

After Bhopal, BJP to charge Rs 10 from its workers for Modi's Bangalore rally

Earlier BJP party workers were charged Rs 5 for attending Modi's Bhopal rally.




all

Nairobi mall attack brings back memories of 26/11 strike

Shot in the right leg, Devika, was the youngest witness in the trial of Ajmal Kasab.




all

Venkaiah Naidu: No proposal on any poll alliance in Andhra Pradesh

"BJP is going ahead with its plan to contest 42 LS seats and 294 assembly seats in AP".




all

Sidhu calls off fast-unto-death over funds for Amritsar after an assurance from Badal

Meanwhile, the opposition charged Sidhu with spending too much time on TV and cricket commentary.




all

Weeks after Muzaffarnagar violence, women allege rape in written complaints

The Fugana police station has registered two cases of rape and one case of molestation.




all

Mumbai building collapse: Death toll climbs to 61, rescue operation to be called off soon

The five-storey building, owned by the BMC had collapsed early morning on Friday.




all

Nitin Gadkari seeks all-party support on Vidarbha statehood issue

Separate state of Vidarbha can be formed if all parties come together, Gadkari said.




all

Uttarakhand: Homeless in Kedarnath valley to boycott 2014 polls

Kedarnath valley residents threatened to boycott polls if they are not relocated soon.




all

NaMo tea, banners entice Patna to rally

The ruling JD(U), however, is not impressed with such "cheap theatrics".




all

United Andhra leaders call for bandh today as Cabinet clears Telangana formation

Congress MPs, MLAs from Seemandhra say Cabinet move was hasty.




all

Telangana fallout: Union Minister Pallam Raju to quit

Raju will meet the PM and submit his resignation in protest against Telangana formation.




all

Small-time actress held for threatening and abusing cops

Anjum Nayar was arrested and booked under IPC sections 294, 504 and 506.




all

Mayawati has captured Dalit movement, doesn't allow others to rise: Rahul Gandhi

Rahul urged Congress to "systematically" prepare Dalit leadership at every level.




all

Telangana fallout: Digvijay urges Seemandhra people to resume work, draw salary

Due to protests, people of Seemandhra are facing 'unnecessary hardships', Digvijay said.




all

Jagan taken into preventive custody, sent to hospital amid fears of falling health

YSR Congress chief was fasting in protest against the decision to bifurcate Andhra Pradesh.




all

President Pranab curtails Bihar visit by a day due to Narendra Modi's rally

The clash between the President's visit and Modi's rally had become an issue between BJP and JD(U).




all

Bihar: Muslims offer chadar for success of Narendra Modi's rally

Bihar BJP minority cell Prez Khalid Rahman said that they offered prayer for the success of Modi's rally.




all

Bihar witnesses average rainfall of 125.3 mm due to Phailin

Bhojpur, Siwan and Patna districts experienced the heaviest rainfall as aftermath of cyclone Phailin.




all

Ahead of VHP's 'Sankalp Diwas' rally, 350 activists arrested

VHP's 'Sankalp Diwas' rally in Ayodhya has been banned by the state government.