ng Mechanical characterization of freestanding lipid bilayers with temperature-controlled phase By pubs.rsc.org Published On :: Soft Matter, 2024, 20,8524-8537DOI: 10.1039/D4SM00706A, Paper Open Access   This article is licensed under a Creative Commons Attribution 3.0 Unported Licence.Arash Yahyazadeh Shourabi, Roland Kieffer, Djanick de Jong, Daniel Tam, Marie-Eve Aubin-TamLipid membranes formed in a microfluidic device are studied with temperature-controlled optical tweezers, revealing how mechanical properties of ripple phase and gel-fluid phase-separated membranes change when heated above the transition temperature.The content of this RSS Feed (c) The Royal Society of Chemistry Full Article
ng Jamming crossovers in a confined driven polymer in solution By pubs.rsc.org Published On :: Soft Matter, 2024, Advance ArticleDOI: 10.1039/D4SM00761A, PaperSetarehalsadat Changizrezaei, Mikko Karttunen, Colin DennistonA polymer confined in a nanochannel undergoes a crossover to a jammed state when pushed by a large spherical colloid. We examine the system using simulations that incorporate the full hydrodynamic driving and fluctuating forces.To cite this article before page numbers are assigned, use the DOI form of citation above.The content of this RSS Feed (c) The Royal Society of Chemistry Full Article
ng Retraction: Self-assembled organic nanotubes embedding hydrophobic molecules within solid bilayer membranes By pubs.rsc.org Published On :: Soft Matter, 2024, Advance ArticleDOI: 10.1039/D4SM90171A, Retraction Open Access   This article is licensed under a Creative Commons Attribution 3.0 Unported Licence.Naohiro Kameta, Masumi Asakawa, Mitsutoshi Masuda, Toshimi ShimizuTo cite this article before page numbers are assigned, use the DOI form of citation above.The content of this RSS Feed (c) The Royal Society of Chemistry Full Article
ng Linking local microstructure to fracture location in a two-dimensional amorphous solid under isotropic strain By pubs.rsc.org Published On :: Soft Matter, 2024, Advance ArticleDOI: 10.1039/D4SM00486H, Paper Open Access   This article is licensed under a Creative Commons Attribution 3.0 Unported Licence.Max Huisman, Axel Huerre, Saikat Saha, John C. Crocker, Valeria GarbinMachine learning predicts possible crack location in experiments of a fracturing colloid monolayer, shown along with the actual crack path.To cite this article before page numbers are assigned, use the DOI form of citation above.The content of this RSS Feed (c) The Royal Society of Chemistry Full Article
ng Rolling and ordering of micro rods in shear flow induced by rod wall interactions By pubs.rsc.org Published On :: Soft Matter, 2024, Advance ArticleDOI: 10.1039/D4SM00999A, Paper Open Access   This article is licensed under a Creative Commons Attribution 3.0 Unported Licence.Martin Wittmann, Igor M. Kulić, Antonio Stocco, Juliane SimmchenWe use experiments and theoretical models to investigate the rolling and translational motion of rod-shaped micro particles close to a solid wall in the presence or absence of shear flow.To cite this article before page numbers are assigned, use the DOI form of citation above.The content of this RSS Feed (c) The Royal Society of Chemistry Full Article
ng Modeling nematic phase main-chain liquid crystal elastomer synthesis, mechanics, and thermal actuation via coarse-grained molecular dynamics By pubs.rsc.org Published On :: Soft Matter, 2024, Accepted ManuscriptDOI: 10.1039/D4SM00528G, PaperNicolas Herard, Raja Annapooranan, Todd Henry, Martin Kroger, Shengqiang Cai, Nicholas Boechler, Yelena SliozbergThis paper presents a coarse-grained molecular dynamics simulation study of the synthesis, mechanics, and thermal actuation of nematic phase main-chain liquid crystal elastomers (LCEs), a type of soft, temperature-responsive, polymeric...The content of this RSS Feed (c) The Royal Society of Chemistry Full Article
ng Enhanced gravitational trapping of bottom-heavy Janus particles over parallel microgrooves By pubs.rsc.org Published On :: Soft Matter, 2024, Accepted ManuscriptDOI: 10.1039/D4SM00989D, PaperYan Wen, Jiayu Liu, Wei Wang, Pik-Yin Lai, Penger TongWe report a systematic study of barrier-crossing dynamics of bottom-heavy self-propelled particles (SPPs) over a one-dimensional periodic potential landscape $U_0(x)$, which is fabricated on a microgroove-patterned polydimethylsiloxane (PDMS) substrate. From...The content of this RSS Feed (c) The Royal Society of Chemistry Full Article
ng Long-lived unidirectional flow of active particles within long narrow channels By pubs.rsc.org Published On :: Soft Matter, 2024, Advance ArticleDOI: 10.1039/D4SM00879K, PaperMan Xu, Ying Lan, Yuehua Yang, Hongyuan JiangWe present the dynamics of particles in a device divided into two chambers by V-shaped barriers and connected by a narrow channel. Here three distinct movement modes occur, including stochastic movement, oscillation and unidirectional flows.To cite this article before page numbers are assigned, use the DOI form of citation above.The content of this RSS Feed (c) The Royal Society of Chemistry Full Article
ng Mapping deformation dynamics to composition of topologically-active DNA blends By pubs.rsc.org Published On :: Soft Matter, 2024, Advance ArticleDOI: 10.1039/D4SM01065E, PaperKarthik R. Peddireddy, Ryan McGorty, Rae M. Robertson-AndersonWe leverage in situ enzymatic topological conversion and OpTiDDM to map the deformation dynamics of DNA blends with over 70 fractions of linear, ring and supercoiled molecules that span the phase space of possible topological compositions.To cite this article before page numbers are assigned, use the DOI form of citation above.The content of this RSS Feed (c) The Royal Society of Chemistry Full Article
ng Towards a universal model for the foaming behavior of surfactants: a case study on per- and polyfluoroalkyl substances (PFAS) By pubs.rsc.org Published On :: Soft Matter, 2024, Advance ArticleDOI: 10.1039/D4SM00931B, PaperMuchu Zhou, Reza FoudaziFoam fractionation offers a promising solution for the separation of surface-active contaminants from water.To cite this article before page numbers are assigned, use the DOI form of citation above.The content of this RSS Feed (c) The Royal Society of Chemistry Full Article
ng Aging iridium oxide catalyst inks: a formulation strategy to enhance ink processability for polymer electrolyte membrane water electrolyzers By pubs.rsc.org Published On :: Soft Matter, 2024, Advance ArticleDOI: 10.1039/D4SM00987H, Paper Open Access   This article is licensed under a Creative Commons Attribution 3.0 Unported Licence.Sunilkumar Khandavalli, Jae Hyung Park, Robin Rice, Diana Y. Zhang, Sarah A. Berlinger, Guido Bender, Deborah J. Myers, Michael Ulsh, Scott A. MaugerSteady-shear rheology showing evolution of the microstructure of iridium oxide catalyst inks of PEM water electrolyzers with aging time.To cite this article before page numbers are assigned, use the DOI form of citation above.The content of this RSS Feed (c) The Royal Society of Chemistry Full Article
ng Revealing microscale bulk structures in polymer–carbon nanocomposites using spin-echo SANS By pubs.rsc.org Published On :: Soft Matter, 2024, 20,8663-8674DOI: 10.1039/D4SM00578C, Paper Open Access   This article is licensed under a Creative Commons Attribution 3.0 Unported Licence.L. V. Tiihonen, M. P. Weir, A. J. Parnell, S. C. Boothroyd, D. W. Johnson, R. M. Dalgliesh, M. Bleuel, C. P. Duif, W. G. Bouwman, R. L. Thompson, K. S. Coleman, N. Clarke, W. A. Hamilton, A. L. Washington, S. R. ParnellSpin-echo small-angle neutron scattering (SESANS) revealed structure in polymer–carbon nanocomposites over multiple length scales with unprecedented range (10 nm–16 μm). Data from two SESANS instruments and other methods were analysed with SasView.The content of this RSS Feed (c) The Royal Society of Chemistry Full Article
ng Model predictive control of non-interacting active Brownian particles By pubs.rsc.org Published On :: Soft Matter, 2024, 20,8581-8588DOI: 10.1039/D4SM00902A, PaperTitus Quah, Kevin J. Modica, James B. Rawlings, Sho C. TakatoriModel predictive control is used to guide the spatiotemporal distribution of active Brownian particles by forecasting future states and optimizing control inputs to achieve tasks like dividing a population into two groups.The content of this RSS Feed (c) The Royal Society of Chemistry Full Article
ng Tuning collective actuation of active solids by optimizing activity localization By pubs.rsc.org Published On :: Soft Matter, 2024, 20,8570-8580DOI: 10.1039/D4SM00868E, PaperDavi Lazzari, Olivier Dauchot, Carolina BritoActive solids, more specifically elastic lattices embedded with polar active units, exhibit collective actuation when the elasto-active feedback, generically present in such systems, exceeds some critical value.The content of this RSS Feed (c) The Royal Society of Chemistry Full Article
ng Pickering emulsions for stimuli-responsive transdermal drug delivery: effect of rheology and microstructure on performance By pubs.rsc.org Published On :: Soft Matter, 2024, 20,8621-8637DOI: 10.1039/D4SM00993B, Paper Open Access   This article is licensed under a Creative Commons Attribution 3.0 Unported Licence.Simona Migliozzi, Yiting He, Maryam Parhizkar, Yang Lan, Panagiota AngeliElucidating the impact of microgels attributes on the microstructure, rheology and functionality of Pickering emulsions.The content of this RSS Feed (c) The Royal Society of Chemistry Full Article
ng Hydrophobic fouling-resistant electrospun nanofiber membranes from poly(vinylidene fluoride)/polyampholyte blends By pubs.rsc.org Published On :: Soft Matter, 2024, 20,8654-8662DOI: 10.1039/D4SM00817K, PaperAnuja S. Jayasekara, Luca Mazzaferro, Ryan O’Hara, Ayse Asatekin, Peggy CebeThis study reports the fabrication of non-woven fibrous membranes from electrospinning blended solutions of PVDF with a random polyampholyte amphiphilic copolymer (r-PAC) in N,N-dimethylformamide and methanol.The content of this RSS Feed (c) The Royal Society of Chemistry Full Article
ng Bending of polymer films: a method for obtaining a compressive modulus of thin films By pubs.rsc.org Published On :: Soft Matter, 2024, 20,8589-8600DOI: 10.1039/D4SM00084F, PaperAkihiro Ohara, Ko OkumuraWe constructed a theory and method for measuring the compressive modulus by combining tensile and bending tests. Elastic asymmetry was confirmed in an industrial PET film.The content of this RSS Feed (c) The Royal Society of Chemistry Full Article
ng Structure affinity of the Langmuir monolayer and the corresponding Langmuir–Blodgett film revealed by X-ray techniques By pubs.rsc.org Published On :: Soft Matter, 2024, 20,8601-8609DOI: 10.1039/D4SM01050G, PaperAlvina V. Alexandrova, Maxim A. Shcherbina, Yuriy L. Repchenko, Yuriy M. Selivantiev, Alexander V. Shokurov, Vladimir V. Arslanov, Sofiya L. SelektorUsing X-ray techniques, crown-substituted chromoionophore Langmuir–Blodgett films were proved to preserve the fine structure and functional features of pre-organized monolayers.The content of this RSS Feed (c) The Royal Society of Chemistry Full Article
ng Influence of counterion type on the scattering of a semiflexible polyelectrolyte By pubs.rsc.org Published On :: Soft Matter, 2024, 20,8610-8620DOI: 10.1039/D4SM00874J, Paper Open Access   This article is licensed under a Creative Commons Attribution-NonCommercial 3.0 Unported Licence.Anish Gulati, Jack F. Douglas, Olga Matsarskaia, Carlos G. LopezUnderstanding the influence of counterion and backbone solvation on the conformational and thermodynamic properties of polyelectrolytes in solution is one of the main open challenges in polyelectrolyte science.The content of this RSS Feed (c) The Royal Society of Chemistry Full Article
ng Light scattering study of algal floc growth and structure: alum vs. polymeric plant-derived flocculant By pubs.rsc.org Published On :: Soft Matter, 2024, Advance ArticleDOI: 10.1039/D4SM00837E, PaperTemitope Orimolade, Ngoc-Tram Le, Lyle Trimble, Bandaru Ramarao, Sitaraman KrishnanAlgal flocculation using alum shows dynamic fractal restructuring over time, while Moringa oleifera protein induces faster densification, enhancing floc strength.To cite this article before page numbers are assigned, use the DOI form of citation above.The content of this RSS Feed (c) The Royal Society of Chemistry Full Article
ng Thin free-standing liquid films manipulation: device design to turn on/off gravity in flow regimes for thickness map control and for material structuring By pubs.rsc.org Published On :: Soft Matter, 2024, Advance ArticleDOI: 10.1039/D4SM00951G, Paper Open Access   This article is licensed under a Creative Commons Attribution 3.0 Unported Licence.Paolo Iaccarino, Zhe Wang, Andrea Marfuggi, Simone Russo, Vincenzo Ferraro, Giuseppe Vitiello, Sara Coppola, Ernesto Di MaioWe design a device to control liquid film drainage, able to switch between viscous-capillary and viscous-gravity regimes to stabilize thickness and modify particle arrangement, offering potential for film studies and 2D structure fabrication.To cite this article before page numbers are assigned, use the DOI form of citation above.The content of this RSS Feed (c) The Royal Society of Chemistry Full Article
ng Hydrogel-based 3D fabrication of multiple replicas with varying sizes and materials from a single template via iterative shrinking By pubs.rsc.org Published On :: Soft Matter, 2024, Accepted ManuscriptDOI: 10.1039/D4SM00835A, PaperEunseok Heo, Hye Been Koo, Jun Chang Yang, In Cho, Hyun-Hee Lee, Yong-Jin Yoon, Steve Park, Jae-Byum Chang3D printing technologies have been widely used for the rapid prototyping of 3D structures, but their application in a broader context has been hampered by their low printing throughput. For...The content of this RSS Feed (c) The Royal Society of Chemistry Full Article
ng Co-assembly of Cellulose Nanocrystals and Gold Nanorods: Insights from Molecular Dynamics Modelling By pubs.rsc.org Published On :: Soft Matter, 2024, Accepted ManuscriptDOI: 10.1039/D4SM00871E, Paper Open Access   This article is licensed under a Creative Commons Attribution 3.0 Unported Licence.Jiaxin Hou, William W Sampson, Ahu Gumrah DumanliA coarse-grained molecular dynamics model is developed to explore the co-assembly of cellulose nanocrystals (CNCs) and gold nanorods (AuNRs) under sedimentation conditions with varying vol- umetric concentration and particle-size ratios....The content of this RSS Feed (c) The Royal Society of Chemistry Full Article
ng Understanding Polymer-Colloid Gels: A Solvent Perspective Using Low-Field NMR By pubs.rsc.org Published On :: Soft Matter, 2024, Accepted ManuscriptDOI: 10.1039/D4SM01098A, CommunicationLéo Hervéou, Gauthier Legrand, Thibaut Divoux, Guilhem Pablo BaezaThe present work emphasizes the relevance of low-field NMR relaxometry to investigate colloid-polymer hydrogels by probing water dynamics across a wide range of formulations between 10°C and 80°C. By examining...The content of this RSS Feed (c) The Royal Society of Chemistry Full Article
ng Dynamics of switching processes: general results and applications to intermittent active motion By pubs.rsc.org Published On :: Soft Matter, 2024, Accepted ManuscriptDOI: 10.1039/D4SM01054J, Paper Open Access   This article is licensed under a Creative Commons Attribution 3.0 Unported Licence.Ion Santra, Deepak Gupta, Kristian S OlsenSystems switching between different dynamical phases is an ubiquitous phenomenon. The general understanding of such a process is limited. To this end, we present a general expression that captures fluctuations...The content of this RSS Feed (c) The Royal Society of Chemistry Full Article
ng Interfacial viscoelasticity in oscillating drops of cyclodextrin-surfactant aqueous solution: experiments and theory By pubs.rsc.org Published On :: Soft Matter, 2024, Accepted ManuscriptDOI: 10.1039/D4SM01007H, PaperJosé Roberto Romero-Arias, Alberto S. Luviano, Miguel Costas, Aurora Hernandez-Machado, Rafael A BarrioWe present experiments involving oscillating droplets in aqueous cyclodextrin-surfactant solutions. In these experiments, α-cyclodextrin (αCD) and anionic surfactants exhibit remarkable viscoelasticity at the liquid/air interface, with dilatational modulus varying across...The content of this RSS Feed (c) The Royal Society of Chemistry Full Article
ng Mechanical properties soft hydrogels: assessment by scanning ion-conductance microscopy and atomic force microscopy By pubs.rsc.org Published On :: Soft Matter, 2024, Accepted ManuscriptDOI: 10.1039/D4SM00966E, PaperTatiana Tikhonova, Yuri M. Efremov, Vasilii Kolmogorov, Aleksei Iakovlev, Nikolay Sysoev, Peter S. Timashev, Victor Fadeev, Alexander Tivtikyan, Sergey Salikhov, Petr Gorelkin, Yuri Korchev, Alexandr Erofeev, Evgeny ShirshinThe growing interest in biomimetic hydrogels is due to their successful applications in tissue engineering, 3D cell culturing and drug delivery. Major characteristics of hydrogels include swelling, porosity, degradation rate,...The content of this RSS Feed (c) The Royal Society of Chemistry Full Article
ng Ring-shaped nanoparticle assembly and cross-linking on lipid vesicle scaffolds By pubs.rsc.org Published On :: Soft Matter, 2024, Advance ArticleDOI: 10.1039/D4SM01010H, Communication Open Access   This article is licensed under a Creative Commons Attribution 3.0 Unported Licence.Gizem Karabiyik, Aldo Jesorka, Irep GözenWe show the assembly and cross-linking of carboxylate-modified polystyrene nanoparticles into flexible circular, ring-shaped structures with micrometer sized diameters around the base of surface-adhered giant lipid vesicles.To cite this article before page numbers are assigned, use the DOI form of citation above.The content of this RSS Feed (c) The Royal Society of Chemistry Full Article
ng Supramolecular chiroptical sensing of chiral species based on circularly polarized luminescence By pubs.rsc.org Published On :: Soft Matter, 2024, Advance ArticleDOI: 10.1039/D4SM00960F, Review ArticlePanyang Chen, Huahua Fan, Sifan Du, Xin Wen, Li Zhang, Minghua LiuChiral analytes can bind to an achiral fluorescent system to generate circularly polarized luminescence (CPL). Subsequently, the CPL signal can be employed to determine the absolute configuration of the chiral substrate.To cite this article before page numbers are assigned, use the DOI form of citation above.The content of this RSS Feed (c) The Royal Society of Chemistry Full Article
ng Tribocharging of granular materials flowing in grounded inclined tubes By pubs.rsc.org Published On :: Soft Matter, 2024, Advance ArticleDOI: 10.1039/D4SM01082E, PaperNicolas Preud’homme, Julien Schockmel, Eric Opsomer, Geoffroy LumayNumerical simulations using the patch model and the method of image charges, validated against experiments, show that tribocharging in granular materials within inclined grounded tubes depends on the tube's tilt angle and length.To cite this article before page numbers are assigned, use the DOI form of citation above.The content of this RSS Feed (c) The Royal Society of Chemistry Full Article
ng A dynamical system approach to relaxation in glass-forming liquids By pubs.rsc.org Published On :: Soft Matter, 2024, Advance ArticleDOI: 10.1039/D4SM00976B, Paper Open Access   This article is licensed under a Creative Commons Attribution 3.0 Unported Licence.Jack F. Douglas, Qi-Lu Yuan, Jiarui Zhang, Hao Zhang, Wen-Sheng XuWe adapt a dynamical system approach to the practical matter of estimating relaxation times in both cooled liquids and crystals at elevated temperatures, which we identify as weakly non-integrable dynamical systems.To cite this article before page numbers are assigned, use the DOI form of citation above.The content of this RSS Feed (c) The Royal Society of Chemistry Full Article
ng A multi-scale framework for predicting α-cyclodextrin assembly on polyethylene glycol axles By pubs.rsc.org Published On :: Soft Matter, 2024, Advance ArticleDOI: 10.1039/D4SM01048E, Paper Open Access   This article is licensed under a Creative Commons Attribution-NonCommercial 3.0 Unported Licence.Cameron D. Smith, Chenfeng Ke, Wenlin ZhangWe predict the assembly and time-dependent distribution of cyclodextrin along PEG axles by combining atomistic molecular dynamics with an analytical treatment of bulk diffusion. Our kinetic Monte Carlo can aid in the design of polypseudorotaxanes.To cite this article before page numbers are assigned, use the DOI form of citation above.The content of this RSS Feed (c) The Royal Society of Chemistry Full Article
ng Pairing-specific microstructure in depletion gels of bidisperse colloids By pubs.rsc.org Published On :: Soft Matter, 2024, Advance ArticleDOI: 10.1039/D4SM00811A, Paper Open Access   This article is licensed under a Creative Commons Attribution-NonCommercial 3.0 Unported Licence.Rony A. Waheibi, Lilian C. HsiaoWe report the ensemble-averaged and pairing-specific network microstructure formed by short-range depletion attractions in bidisperse hard sphere-like colloidal systems.To cite this article before page numbers are assigned, use the DOI form of citation above.The content of this RSS Feed (c) The Royal Society of Chemistry Full Article
ng Coarsening dynamics of aster defects in a model polar active matter By pubs.rsc.org Published On :: Soft Matter, 2024, Accepted ManuscriptDOI: 10.1039/D4SM00788C, PaperSoumyadeep Mondal, Pankaj Popli, Sumantra SarkarWe numerically study the dynamics of topological defects in 2D polar active matter coupled to a conserved density field, which shows anomalous kinetics and defect distribution. The initial many- defect...The content of this RSS Feed (c) The Royal Society of Chemistry Full Article
ng Scale-dependent sharpening of interfacial fluctuations in shape-based models of dense cellular sheets By pubs.rsc.org Published On :: Soft Matter, 2024, Accepted ManuscriptDOI: 10.1039/D4SM00804A, PaperHaicen Yue, Charles Packard, Daniel SussmanThe properties of tissue interfaces – between separate populations of cells, or between a group of cells and its environment – has attracted intense theoretical, computational, and experimental study. Recent...The content of this RSS Feed (c) The Royal Society of Chemistry Full Article
ng Self-consistent electrostatic formalism of bulk electrolytes based on the asymmetric treatment of the short- and long-range ion interactions By pubs.rsc.org Published On :: Soft Matter, 2024, Advance ArticleDOI: 10.1039/D4SM01174K, PaperSahin BuyukdagliInternal energy of monovalent electrolytes (left) and dimensionless screening parameter of multivalent electrolytes (right).To cite this article before page numbers are assigned, use the DOI form of citation above.The content of this RSS Feed (c) The Royal Society of Chemistry Full Article
ng A generalized model for predicting different morphologies of bacterial swarming on a porous solid surface By pubs.rsc.org Published On :: Soft Matter, 2024, Accepted ManuscriptDOI: 10.1039/D4SM01072H, PaperUttam Kumar, Pushpavanam SubramaniamIn this study, we develop a comprehensive two-phase model to analyze the dynamics of bacterial swarming on porous substrates. The two distinct phases under consideration are the cell and aqueous...The content of this RSS Feed (c) The Royal Society of Chemistry Full Article
ng Magnetic colloidal single particles and dumbbells on a tilted washboard moir'e pattern in a precessing external field By pubs.rsc.org Published On :: Soft Matter, 2024, Accepted ManuscriptDOI: 10.1039/D4SM01183J, Paper Open Access   This article is licensed under a Creative Commons Attribution 3.0 Unported Licence.Farzaneh Farrokhzad, Nico C. X. Stuhlmüller, Piotr Kuswik, Maciej Urbaniak, Feliks Stobiecki, Sapida Akhundzada, Arno Ehresmann, Daniel de las Heras, Thomas M. FischerWe measure the dynamical behavior of colloidal singlets and dumbbells on an inclined magnetic moir'e pattern, subject to a precessing external homogeneous magnetic field. At low external field strength single...The content of this RSS Feed (c) The Royal Society of Chemistry Full Article
ng 6 Health Benefits Of Drinking Barley Water By www.rediff.com Published On :: Fri, 10 May 2024 12:12:53 +0530 rediffGURU Shreya Shah explains how you will start loving this habit. Full Article
ng Creating Ghost Buttons with CSS By 1stwebdesigner.com Published On :: Mon, 26 Jun 2023 15:32:00 +0000 In recent years, ghost buttons have solidified their position as a trendy and elegant element. Characterized by their transparent nature and minimalist outline, ghost buttons, also known as “empty” or “naked” buttons, offers a sleek, clean aesthetic that can improve … Full Article Learn UX Design Web Design CSS Guides UI Design web design
ng Crafting a Spinning Loader with Pure CSS By 1stwebdesigner.com Published On :: Mon, 26 Jun 2023 18:51:40 +0000 Imagine you’re on a website, eagerly waiting for content to load, but all you see is a blank screen. It’s frustrating, isn’t it? The spinning loader, or spinner, is a UI element designed to combat this exact problem. It informs … Full Article Learn Web Design Animation CSS Guides UI Design web design
ng How to Create a CSS Text Embossing Effect By 1stwebdesigner.com Published On :: Tue, 27 Jun 2023 14:09:30 +0000 Embossing is a graphical effect used to give the impression that the surface of an image has been raised or pressed in. In web design, an embossed text effect can give your typography a three-dimensional look and feel, often lending … Full Article Learn Web Design CSS Guides Typography web design
ng Create Neon Style Buttons Using CSS By 1stwebdesigner.com Published On :: Wed, 28 Jun 2023 15:54:19 +0000 CSS truly is a remarkable tool in a web designer’s toolkit, capable of bringing even the most vibrant creative visions to life. Today, we’re immersing ourselves in the radiant world of neon style buttons, showcasing the impressive spectrum of CSS … Full Article Learn Web Design CSS web design
ng How to Animate Gradient Text Using CSS By 1stwebdesigner.com Published On :: Wed, 28 Jun 2023 19:01:08 +0000 Web design takes a captivating turn when CSS comes into play. It enables a world of transformations, such as taking static text elements and infusing them with life. Our focus today is one such engaging transformation – animate gradient text … Full Article Learn Web Design Animation CSS Guides Typography web design
ng Ripple Button Effect Using Pure CSS By 1stwebdesigner.com Published On :: Thu, 29 Jun 2023 14:45:22 +0000 Google’s Material Design guidelines introduced the ripple effect, a subtle animation that indicates user action. The ripple effect rapidly gained popularity in web design as a sophisticated visual feedback form that refines user interaction, particularly on buttons. Today, we’ll show … Full Article Learn Web Design CSS Guides UI Design web design
ng Making an Underwater CSS Text Effect By 1stwebdesigner.com Published On :: Fri, 30 Jun 2023 18:11:20 +0000 Web design can serve as a playful exploration ground for learning new techniques. In today’s guide, we’ll dive into the creation of an underwater CSS text effect, not just for the visual outcome, but to deepen our understanding of how … Full Article Learn Web Design Animation CSS Guides Typography web design
ng Making a Better Custom Select Element By 24ways.org Published On :: Sun, 01 Dec 2019 12:00:00 +0000 Julie Grundy kicks off this, our fifteenth year, by diving headlong into the snowy issue of customising form inputs. Nothing makes a more special gift at Christmas that something you’ve designed and customised yourself. But can it be done while staying accessible to every user? In my work as an accessibility consultant, there are some frequent problems I find on people’s websites. One that’s come up a lot recently is that people are making custom select inputs for their forms. I can tell that people are trying to make them accessible, because they’ve added ARIA attributes or visually-hidden instructions for screen reader users. Sometimes they use a plugin which claims to be accessible. And this is great, I love that folks want to do the right thing! But so far I’ve never come across a custom select input which actually meets all of the WCAG AA criteria. Often I recommend to people that they use the native HTML select element instead. Yes, they’re super ugly, but as Scott Jehl shows us in his article Styling a Select Like It’s 2019 they are a lot easier to style than they used to be. They come with a lot of accessibility for free – they’re recognised and announced clearly by all screen reader software, they work reliably and predictably with keyboards and touch, and they look good in high contrast themes. But sometimes, I can’t recommend the select input as a replacement. We want a way for someone to choose an item from a list of options, but it’s more complicated than just that. We want autocomplete options. We want to put images in there, not just text. The optgroup element is ugly, hard to style, and not announced by screen readers. The focus styles are low contrast. I had high hopes for the datalist element, but although it works well with screen readers, it’s no good for people with low vision who zoom or use high contrast themes. Figure 1: a datalist zoomed in by 300% Select inputs are limited in a lot of ways. They’re frustrating to work with when you have something which looks almost like what you want, but is too restricted to be useful. We know we can do better, so we make our own. Let’s work out how to do that while keeping all the accessibility features of the original. Semantic HTML We’ll start with a solid, semantic HTML base. A select input is essentially a text input which restricts the possible answers, so let’s make a standard input. <label for="custom-select">User Type</label> <input type="text" id="custom-select"> Then we need to show everyone who can see that there are options available, so let’s add an image with an arrow, like the native element. <label for="custom-select">User Type</label> <input type="text" id="custom-select"> <img src="arrow-down.svg" alt=""> For this input, we’re going to use ARIA attributes to represent the information in the icon, so we’ll give it an empty alt attribute so screen readers don’t announce its filename. Finally, we want a list of options. An unordered list element is a sensible choice here. It also lets screen reader software understand that these bits of text are related to each other as part of a group. <ul class="custom-select-options"> <li>User</li> <li>Author</li> <li>Editor</li> <li>Manager</li> <li>Administrator</li> </ul> You can dynamically add or remove options from this list whenever you need to. And, unlike our <option> element inside a <select>, we can add whatever we like inside the list item. So if you need images to distinguish between lots of very similar-named objects, or to add supplementary details, you can go right ahead. I’m going to add some extra text to mine, to help explain the differences between the choices. This is a good base to begin with. But it looks nothing like a select input! We want to make sure our sighted users get something they’re familiar with and know how to use already. Styling with CSS I’ll add some basic styles similar to what’s in Scott Jehl’s article above. We also need to make sure that people who customise their colours in high contrast modes can still tell what they’re looking at. After checking it in the default Windows high contrast theme, I’ve decided to add a left-hand border to the focus and hover styles, to make sure it’s clear which item is about to be chosen. This would be a good time to add any dark-mode styles if that’s your jam. People who get migraines from bright screens will thank you! JavaScript for behaviour Of course, our custom select doesn’t actually do anything yet. We have a few tasks for it: to toggle the options list open and closed when we click the input, to filter the options when people type in the input, and for selecting an option to add it to the input and close the list. I’m going to tackle toggling first because it’s the easiest. Toggling Sometimes folks use opacity or height to hide content on screen, but that’s like using Harry Potter’s invisibility cloak. No-one can see what’s under there, but Harry doesn’t cease to exist and you can still poke him with a wand. In our case, screen reader and keyboard users can still reach an invisible list. Instead of making the content see-through or smaller, I’m going to use display: none to hide the list. display: none removes the content from the accessibility tree, so it can’t be accessed by any user, not just people who can see. I always have a pair of utility classes for hiding things, as follows: .hidden-all { display: none; } .hidden-visually { position: absolute; width: 1px; height: 1px; padding: 0; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; -webkit-clip-path: inset(50%); clip-path: inset(50%); border: 0; } So now I can just toggle the CSS class .hidden-all on my list whenever I like. Browsing the options Opening up our list works well for our mouse and touch-screen users. Our styles give a nice big tap target for touch, and mouse users can click wherever they like. We need to make sure our keyboard users are taken care of though. Some of our sighted users will be relying on the keyboard if they have mobility or dexterity issues. Usually our screen reader users are in Browse mode, which lets them click the arrow keys to navigate through content. However, custom selects are usually inside form elements. which pushes screen reader software to Forms Mode. In Forms mode, the screen reader software can only reach focusable items when the user clicks the Tab key, unless we provide an alternative. Our list items are not focusable by default, so let’s work on that alternative. To do this, I’m adding a tabindex of -1 to each list item. This way I can send focus to them with JavaScript, but they won’t be part of the normal keyboard focus path of the page. csOptions.forEach(function(option) { option.setAttribute('tabindex, '-1') }) Now I can move the focus using the Up and Down arrow keys, as well as with a mouse or tapping the screen. The activeElement property of the document is a way of finding where the keyboard focus is at the moment. I can use that to loop through the elements in the list and move the focus point forward or back, depending on which key is pressed. function doKeyAction(whichKey) { const focusPoint = document.activeElement switch(whichKey) { case: 'ArrowDown': toggleList('Open') moveFocus(focusPoint, 'forward') break case: 'ArrowUp': toggleList('Open') moveFocus(focusPoint, 'back') break } } Selecting The Enter key is traditional for activating an element, and we want to match the original select input. We add another case to the keypress detector… case 'Enter': makeChoice(focusPoint) toggleList('Shut') setState('closed') break … then make a function which grabs the currently focused item and puts it in our text input. Then we can close the list and move focus up to the input as well. function makeChoice(whichOption) { const optionText = whichOption.documentQuerySelector('strong') csInput.value = optionText } Filtering Standard select inputs have keyboard shortcuts – typing a letter will send focus to the first item in the option which begins with that letter. If you type the letter again, focus will move to the next option beginning with that letter. This is useful, but there’s no clue to tell users how many options might be in this category, so they have to experiment to find out. We can make an improvement for our users by filtering to just the set of options which matches that letter or sequence of letters. Then sighted users can see exactly how many options they’ve got, and continue filtering by typing more if they like. (Our screen reader users can’t see the remaining options while they’re typing, but don’t worry – we’ll have a solution for them in the next section). I’m going to use the .filter method to make a new array which only has the items which match the text value of the input. There are different ways you could do this part – my goal was to avoid having to use regex, but you should choose whatever method works best for your content. function doFilter() { const terms = csInput.value const aFilteredOptions = aOptions.filter(option => { if (option.innerText.toUpperCase().startsWith(terms.toUpperCase())) { return true } }) // hide all options csOptions.forEach(option => option.style.display = "none") // re-show the options which match our terms aFilteredOptions.forEach(function(option) { option.style.display = "" }) } Nice! This is now looking and behaving really well. We’ve got one more problem though – for a screen reader user, this is a jumble of information. What’s being reported to the browser’s accessibility API is that there’s an input followed by some clickable text. Are they related? Who knows! What happens if we start typing, or click one of the clicky text things? It’s a mystery when you can’t see what’s happening. But we can fix that. ARIA ARIA attributes don’t provide much in the way of additional features. Adding an aria-expanded='true' attribute doesn’t actually make anything expand. What ARIA does is provide information about what’s happening to the accessibility API, which can then pass it on to any assistive technology which asks for it. The WCAG requirements tell us that when we’re making custom elements, we need to make sure that as a whole, the widget tells us its name, its role, and its current value. Both Chrome and Firefox reveal the accessibility tree in their dev tools, so you can check how any of your widgets will be reported. We already have a name for our input – it comes from the label we associated to the text input right at the start. We don’t need to name every other part of the field, as that makes it seem like more than one input is present. We also don’t need to add a value, because when we select an item from the list, it’s added to the text input and therefore is exposed to the API. Figure 2: How Firefox reports our custom select to assistive technology. But our screen readers are going to announce this custom select widget as a text entry field, with some images and a list nearby. The ARIA Authoring Practices site has a pattern for comboboxes with listboxes attached. It tells you all the ARIA you need to make screen reader software give a useful description of our custom widget. I’m going to add all this ARIA via JavaScript, instead of putting it in the HTML. If my JavaScript doesn’t work for any reason, the input can still be a plain text field, and we don’t want screen readers to announce it as anything fancier than that. csSelector.setAttribute('role', 'combobox') csSelector.setAttribute('aria-haspopup', 'listbox') csSelector.setAttribute('aria-owns', '#list') csInput.setAttribute('aria-autocomplete', 'both') csInput.setAttribute('aria-controls', 'list') The next thing to do is let blind users know if the list is opened or closed. For that task I’m going to add an aria-expanded attribute to the group, and update it from false to true whenever the list changes state in our toggling function. The final touch is to add a secret status message to the widget. We can use it to update the number of options available after we’ve filtered them by typing into the input. When there are a lot of options to choose from, this helps people who can’t see the list reducing know if they’re on the right track or not. To do that we first have to give the status message a home in our HTML. <div id='custom-select-status' class='hidden-visually' aria-live='polite'></div> I’m using our visually-hidden style so that only screen readers will find it. I’m using aria-live so that it will be announced as often as it updates, not just when a screen reader user navigates past it. Live regions need to be present at page load, but we won’t have anything to say about the custom select then so we can leave it empty for now. Next we add one line to our filtering function, to find the length of our current list. updateStatus(aFilteredOptions.length) Then we send that to a function which will update our live region. function updateStatus(howMany) { console.log('updating status') csStatus.textContent = howMany + " options available." } Conclusion Let’s review what we’ve done to make an awesome custom select input: Used semantic HTML so that it’s easily interpreted by assistive technology while expanding the types of content we can include in it Added CSS styles which are robust enough to survive different visual environments while also fitting into our branding needs Used JavaScript to provide the basic functionality that the native element has Added more JavaScript to get useful functionality that the native element lacks Carefully added ARIA attributes to make sure that the purpose and results of using the element are available to assistive technology and are updated as the user interacts with it. You can check out my custom select pattern on GitHub – I’ll be making additions as I test it on more assistive technology, and I welcome suggestions for improvements. The ARIA pattern linked above has a variety of examples and customisations. I hope stepping through this example shows you why each of the requirements exists, and how you can make them fit your own needs. I think the volume of custom select inputs out there shows the ways in which the native select input is insufficient for modern websites. You’ll be pleased to know that Greg Whitworth and Simon Pieters are working on improving several input types! You can let them know what features you’d like selects to have. But until that work pays off, let’s make our custom selects as accessible and robust as they can possibly be. About the author Julie Grundy is an accessibility expert who works for Intopia, a digital accessibility consultancy. She has over 15 years experience as a front-end web developer in the health and education sectors. She believes in the democratic web and aims to unlock digital worlds for as many people as possible. In her spare time, she knits very slowly and chases very quickly after her two whippets. More articles by Julie Full Article Code accessibility
ng Twelve Days of Front End Testing By 24ways.org Published On :: Mon, 02 Dec 2019 12:00:00 +0000 Amy Kapernick sings us through numerous ways of improving the robustness and reliability of our front end code with a comprehensive rundown of ideas, tools, and resources. The girls and boys won’t get any toys until all the tests are passing. Anyone who’s spoken to me at some point in November may get the impression that I’m a bit of a grinch. But don’t get me wrong, I love Christmas, I love decorating my tree, singing carols, and doing Christmas cooking - in December. So for me to willingly be humming the 12 days of Christmas in October, it’s probably for something that I think is even more important than banning premature Christmas decorations, like front end testing. On the 12th day of Christmas, my front end dev, she gave to me, 12 testing tools, 11 optimised images, 10 linting rules, 9 semantic headings, 8 types of colour blindness, 7(.0) contrast ratio, 6 front end tests, 5 browser types, 4 types of tests, 3 shaken trees, 2 image types, and a source controlled deployment pipeline. Twelve Testing Tools axe does automated accessibility testing. Run as part of your development build, it outputs warnings to your console to let you know what changes you need to make (referencing accessibility guides). You can also specify particular accessibility standard levels that you’d like to test against, eg. best-practice, wcag2a or wcag2aa, or you can pick and choose individual rules that you want to check for (full list of rules you can test with axe). aXe Core can be used to automate accessibility testing, and has a range of extensions for different programming languages and frameworks. BackstopJS runs visual regression tests on your website. Run separately, or as part of your deployment/PR process, you can use it to make sure your code changes aren’t bleeding into other areas of the website. By default, BackstopJS will set you up with a bunch of configuration options by running backstop init in your project to help get you started. BackstopJS compares screenshots of your website to previous screenshots and compares the visual differences to see what’s changed. Website Speed Test analyses the performance of your website specifically with respect to images, and the potential size savings if they were optimised. Calibre runs several different types of tests by leveraging Lighthouse. You can run it over your live website through their web app or through the command line, it then monitors your website for performance and accessibility over time, providing metrics and notifications of any changes. Calibre provides an easy to use interface and dashboard to test and monitor your website for performance, accessibility and several other areas. Cypress is for end-to-end testing of your website. When visual regression testing may be a bit much for you, Cypress can help you test and make sure elements are still on the page and visible (even if they’re not pixel for pixel where they were last time). pa11y is for automated accessibility testing. Run as part of your build process or using their CLI or dashboard, it tests your website against various Web Content Accessibility Guidelines (WCAG) criteria (including visual tests like colour contrast). While axe is run as part of your dev build and gives you an output to the console, it can be combined with pa11y to automate any changes as part of your build process. whocanuse was created by Corey Ginnivan, and it allows you to view colour combinations as those with colour blindness would (as well as testing other visual deficiencies, and situational vision events), and test the colour contrast ratio based on those colours. Colour contrast assessment of my brand colours, testing them for issues for people with various vision deficiencies, and situational vision events. Colour Blindness Emulation was created by Kyo Nagashima as an SVG filter to emulate the different types of colour blindness, or if you’re using Gatsby, you can use a plugin based off of gatsby-plugin-colorblind-filters. Accessible Brand Colors tests all your branding colours against each other (this is great to show designers what combinations they can safely use). Accessible Brand Colors tests all colour combinations of background and text colours available from your branding colours, and checks them for compliance levels at various font sizes and weights. Browser dev tools - Most of the modern browsers have been working hard on the features available in their dev tools: Firefox: Accessibility Inspector, Contrast Ratio testing, Performance monitoring. Chromium: (Chrome, Edge Beta, Brave, Vivaldi, Opera, etc) - Accessibility Inspector, Contrast Ratio testing, Performance Monitoring, Lighthouse Audits (testing performance, best practices, accessibility and more). Edge: Accessibility Inspector, Performance monitoring. Safari: Accessibility Inspector, Performance monitoring. Firefox (left), Chrome, and Edge Beta (right) Dev Tools now analyse contrast ratios in the colour picker. The Chromium-based browsers also show curves on the colour picker to let you know which shades would meet the contrast requirements. Linc is a continuous delivery platform that makes testing the front end easier by automatically deploying a version of your website for every commit on every branch. One of the biggest hurdles when testing the front end is needing a live version of the site to view and test against. Linc makes sure you always have one. ESLint and Stylelint check your code for programmatic and stylistic errors, as well as helping keep formatting standard on projects with multiple developers. Adding a linter to your project not only helps you write better code, it can reduce simple errors that might be found during testing time. If you’re not writing JavaScript, there are plenty of alternatives for whatever language you’re writing in. If you’re trying to run eslint in VS Code, make sure you don’t have the Beautify extension installed, as that will break things. Eleven Optimised Images When it comes to performance, images are where we take the biggest hit, with images accounting for over 50% of total transfer size for websites. Many websites are serving excessively large images “just in case”, but there’s actually a native HTML element that allows us to serve different image sizes based on the screen size or serve better image formats when the browser supports it (or both). <!-- Serving different images based on the width of the screen --> <picture> <source srcset="/img/banner_desktop.jpg" media="(min-width: 1200px)" /> <source srcset="/img/banner_tablet.jpg" media="(min-width: 700px)" /> <source srcset="/img/banner_mobile.jpg" media="(min-width: 300px)" /> <img src="/img/banner_fallback.jpg"> </picture> <!-- Serving different image formats based on browser compatibility --> <picture> <source srcset="/banner.webp" type="image/webp" /> <img src="/img/banner_fallback.jpg"> </picture> Ten Linting Rules A year ago, I didn’t use linting. It was mostly just me working on projects, and I can code properly right? But these days it’s one of the first things I add to a project as it saves me so much time (and has taught me a few things about JavaScript). Linting is a very personal choice, but there are plenty of customisations to make sure it’s doing what you want, and it’s available in a wide variety of languages (including linting for styling). // .eslintrc module.exports = { rules: { 'no-var': 'error', 'no-unused-vars': 1, 'arrow-spacing': ['error', { before: true, after: true }], indent: ['error', 'tab'], 'comma-dangle': ['error', 'always'], // standard plugin - options 'standard/object-curly-even-spacing': ['error', 'either'], 'standard/array-bracket-even-spacing': ['error', 'either'], }, } // .stylelintrc { "rules": { "color-no-invalid-hex": true, "indentation": [ "tab", { "except": [ "value" ] } ], "max-empty-lines": 2, } } Nine Semantic Headings No, I’m not saying you should use 9 levels of headings, but your webpage should have an appropriate number of semantic headings. When your users are accessing your webpage with a screen reader, they rely on landmarks like headings to tell them about the page. Similarly to how we would scan a page visually, screen readers give users a list of all headings on a page to allow them to scan through the sections and access the information faster. When there aren’t any headings on a page (or headings are being used for their formatting rather than their semantic meaning), it makes it more difficult for anyone using a screen reader to understand and navigate the page. Make sure that you don’t skip heading levels on your page, and remember, you can always change the formatting on a p tag if you need to have something that looks like a heading but isn’t one. <h1>Heading 1 - Page Title</h2> <p>Traditionally you'll only see one h1 per page as it's the main page title</p> <h2>Heading 2</h2> <p>h2 helps to define other sections within the page. h2 must follow h1, but you can also have h2 following another h2.</p> <h3>Heading 3</h3> <p>h3 is a sub-section of h2 and follows similar rules to h2. You can have a h3 after h3, but you can't go from h1 to h3.</p> <h4>Heading 4</h4> <p>h4 is a sub-section of h3. You get the pattern?</p> Eight Types of Colour Blindness Testing colour contrast may not always be enough, as everyone perceives colour differently. Take the below colour combination (ignoring the fact that it doesn’t actually look nice). It has decent colour contrast and would meet the WCAG colour contrast requirements for AA standards – but what if one of your users was red-green colour blind? Would they be able to tell the difference? http://colorsafe.co/ empowers designers with beautiful and accessible colour palettes based on WCAG Guidelines of text and background contrast ratios. Red-green colour blindness is the most common form of colour blindness, but there are 8 different types affecting different parts of the colour spectrum, all the way up to complete colour blindness. Protanopia Inability to see red end of the colour spectrum. Protanomaly Difficulty seeing some shades of red. Deuteranopia Inability to see the green portion of the colour spectrum. Deuteranomaly Difficulty seeing some shades of green. Tritanopia Inability to see blue end of the colour spectrum. Tritanomaly Difficulty seeing some shades of blue. Achromatopsia Inability to see all parts of the colour spectrum, only able to perceive black, white and shades of grey. Achromatomaly Difficulty seeing all parts of the colour spectrum. Seven (.0) Contrast Ratio Sufficient colour contrast is perhaps one of the best steps to take for accessibility, as it benefits everyone. Having adequate contrast doesn’t just make the experience better for those with vision impairments, but it also helps those with situational impairments. Have you ever been in the sun and tried to read something on your screen? Whether you can view something when there’s glare could be as easy as making sure there’s enough contrast between the text and its background colour. The WCAG have defined a contrast ratio of at least 4.5:1 for normal text (18.5px) and 3:1 for large text (24px) to meet AA accessibility standards, but this should be an absolute minimum and isn’t always readable. All four below examples have sufficient contrast to pass AA standards, but you might be hard pressed to read them when there’s glare or you have a dodgy monitor (even more so considering most websites use below 18.5px for their base font size). Examples of 4.5:1 colour contrast To meet the AAA standard you need to have a ratio of 7:1 for normal text and 4.5:1 for large text, which should be sufficient for those with 20/80 vision to read. Six Front End Tests Adding default axe-core testing to Gatsby: //gatsby-config.js { resolve: 'gatsby-plugin-react-axe', options: {}, }, Running pa11y tests on homepage at various screen sizes: // tests/basic-a11y_home.js const pa11y = require('pa11y'), fs = require('file-system') runTest() async function runTest() { try { const results = await Promise.all([ pa11y('http://localhost:8000', { standard: 'WCAG2AA', actions: [], screenCapture: `${__dirname}/results/basic-a11y_home_mobile.png`, viewport: { width: 320, height: 480, deviceScaleFactor: 2, isMobile: true, }, }), pa11y('http://localhost:8000', { standard: 'WCAG2AA', actions: [], screenCapture: `${__dirname}/results/basic-a11y_home_desktop.png`, viewport: { width: 1280, height: 1024, deviceScaleFactor: 1, isMobile: false, }, }), ]) fs.writeFile('tests/results/basic-a11y_home.json', JSON.stringify(results), err => { console.log(err) }) } catch (err) { console.error(err.message) } } Running pa11y tests on a blog post template at various screen sizes: // tests/basic-a11y_post.js const pa11y = require('pa11y'), fs = require('file-system') runTest() async function runTest() { try { const results = await Promise.all([ pa11y('http://localhost:8000/template', { standard: 'WCAG2AA', actions: [], screenCapture: `${__dirname}/results/basic-a11y_post_mobile.png`, viewport: { width: 320, height: 480, deviceScaleFactor: 2, isMobile: true, }, }), pa11y('http://localhost:8000/template', { standard: 'WCAG2AA', actions: [], screenCapture: `${__dirname}/results/basic-a11y_post_desktop.png`, viewport: { width: 1280, height: 1024, deviceScaleFactor: 1, isMobile: false, }, }), ]) fs.writeFile('tests/results/basic-a11y_post.json', JSON.stringify(results), err => { console.log(err) }) } catch (err) { console.error(err.message) } } Running BackstopJS on a homepage and blog post template at various screen sizes: // backstop.json { "id": "backstop_default", "viewports": [ { "label": "phone", "width": 320, "height": 480 }, { "label": "tablet", "width": 1024, "height": 768 }, { "label": "desktop", "width": 1280, "height": 1024 } ], "onBeforeScript": "puppet/onBefore.js", "onReadyScript": "puppet/onReady.js", "scenarios": [ { "label": "Blog Homepage", "url": "http://localhost:8000", "delay": 2000, "postInteractionWait": 0, "expect": 0, "misMatchThreshold": 1, "requireSameDimensions": true }, { "label": "Blog Post", "url": "http://localhost:8000/template", "delay": 2000, "postInteractionWait": 0, "expect": 0, "misMatchThreshold": 1, "requireSameDimensions": true } ], "paths": { "bitmaps_reference": "backstop_data/bitmaps_reference", "bitmaps_test": "backstop_data/bitmaps_test", "engine_scripts": "backstop_data/engine_scripts", "html_report": "backstop_data/html_report", "ci_report": "backstop_data/ci_report" }, "report": [ "browser" ], "engine": "puppeteer", "engineOptions": { "args": [ "--no-sandbox" ] }, "asyncCaptureLimit": 5, "asyncCompareLimit": 50, "debug": false, "debugWindow": false } Running Cypress tests on the homepage: // cypress/integration/basic-test_home.js describe('Blog Homepage', () => { beforeEach(() => { cy.visit('http://localhost:8000') }) it('contains "Amy Goes to Perth" in the title', () => { cy.title().should('contain', 'Amy Goes to Perth') }) it('contains posts in feed', () => { cy.get('.article-feed').find('article') }) it('all posts contain title', () => { cy.get('.article-feed') .find('article') .get('h2') }) }) Running Cypress tests on a blog post template at various screen sizes: // cypress/integration/basic-test_post.js describe('Blog Post Template', () => { beforeEach(() => { cy.visit('http://localhost:8000/template') }) it('contains "Amy Goes to Perth" in the title', () => { cy.title().should('contain', 'Amy Goes to Perth') }) it('has visible post title', () => { cy.get('h1').should('be.visible') }) it('has share icons', () => { cy.get('.share-icons a').should('be.visible') }) it('has working share icons', () => { cy.get('.share-icons a').click({ multiple: true }) }) it('has a visible author profile image', () => { cy.get('.author img').should('be.visible') }) }) describe('Mobile Blog Post Template', () => { beforeEach(() => { cy.viewport('samsung-s10') cy.visit('http://localhost:8000/template') }) it('contains "Amy Goes to Perth" in the title', () => { cy.title().should('contain', 'Amy Goes to Perth') }) it('has visible post title', () => { cy.get('h1').should('be.visible') }) it('has share icons', () => { cy.get('.share-icons .share-link').should('be.visible') }) it('has a visible author profile image', () => { cy.get('.author img').should('be.visible') }) }) Five Browser Types Browser testing may be the bane of our existence, but it’s gotten easier, especially when you know the secret: Not every browser needs to look the same. Now, this may differ depending on your circumstances, but your website doesn’t have to match pixel for pixel across all browsers. As long as it’s on-brand and is useable across all browsers (this is where a good solid HTML foundation is useful), it’s ok for your site to look a little different between browsers. While the browsers you test in will differ depending on your user base, the main ones you want to be covering are: Chrome/Chromium Firefox Safari Internet Explorer Edge Make sure you’re testing these browsers on both desktop and mobile/tablet as well, sometimes their level of support or rendering engine will differ between devices – for example, iOS Chrome uses the Safari rendering engine, so something that works on Android Chrome may not work on iOS Chrome. Four Types of Test When it comes to testing the front end, there are a few different areas that we can cover: Accessibility Testing: doing accessibility testing properly usually involves getting an expert to run through your website, but there are several automated tests that you can run against various standard levels. Performance Testing: performance testing does technically bleed into the back end as well, but there are plenty of things that can be done from a front end perspective. Making sure the images are optimised, our code is clean and minified, and even optimising fonts using features like the font-display property. No amount of optimising the server and back end will matter if it takes forever for the front end to appear in a browser. Visual Regression Testing: we’ve all been in the position where changing one line of CSS somewhere has affected another section of the website. Visual regression testing helps prevent that. By using a tool that compares before and after screenshots against one another to flag up what’s changed, you can be sure that style changes won’t bleed into unintended areas of the site. Browser/device testing: while we all want our users to be running the most recent version of Chrome or Firefox, they may still be using the inbuilt browser on their DVD player – so we need to test various browsers, platforms and devices to make sure that our website can be accessed on whatever device they use. Three Shaken Trees Including (and therefore requiring your users to download) things that you’re not using affects the performance of your application. Are you forcing them to download the entire lodash library when you’re only using 2 functions? While a couple of unused lines of code may not seem like a huge performance hit, it can greatly affect users with slower devices or internet connections, as well as cluttering up your code with unused functions and dependencies. This can be set up on your bundler – Webpack and Parcel both have guides for tree shaking, and Gatsby has a plugin to enable it. Two Image Types While there are several different types of images, most of the time they fall into one of two categories: Informative The image represents/conveys important information that isn’t conveyed by the content surrounding it. Decorative The image only adds visual decoration to a page. From these two categories, we can then determine if we need to provide alternative text for an image. If an image is purely decorative, then we add alt="" to let screen readers know that it’s not important. But if an image is informative, then we need to be supplying a text alternative that describes the picture for anyone who’s using a screen reader or isn’t able to see the image (remember the days when a standard internet connection took a long time to load a page and you saw alt text before an image loaded). <img src="./nice-picture.jpg" alt="" /> <img src="./important-graphic.png" alt="This is a picture of something important to help add meaning to the text around me" /> If you have a lot of images with missing alt text, look into services that can auto-generate alt text based on image recognition services. One Source Controlled Deployment Pipeline While front end tests are harder to automate, running them through a source control and deployment pipeline helps track changes and eliminates issues where “it works on my computer”. Whether you’re running tests as part of the PR process, or simply against every commit that comes through, running tests automatically as part of your process makes every developer’s life easier and helps keep code quality at a high standard. We already knew that testing was important, and your project can’t be run unless all your unit and integration tests are written (and pass), but often we forget about testing the front end. There are so many different tests we need to be running on the front end, it’s hard to work out what your need to test for and where to start. Hopefully this has given you a bit of insight to front end testing, and some Christmas cheer to take you into the holidays. About the author Amy wears many hats as a freelance developer, business owner and conference addict. She regularly shares her knowledge with her peers and the next generation of developers by mentoring, coaching, teaching and feeding into the tech community in many ways. Amy can be found volunteering her time with Fenders, ACS, SheCodes (formerly Perth Web Girls) and MusesJS (formerly NodeGirls). She also works as an evangelist for YOW! Conferences, is a Twilio Champion and has been nominated for the WiTWA awards for the last 2 years. In her spare time Amy shares her knowledge and experience on her blogs and speaking at conferences. She has previously given keynotes at multiple events as well as speaking at several international conferences in the US and Europe. More articles by Amy Full Article Code testing
ng Beautiful Scrolling Experiences – Without Libraries By 24ways.org 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
ng Gift Giving to the World (Wide Web) By 24ways.org Published On :: Wed, 11 Dec 2019 12:00:00 +0000 Frances Berriman asks us to give the gift of consideration to those who are using the web on constricted devices such as low-end smart phones or feature phones. Christmas is a time of good will to all, and as Bugsy Malone reminds us, you give a little love and it all comes back to you. If I was given the job of Father Christmas with all my human limitations, apparently it would take me something like 6 months at non-stop full speed to deliver gifts to every kid on the planet. The real Father Christmas has the luxury of magic when it comes to delivering millions of gifts in just one night, but the only magical platform at my disposal is the world wide web, so I propose switching to digital gift cards and saving the reindeer feed. 300 million people are set to come online for the very first time in 2020, and a majority of those will be doing so via mobile phones (smart- and feature-phones). If we want those new users to have a great time online, spending those gift cards, we need to start thinking about their needs and limitations. Suit up We might not be hopping on the sleigh for these deliveries, but let’s suit up for the journey and get the tools we need to start testing and checking how our online gift-receivers will be enjoying their online shopping experience. Of course, the variety of phones and OSs out there is huge and varied, but we have a few options out there to get a sense for the median. Here’s a few suggestions on where to start: Never has there been a better time to advocate at your workplace for a device testing suite or lab. You can also just pick up a low-end phone for a few bucks and spend some real time using it and getting a sense for how it feels to live with it every day. May I suggest the Nokia 2 or the Moto E6 - both very representative devices of the sort our new visitors will be on. You’ve also got WebPageTest.org at your disposal, where you can emulate various phones and see your sites rendered in real-time to get a sense of what an experience may look like for your users. You’ll also want to set yourself some goals. A performance budget, for example, is a good way to know if the code you’re shipping hits the mark in a more programmatic way. Gift wrap Many of us began our internet lives on desktop machines, and thanks to Moore’s law, these machines have been getting ever more powerful every year with more CPUs and memory at our disposal. The mobile phone landscape somewhat resets us on what hardware capacity is available on the client-side of our code, so it’s time to lighten the load. What we see in the landscape of phones today is a huge spread of capabilities and CPU speeds, storage capacity and memory. And the gap between the haves and the have-nots is widening, so we have a huge task to deal with in meeting the needs of such a varied audience. As far as possible, we should try to: Keep processing off the client - do anything you can server-side. Consider a server-side render (hold the <script>, thanks) for anything relatively static (including cached frequent queries and results) to keep client-side JavaScript to the minimum. This way you’re spending your CPU, not the user’s. Avoid sending everything you have to to the end user. Mobile-first access also means data-plan-first access for many, which means they may be literally paying in cold-hard cash for everything you send over the wire – or may be experiencing your site over a degraded “4G” connection towards the end of the month. Aggressively cache assets to prevent re-downloading anything you’ve sent before. Don’t make the user pay twice if they don’t have to. Progressively load additional assets and information as the user requests them, rather than a big upfront payload, that way you’re giving the end user a little more choice about whether they want or need that extra data set. This is all to say that as web developers, we have a lot more control over how and when we deliver the meat of our products - unlike native apps that generally send the whole experience down as one multi-megabyte download that our 4G and data-strapped users can’t afford. Make a wish Finally, it’s time for your gift recipients to go out onto the web and find whatever their greatest wish is. For many, that’s going to begin when they first turn on their phone and see all those enticing icons on their home screen. Opening a browser may not be their first port of call. They’ll be primed to look for sites and information through the icon-heavy menu that most mobile OSs use today, and they will be encouraged to find new experiences through the provided app store interface. The good news is that web experience can be found in many modern app-stores today. For example, if you build an app using Trusted Web Activities, the Google Play Store will list your web site right alongside native apps and allow users to install them on their phones. Samsung and Microsoft have similar options without the extra step of creating a TWA - they’ll list any Progressive Web App in their stores. Tools like Microsoft’s PWA Builder and Llama Pack are making this easier than ever. If your users are primed to search for new experiences via a search engine instead, then they’ll benefit from the work you’ve put in to list them in app stores regardless, as PWAs are first and foremost about making websites mobile-friendly, regardless of point of sale. A PWA will provide them with offline support, service works, notifications and much more. We do have a grinch in this story, however. Apple’s iOS explicitly does not allow your website to be listed in their app store, so sadly you’ll have a harder time reaching those users. But it is possible! Fortunately, iOS isn’t as all-dominating world wide as it is in the tech community, selling only around 10-15% of smartphones out in the world. The best present The WWW is a wonderful gift that we received over 30 years ago and, as web developers, we get to steward and share this truly global, open, platform with millions of people every day. Let’s take care of it by building and sharing experiences that truly meet the needs of everyone. About the author Frances Berriman is a San Francisco-based British-born designer and web developer who blogs at fberriman.com. She’s done all sorts of things, but has a special soft spot for public sector projects, and has worked for the Government Digital Service, building GOV.UK, Code for America, Nature Publishing and the BBC and is currently Head of UX and Product Design at Netlify. More articles by Frances Full Article Process mobile