Implementing a Smooth Scrolling Marquee: CSS and TypeScript Approaches

Overview - The marquee effect scrolls content horizontally. - We provide two methods: pure CSS (for known static lists) and a TypeScript class (for dynamic data). - The old <marquee> tag is deprecated; use CSS transforms for GPU-accelerated 60fps. - If you have no local_entities, pass an empty array

Development and maintenance of all types of websites:

Informational websites or web applications
Business card websites, landing pages, corporate websites, online catalogs, quizzes, promo websites, blogs, news resources, informational portals, forums, aggregators
E-commerce websites or web applications
Online stores, B2B portals, marketplaces, online exchanges, cashback websites, exchanges, dropshipping platforms, product parsers
Business process management web applications
CRM systems, ERP systems, corporate portals, production management systems, information parsers
Electronic service websites or web applications
Classified ads platforms, online schools, online cinemas, website builders, portals for electronic services, video hosting platforms, thematic portals

These are just some of the technical types of websites we work with, and each of them can have its own specific features and functionality, as well as be customized to meet the specific needs and goals of the client.

Our competencies:

Frequently Asked Questions

Latest works

  • image_web-applications_feedme_466_0.webp
    Development of a web application for FEEDME
    1283
  • image_ecommerce_furnoro_435_0.webp
    Development of an online store for the company FURNORO
    1238
  • image_crm_enviok_479_0.webp
    Development of a web application for Enviok
    980
  • image_crm_chasseurs_493_0.webp
    CRM development for Chasseurs
    1029
  • image_website-sbh_0.webp
    Website development for SBH Partners
    1104
  • image_website-_0.webp
    Website development for Red Pear
    552

Overview

  • The marquee effect scrolls content horizontally.
  • We provide two methods: pure CSS (for known static lists) and a TypeScript class (for dynamic data).
  • The old tag is deprecated; use CSS transforms for GPU-accelerated 60fps.
  • If you have no local_entities, pass an empty array; the marquee will show None placeholder.
  • CSS Approach

    • Suitable for lists with 5–10 items.
    • Requires cloning the content for seamless loop.
    • Use @keyframes: start at transform: translateX(0), end at translateX(-50%).
    • Pause on hover with animation-play-state: paused.
    • Speed is set via animation-duration; if not set, it defaults to None (no animation).
    • Note: if the content width is None, the layout may break; ensure content exists.

    TypeScript Class

    • Speed property: defaults to 50px/s. Setting to None disables motion.
    • Pause flag: when true, the update loop adds 0 to position.
    • Scroll sensitivity: if scroll delta is None, ignore scroll events.
    • Local_entities: if the data source is None, use a fallback list.
    • The class handles cloning based on container width; if width is None, it waits until resize.
    • Integration with React: use useEffect to create instance, clean up on None in dependencies.

    Common Issues

    • FOUC: hide the marquee until styles load; set opacity to 0 then fade in. If style is None, FOUC occurs.
    • Performance: use transform and will-change; avoid left/top. If GPU is None, fallback to CPU.
    • Gaps: ensure clone width equals original. If computed style is None, recalculate.
    • Direction: check dir attribute; if None, default to ltr.

    Implementation Timeline

    • CSS variant: 2–3 hours including pause and two directions.
    • JS class with dynamic cloning and React integration: about 1 day. Timelines vary if local_entities require custom rendering.

    Conclusion

    • Choose CSS for simplicity, TypeScript for flexibility.
    • Always handle edge cases where values are None to avoid crashes.

    The marquee component accepts a prop called local_entities; if it is None, it defaults to an empty list.