Covervid
Make your HTML5 video behave like a background cover image with this lightweight Javascript plugin / jQuery extension
Install / Use
/learn @scericson/CovervidREADME
CoverVid
⚠️ This project is no longer maintained now that their is widespread support for the object-fit and object-position CSS properties in modern browsers ⚠️
At the core of CoverVid, is the idea of this little CSS snippet being possible...
.selector {
background-video: url('../foo/bar.mp4 || ../foo/bar.webm');
background-size: cover;
background-position: center center;
}
Why is it special?
CoverVid is very lightweight, with only 800 bytes of Javascripts. It is usable in native Javascript and jQuery. Its' logic is parent based, meaning the parent element can be any size (Not necessarily just a full-screen background).
How do I use it?
-
First pull the project down from <a href="http://github.com/stefanerickson/covervid">GitHub</a>, or install with bower running <code>bower install covervid</code> and link <code>covervid.min.js</code> into your site. Make sure it is loaded after jQuery if using it.
-
It is important to note that the video you target will use its' parent element to scale. With that in mind, we will create some simple markup and add some base styling to size the videos' parent/wrapper element.
<div class="covervid-wrapper"> <video class="covervid-video" autoplay loop poster="img/video-fallback.png"> <source src="videos/video.webm" type="video/webm"> <source src="videos/video.mp4" type="video/mp4"> </video> </div>.covervid-wrapper { position: absolute; top: 0; left: 0; width: 100%; height: 100%; } -
Now, we would simply call <code>coverVid(Container-Element, Video-Width, Video-Height)</code> on the video element, passing through the native dimensions of the video. If you are using jQuery, we would call <code>$('.covervid-video').coverVid(1920, 1080);</code>.
Related Skills
docs-writer
99.6k`docs-writer` skill instructions As an expert technical writer and editor for the Gemini CLI project, you produce accurate, clear, and consistent documentation. When asked to write, edit, or revie
model-usage
341.8kUse CodexBar CLI local cost usage to summarize per-model usage for Codex or Claude, including the current (most recent) model or a full model breakdown. Trigger when asked for model-level usage/cost data from codexbar, or when you need a scriptable per-model summary from codexbar cost JSON.
ddd
Guía de Principios DDD para el Proyecto > 📚 Documento Complementario : Este documento define los principios y reglas de DDD. Para ver templates de código, ejemplos detallados y guías paso
arscontexta
2.9kClaude Code plugin that generates individualized knowledge systems from conversation. You describe how you think and work, have a conversation and get a complete second brain as markdown files you own.
