Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/dulnan/css-vhs-glitch
https://github.com/dulnan/css-vhs-glitch
Last synced: 21 days ago
JSON representation
- Host: GitHub
- URL: https://github.com/dulnan/css-vhs-glitch
- Owner: dulnan
- Created: 2015-09-26T22:18:53.000Z (over 9 years ago)
- Default Branch: master
- Last Pushed: 2015-09-26T23:31:02.000Z (over 9 years ago)
- Last Synced: 2024-12-16T18:12:54.964Z (27 days ago)
- Language: HTML
- Size: 5.15 MB
- Stars: 4
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# CSS3 VHS Glitch Effect
**[The Demo](http://dulnan.net/vhs)**![Alt text](vhs-glitch.gif?raw=true)
Only works with Chrome. Oh and you need a fast machine.
Using CSS filters and animations, no JavaScript.## why
¯\\\_(ツ)_/¯## How does it work?
The main thing is dividing the image into 200 lines. This is achieved by having 200 elements with the image as the background placed above each other and then clipping each with `clip-path` to only show a line, basically.
These elements are then animated to move back and forth, with each having a slight delay. Pair this with a custom timing function with cubic-bezier to get only a small portion of the lines moving at a given time.This is then blurred and placed on top of the original image.
The rest is basically just simple keyframe animations that move the image slightly and apply various filters. Especially `hue-rotate` and `grayscale` are useful here.
## How to compile
Install all the dependencies with `npm install` and then compile using `gulp`.## Files and folders
The *demo* folder contains the minified css file and *vhs.html* where the stylesheet is embedded.