& It All Starts with a Humble <textarea> By 24ways.org 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
& Sneakerheads, your shoes are worth more than you think By www.thehindu.com Published On :: Fri, 11 Nov 2022 20:54:39 +0530 Festivals, custom designs and limited edition pieces fuel India’s sneaker subculture. How do you curate a sneaker collection that increases in value and boosts your social currency? Full Article Life & Style
& Eggs à la dad By www.thehindu.com Published On :: Sat, 26 Mar 2016 16:07:38 +0530 Full Article Fitness
& Editorial. Gold duty cut can help exporters and consumers if cost savings are passed on By www.thehindubusinessline.com Published On :: Thu, 25 Jul 2024 22:07:36 +0530 The customs duty cut on gold, silver and platinum will certainly bring down production costs in this thin-margin industry, helping Indian exports gain competitive edge in the global market Full Article Editorial
& Editorial. SEBI right in trying to restrict retail F&O punts By www.thehindubusinessline.com Published On :: Thu, 01 Aug 2024 21:34:12 +0530 These punts result in flight of capital too, as the counter-parties are often global algo-trading and high frequency shops Full Article Editorial
& Editorial. BJP’s remarkable show in Haryana; NC wrests J&K By www.thehindubusinessline.com Published On :: Tue, 08 Oct 2024 21:24:17 +0530 BJP wins in Haryana for third successive time Full Article Editorial
& PNB Housing Finance Q2 net up 22.7 per cent at ₹470 crore By www.thehindubusinessline.com Published On :: Thu, 24 Oct 2024 21:18:21 +0530 The portfolio asset quality continues to improve with Gross NPA at 1.24 percent as on end September 2024 Full Article Money & Banking
& PNB Housing Finance to expand corporate lending portfolio to boost margins, says MD & CEO Kousgi By www.thehindubusinessline.com Published On :: Fri, 25 Oct 2024 19:20:40 +0530 Confident of sustaining Q2 bottomline growth performance in remaining quarters this fiscal Full Article Money & Banking
& Sundaram Home Finance reports lower net profit in Q2 & H1 By www.thehindubusinessline.com Published On :: Wed, 30 Oct 2024 18:42:07 +0530 The company’s newly launched Emerging Business segment, focusing on small business loans and affordable housing finance, disbursed Rs.₹42 crore during the second quarter of 2024 Full Article Money & Banking
& Punjab & Sind Bank launches e-bank guarantee facility By www.thehindubusinessline.com Published On :: Sun, 03 Nov 2024 17:41:06 +0530 This new facility replaces paper-based BG issuance process with stamping and signatures Full Article Money & Banking
& Manappuram Finance post 2% rise in Q2 net profit at ₹572 crore By www.thehindubusinessline.com Published On :: Wed, 06 Nov 2024 12:57:45 +0530 Total consolidated operating income for the quarter was ₹2,633.1 crore, a 22.1 per cent increase from the same quarter last year Full Article Money & Banking
& Poundmaker's Lodge : A Healing Place / directed by: Alanis Obomsawin ; produced by: Andy Thomson, Alanis Obomsawin, Marrin Canell, Robert Verrall ; production agency: National Film Board of Canada (Montreal) By darius.uleth.ca Published On :: Montreal : National Film Board of Canada, 2013 Full Article
& My Little Underground / directed by: Élise Simard ; produced by: David Verrall, Roddy McManus, Michael Fukushima ; production agency: National Film Board of Canada (Montreal) By darius.uleth.ca Published On :: Montreal : National Film Board of Canada, 2012 Full Article
& Donna's Story / directed by: Doug Cuthand ; produced by: Graydon McCrea, Jerry Krepakevich ; production agency: National Film Board of Canada (Montreal) By darius.uleth.ca Published On :: Montreal : National Film Board of Canada, 2011 Full Article
& Topics : Aboriginals & Drugs / directed by: Nettie Wild ; production agencies: British Columbia Centre for Disease Control. Street Nurse Program (Vancouver), National Film Board of Canada (Montreal) By darius.uleth.ca Published On :: Montreal : National Film Board of Canada, 2019 Full Article
& The Sniffing Bear / directed by: Co Hoedeman ; produced by: Thérèse Descary ; production agency: National Film Board of Canada (Montreal) By darius.uleth.ca Published On :: Montreal : National Film Board of Canada, 2008 Full Article
& Bevel Up : Chapter 3 - Linda / directed by: Nettie Wild ; produced by: Julie Huguet, André Picard ; production agencies: British Columbia Centre for Disease Control. Street Nurse Program (Vancouver), National Film Board of Canada (Montreal) By darius.uleth.ca Published On :: Montreal : National Film Board of Canada, 2019 Full Article
& Bevel Up : Chapter 4 - Becky & Liz / directed by: Nettie Wild ; produced by: Julie Huguet, André Picard ; production agencies: British Columbia Centre for Disease Control. Street Nurse Program (Vancouver), National Film Board of Canada (Montreal) By darius.uleth.ca Published On :: Montreal : National Film Board of Canada, 2019 Full Article
& Bevel Up : Chapter 5 - Street Youth / directed by: Nettie Wild ; produced by: Julie Huguet, André Picard ; production agencies: British Columbia Centre for Disease Control. Street Nurse Program (Vancouver), National Film Board of Canada (Montreal) By darius.uleth.ca Published On :: Montreal : National Film Board of Canada, 2019 Full Article
& Bevel Up : Chapter 6 - Lee / directed by: Nettie Wild ; produced by: Julie Huguet, André Picard ; production agencies: British Columbia Centre for Disease Control. Street Nurse Program (Vancouver), National Film Board of Canada (Montreal) By darius.uleth.ca Published On :: Montreal : National Film Board of Canada, 2019 Full Article
& Bevel Up : Chapter 7 - Long Tran / directed by: Nettie Wild ; produced by: Julie Huguet, André Picard ; production agencies: British Columbia Centre for Disease Control. Street Nurse Program (Vancouver), National Film Board of Canada (Montreal) By darius.uleth.ca Published On :: Montreal : National Film Board of Canada, 2019 Full Article
& Bevel Up : Chapter 8 - Conclusion / directed by: Nettie Wild ; produced by: Julie Huguet, André Picard ; production agencies: British Columbia Centre for Disease Control. Street Nurse Program (Vancouver), National Film Board of Canada (Montreal) By darius.uleth.ca Published On :: Montreal : National Film Board of Canada, 2019 Full Article
& Topics : Drugs & the Brain / directed by: Nettie Wild ; production agencies: National Film Board of Canada (Montreal), British Columbia Centre for Disease Control. Street Nurse Program (Vancouver) By darius.uleth.ca Published On :: Montreal : National Film Board of Canada, 2019 Full Article
& Topics : Mental Health & Drugs / directed by: Nettie Wild ; production agencies: British Columbia Centre for Disease Control. Street Nurse Program (Vancouver), National Film Board of Canada (Montreal) By darius.uleth.ca Published On :: Montreal : National Film Board of Canada, 2019 Full Article
& Reflections on Practice : Ethics & Practice / directed by: Nettie Wild ; production agencies: British Columbia Centre for Disease Control. Street Nurse Program (Vancouver), National Film Board of Canada (Montreal) By darius.uleth.ca Published On :: Montreal : National Film Board of Canada, 2019 Full Article
& Topics : Hospitals & Acute Care / directed by: Nettie Wild ; production agencies: British Columbia Centre for Disease Control. Street Nurse Program (Vancouver), National Film Board of Canada (Montreal) By darius.uleth.ca Published On :: Montreal : National Film Board of Canada, 2019 Full Article
& Topics : Pregnancy & Drugs / directed by: Nettie Wild ; production agencies: British Columbia Centre for Disease Control. Street Nurse Program (Vancouver), National Film Board of Canada (Montreal) By darius.uleth.ca Published On :: Montreal : National Film Board of Canada, 2019 Full Article
& Bevel Up : Chapter 1 - Opening / directed by: Nettie Wild ; produced by: Julie Huguet, André Picard ; production agencies: British Columbia Centre for Disease Control. Street Nurse Program (Vancouver), Office national du film du Canada (Montreal) By darius.uleth.ca Published On :: Montreal : National Film Board of Canada, 2019 Full Article
& Bevel Up : Chapter 2 - Wheels & Barry / directed by: Nettie Wild ; produced by: Julie Huguet, André Picard ; production agencies: British Columbia Centre for Disease Control. Street Nurse Program (Vancouver), National Film Board of Canada (Montre By darius.uleth.ca Published On :: Montreal : National Film Board of Canada, 2019 Full Article
& Reflections on Practice : Sex Work & Health / directed by: Nettie Wild ; production agencies: British Columbia Centre for Disease Control. Street Nurse Program (Vancouver), National Film Board of Canada (Montreal) By darius.uleth.ca Published On :: Montreal : National Film Board of Canada, 2019 Full Article
& Topics : Sex Work & Drugs / directed by: Nettie Wild ; production agencies: National Film Board of Canada (Montreal), British Columbia Centre for Disease Control. Street Nurse Program (Vancouver) By darius.uleth.ca Published On :: Montreal : National Film Board of Canada, 2019 Full Article
& Topics : Sex, Drugs & Gender / directed by: Nettie Wild ; production agencies: British Columbia Centre for Disease Control. Street Nurse Program (Vancouver), National Film Board of Canada (Montreal) By darius.uleth.ca Published On :: Montreal : National Film Board of Canada, 2019 Full Article
& Topics : Peers & Natural Helpers / directed by: Nettie Wild ; production agencies: British Columbia Centre for Disease Control. Street Nurse Program (Vancouver), National Film Board of Canada (Montreal) By darius.uleth.ca Published On :: Montreal : National Film Board of Canada, 2019 Full Article
& Naked Island - Sober / directed by: Élise Simard ; produced by: Michael Fukushima, Jelena Popovic, Maral Mohammadian ; production agency: National Film Board of Canada (Montreal) By darius.uleth.ca Published On :: Montreal : National Film Board of Canada, 2017 Full Article
& Kímmapiiyipitssini : The Meaning of Empathy / directed by: Elle-Máijá Tailfeathers ; produced by: Elle-Máijá Tailfeathers, David Christensen, lori lozinski, David Christensen ; production agencies: Seen Through Woman Productions ( By darius.uleth.ca Published On :: Montreal : National Film Board of Canada, 2022 Full Article
& Gold jewellery entrepreneurs meet held in Vijayawada By www.thehindu.com Published On :: Sat, 09 Nov 2024 18:26:22 +0530 Full Article Andhra Pradesh
& Drugs menace inherited from previous ‘corrupt and criminal’ regime, says A.P. Deputy CM Pawan Kalyan By www.thehindu.com Published On :: Sat, 09 Nov 2024 18:34:51 +0530 Tagging his post on X to the office of the Union Home Minister, Pawan Kalyan calls for a special focus to check drug mafia, ganja cultivation, and related criminal activities in the State Full Article Andhra Pradesh
& MP meets Governor, seeks permission to develop cricket grounds By www.thehindu.com Published On :: Sat, 09 Nov 2024 18:54:35 +0530 Full Article Andhra Pradesh
& Undeclared emergency prevailing in A.P., says former AAG Sudhakar Reddy By www.thehindu.com Published On :: Sun, 10 Nov 2024 09:28:20 +0530 Sudhakar Reddy alleged that the State had also been crushing the Opposition by getting the police into the act against all norms Full Article Andhra Pradesh
& Andhra Pradesh Budget highlights: ₹29,909 crore for school education, ₹16,739 crore for Panchayat Raj and Rural Development for FY25 By www.thehindu.com Published On :: Mon, 11 Nov 2024 10:29:00 +0530 The Andhra Pradesh Government presented its Budget with an outlay of ₹2,94,427.25 crore for the Financial Year 2024-25; revenue expenditure is estimated at ₹2,35,916.99 crore, and capital expenditure at ₹32,712.84 crore Full Article Andhra Pradesh
& A.P. govt. presented a pro-people budget amid precarious financial conditions, says I&PR Minister By www.thehindu.com Published On :: Mon, 11 Nov 2024 18:18:36 +0530 Govt.’s approach is a response to the financial mess inherited from the previous YSRCP govt., says I&PR Minister Full Article Andhra Pradesh
& Four horses retire after 14-year-long stint at NCC’s Tirupati R&V regiment By www.thehindu.com Published On :: Tue, 12 Nov 2024 19:07:40 +0530 After their retirement, the horses will be shifted to the Remount Training School and Depot at Hempur in Uttarakhand Full Article Andhra Pradesh
& Maharashtra elections 2024: Six in 10 Maharashtrians relate more to the national identity than the regional By www.thehindu.com Published On :: Mon, 21 Oct 2024 03:50:00 +0530 Two in 10 believe that they are Maharashtrian first, Indian later. A little over one-sixth of the respondents favoured both identities equally. Full Article Maharashtra Assembly
& Luck, logic, and white lies [electronic resource] : the mathematics of games / Jörg Bewersdorff ; translated by David Kramer. By darius.uleth.ca Published On :: Boca Raton, FL : CRC Press, 2021. Full Article
& Bernoulli's fallacy [electronic resource] : statistical illogic and the crisis of modern science / Aubrey Clayton. By darius.uleth.ca Published On :: New York : Columbia University Press, [2021] Full Article
& Compact Riemann surfaces [electronic resource] : an introduction to contemporary mathematics / by Jürgen Jost By darius.uleth.ca Published On :: Berlin ; Heidelberg : Springer-Verlag Berlin Heidelberg, 2006 Full Article
& Rewriting, computation and proof [electronic resource] : essays dedicated to Jean-Pierre Jouannaud on the occasion of his 60th birthday / Hubert Comon-Lundh, Claude Kirchner, Hélène Kirchner (eds.) By darius.uleth.ca Published On :: Berlin ; New York : Springer, 2007 Full Article
& A beginner's guide to structural equation modeling / Randall E. Schumacker and Richard G. Lomax. By darius.uleth.ca Published On :: New York, NY : Routledge, 2016. Full Article
& Postmodern analysis [electronic resource] / Jürgen Jost By darius.uleth.ca Published On :: Berlin : Springer, [2005] Full Article
& Ideals, varieties, and algorithms [electronic resource] : an introduction to computational algebraic geometry and commutative algebra / David A. Cox, John Little, Donal O'Shea By darius.uleth.ca Published On :: New York : Springer, 2007 Full Article