scr

Solvation effect enabled visualized discrimination of multiple metal ions

Anal. Methods, 2024, 16,2301-2310
DOI: 10.1039/D4AY00060A, Paper
Yang Cheng, Yuan Liu, Jiguang Li, Yudong Li, Da Lei, Dezhong Li, Xincun Dou
Highly efficient detection of environmental residual potentially toxic species is of concern worldwide as their presence in an excessive amount would greatly endanger the health of human beings as well as environmental sustainability.
The content of this RSS Feed (c) The Royal Society of Chemistry




scr

Fading in a Page on Load with CSS & JavaScript

When I visit a page, I get annoyed when I try to interact with elements while the website is still loading. Often stuff is moving around, fonts aren’t quite loaded, and it feels broken.

I know nowadays we’re obsessed in this industry with gaining every millisecond in page performance. But in a couple of projects that I recently overhauled, I added a subtle and clean loading mechanism that I think makes the experience nicer, even if it does ultimately slightly delay the time that the user is able to start interacting with my page.

The post Fading in a Page on Load with CSS & JavaScript appeared first on Impressive Webs.




scr

How to Disable JavaScript in Almost Any Browser

In 2022 I think it’s still important as a web developer to test your how your websites look and function when users disable JavaScript in their browser. Developing in this way used to be a cornerstone of Progressive Enhancement and can be handy on both desktop or mobile.

I still find myself wanting disabling JavaScript on pages I visit. Sometimes it’s to test a page I’m working on, but in other instances it’s simply to visit a web page that’s not functioning correctly and I want to see if JavaScript is the culprit.

The post How to Disable JavaScript in Almost Any Browser appeared first on Impressive Webs.




scr

Caste in jail: On discrimination in prisons

Time for State governments to end systemic discrimination in prisons




scr

​Flipping scripts: On the Haryana and J&K election results  

BJP and INDIA bloc emerge clear winners in Haryana and Jammu & Kashmir




scr

Growth prescription: On the latest World Economic Outlook 

The IMF’s ‘mediocre’ medium-term outlook merits policy attention




scr

Miniaturized click chemistry and direct screening facilitate the discovery of triazole piperazine SARS-CoV-2 Mpro inhibitors with improved metabolic stability

RSC Med. Chem., 2024, Advance Article
DOI: 10.1039/D4MD00555D, Research Article
Shenghua Gao, Letian Song, Bing Ye, Mianling Yang, Junyi Li, Manyu Gu, Ann E. Tollefson, Karoly Toth, Peng Zhan, Xinyong Liu
The continuous mutational nature of SARS-CoV-2 and its inter-species' similarities emphasize the urgent need to design and develop more direct-acting antiviral agents against highly infectious variants.
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




scr

548: Infinite Canvas, Luro + Figma, and Scraping or Crawling

What's going to happen to homework with AI? Thoughts on infinite canvas which leads into Luro and Sigma integration, and Chris gets nerdsniped and tries to scrap (or should he crawl?) websites for data.




scr

553: TypeScript, DX, GripeScript, and Astro v2 with Fred Schott

Fred Schott stops by to talk about TypeScript, what DX means in 2023, a bit of GripeScript, and being transparent about what Astro is good at, and what it's not.




scr

593: Beep & Texts, Tumblr, JavaScript & Web Components, & Cool Blog Post Ideas

Thoughts on smashing all communication messaging apps together, what's happened to Tumblr under Automattic, what the situation is with native web components and JavaScript, and looking at a list of types of blog posts.




scr

610: TypeScript in 2024, Signals, Productivity Sniped, and Follow Up

Dave's about to be eclipsed, the state of TypeScript in 2024, signals stage zero proposal, corrections on accessibility in frameworks (thanks!), web apps for better collaborative writing, getting productivity sniped, the problem with email may be you, indieweb follow up, and ultimate guitar tab apps.




scr

611: React! TypeScript! Jobification! Drupal!

Dave & Chris and thoughts on career advice that worked 3 years ago but isn't as helpful now, marking tests with ChatGPT, is taking a Drupal job in 2024 a good idea, Chris got #gear sniped, P3 color follow up, the confusing File System APIs, and where did all the lightboxes go?




scr

624: Blogging, In App Browsers are Bad, and Teaching CSS from Scratch

On this epsiode we're talking about the current state of blogging and social media, the polyfill hack, whether in app browsers should be banned, web components and the difficulty of front end web dev, and how we would go about teaching CSS from scratch in 2024.




scr

ARRL Recognizes University of Scranton During Amateur Radio Station Dedication

The University of Scranton in Pennsylvania has a new amateur radio station, W3USR. A dedication was held at the university’s Loyola Science Center on Friday, October 25, 2024, led by Dr. Nathaniel Frissell, W2NAF, an associate professor of physics and electrical engineering, and club advisor for the University of Scranton Amateur Radio Club.

The new W3USR University of Scranton Amateur Radio Sta...




scr

Policy prescription for economic and political maladies

Bimal Jalan delves deep into issues that are critical to the country with suggestions on how to overcome challenges 




scr

Filmmaker-farmer duo script a story of transformation with natural farming

Vishy, a Rex Karmaveer Chakra Fellowship awardee advocates popularising the farming practices and the broader promotion of natural farming and popularising his co-award winner Narayanappa’s farming practices




scr

After loss of one vision, carpenter overcomes odds to script a success story in farming

After Udayakumar, from Mahadevikadu, near Haripad, lost his vision in one eye 15 years ago, his career as a woodworker came to an abrupt end. He then turned to agriculture to find solace and success through determination and resilience.




scr

By 2021, India to have 810 m smartphone subscriptions




scr

Hyundai Motor India's ₹27,870 crore IPO subscribed 9% so far on Day 1

This is the largest IPO in India, surpassing LIC's initial share sale of ₹21,000 crore.




scr

Hyundai Motor India's record ₹27,870 crore IPO fully subscribed

The ₹27,870 crore initial share sale got bids for 14,07,68,187 shares against 9,97,69,810 shares on offer, translating into 1.41 times the subscription, as per NSE data till 13:21 hours




scr

Hyundai Motor India’s IPO sees muted response from retail investors, issue subscribed 2.37 times

The IPO received lowest retail subscription among some of the big IPOs that had hit the Indian capital markets




scr

Delhi Ganesh: An actor who could be anyone on screen

Delhi Ganesh, one of the most versatile artists of Tamil cinema, leaves behind a legacy of warmth, trust, and laughter




scr

Documentary on Srirangam’s processinal deity screened




scr

Beautiful Scrolling Experiences – Without Libraries

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




scr

Geneva Watch Days 2022: screening for ‘flippers’

At the third edition of the trade fair, top CEOs talk about discouraging speculators and getting their ‘in demand’ beauties on the wrists of real watch lovers



  • Life &amp; Style

scr

Editorial. Incentives for vehicle scrappage need to be better

The 2021 scheme spoke of a 5 per cent discount by OEMs which has now been cut sharply, with caveats that it would be applicable only on select models, and for one or two years




scr

Research problems in discrete geometry [electronic resource] / Peter Brass, William Moser, Janos Pach

New York : Springer, 2005




scr

Over 100 sanitation workers screened for cancer in Mangaluru

Mangaluru Customs Commissionerate organised the screening with Indian Cancer Society and other organisations




scr

CAD Foundation of Mangaluru donates ECG machines for screening Sabarimala pilgrims in Kerala

With this, the foundation completes donating 1,000 ECG machines to many health facilities across India since 2018




scr

Dendron-mediated control over self-assembly of chlorophyll rosettes into columnar vs. discrete aggregates

Org. Chem. Front., 2024, 11,6304-6310
DOI: 10.1039/D4QO01629G, Research Article
Open Access
  This article is licensed under a Creative Commons Attribution 3.0 Unported Licence.
Ryo Kudo, Hiroki Hanayama, Balaraman Vedhanarayanan, Hitoshi Tamiaki, Nobuyuki Hara, Sarah E. Rogers, Martin J. Hollamby, Biplab Manna, Koji Harano, Shiki Yagai
By controlling the π-π stacking of chlorophyll supramolecular rosettes through steric hindrance of alkyl dendrons, it become possible to create chlorophyll tubes and discrete rings that resemble to natural chlorophyll assemblies.
The content of this RSS Feed (c) The Royal Society of Chemistry




scr

Fire engulfs two scrap godowns




scr

Ind vs NZ 3rd Test: New Zealand scripts history as India suffers Test series whitewash

No team had been able to win all the Test matches in India in a series featuring three or more Test matches in nine decades.




scr

A scribe in the making

Visiting courts, attending council meetings, interacting with local people and finding exclusive stories, NAVYA HEBBAR talks about her training at the University of Sheffield.




scr

How Madras was described in bhakti poetry

How different localities of the city find mention in the Tevaram, Pasurams and Tiruppugazh




scr

Assessment of optimized FRET substrates as universal corona- and picornavirus main protease substrates for screening assays

RSC Adv., 2024, 14,35438-35446
DOI: 10.1039/D4RA06573E, Paper
Open Access
  This article is licensed under a Creative Commons Attribution 3.0 Unported Licence.
Conrad Fischer, Tayla J. Van Oers, Marco J. van Belkum, Tess Lamer, Aaron Romney, Pu Chen, M. Joanne Lemieux, John C. Vederas
A short FRET peptide was identified as a universal substrate for selected coronavirus Mpros. Kinetic parameters, buffer stability and Z'-assay suggest this substrate as an excellent target for CoV-Mpro HT inhibitor screening assay development.
The content of this RSS Feed (c) The Royal Society of Chemistry




scr

Manu under dope cloud, Paris chances hit; AFI disappointed; coach Naik too under scrutiny




scr

PIX: New Zealand script historic win in Bengaluru

IMAGES from Day 5 of the first Test played between India and New Zealand, in Bengaluru, on Sunday.




scr

Taking newborn screening, as a birth right, ahead in Karnataka

NBS is a public health programme that helps in identifying serious developmental and genetic disorders in newborns through biochemical tests conducted after birth.




scr

T.N. Health Department takes cancer screening to women at their workplace

To give better access to women for screening of cancer, the Health Department is taking their programmes to work sites and also encouraging women to come in for annual check-ups




scr

Unleash the Power of Scroll-Driven Animations

I’m utterly behind in learning about scroll-driven animations apart from the “reading progress bar” experiments all over CodePen. Well, I’m not exactly “green” on the topic; we’ve published a handful of articles on it including this neat-o one by Lee


Unleash the Power of Scroll-Driven Animations originally published on CSS-Tricks, which is part of the DigitalOcean family. You should get the newsletter.





scr

Generating Random Mazes with JavaScript

I didn't get a chance to hit the pumpkin patch this year, so I missed out on seeing any corn mazes. To make up for it, I decided to make some mazes of my own! Being a programmer, I over-engineered it and built a random maze generator!




scr

FIFA bans Italian player Curto for 10 games for discrimination toward South Korean opponent

Curto also must do community services and undergo training and education with an organization approved by FIFA




scr

Investors flock to Sovereign Gold Bonds despite price rises, FY24 sees record subscriptions

SGBs offer a hedge against gold price fluctuations, with investors receiving the ongoing market price at redemption



  • Gold &amp; Silver

scr

Recent advances in discrete Cu complexes for enhanced chemodynamic therapy

Dalton Trans., 2024, Accepted Manuscript
DOI: 10.1039/D4DT02380C, Frontier
Zhao-Guo Hong, Liangliang Zhang, Hong Liang, Fu-Ping Huang
Since the concept of metal ion stimulation-mediated chemodynamic therapy was proposed by Bu and Shi 's group in 2016, increasing attention has been directed toward fabricate efficient, safe and stable...
The content of this RSS Feed (c) The Royal Society of Chemistry




scr

Your stone-age brain in the screen age [electronic resource] : coping with digital distraction and sensory overload / Richard E. Cytowic.

Cambridge, Massachusetts : The MIT Press, [2024]




scr

Maharashtra key to India's growth story being scripted in Modi 3.0: EAM Jaishankar




scr

Insurance benefits to stay for EPFO subscribers

The minimum and maximum benefits under the Employees’ Deposit Linked Insurance Scheme were enhanced from ₹1.5 lakh and ₹6 lakh to ₹2.5 lakh and ₹7 lakh respectively in 2021 and the benefits were valid for a period of three years, which came to an end on April 27, 2024.




scr

India scraps export tax on parboiled rice to boost exports

Bigger rice shipments from India would beef up overall global supplies and soften international prices




scr

The art of Gatescrashing democracy

Journalist Tim Schwab says his book probing the Gates Foundation is a case study for the larger problem of extreme wealth and how it threatens democracy