CSS - Darken video for text readability

0 votes
4 views
added 23 hours ago in CSS by lcjr Lieutenant (12,480 points)
  :root {
    --hero-brightness: 0.55;   /* lower = darker (0.45–0.70 works well) */
    --hero-contrast:   1.05;   /* tiny pop */
    --hero-saturation: 0.95;   /* optional, a touch less color */
  }

  .hero-top-video {
    /* Darken the video itself */
    filter: brightness(var(--hero-brightness)) contrast(var(--hero-contrast)) saturate(var(--hero-saturation));
    -webkit-filter: brightness(var(--hero-brightness)) contrast(var(--hero-contrast)) saturate(var(--hero-saturation));

    /* Helps some browsers apply filter on video layers smoothly */
    will-change: filter, transform;
    transform: translateZ(0);
  }

 

lazacode.org - Malaysia's programming knowledge sharing platform, where everyone can share their finding as reference to others.
...