A Simple Canvas Vignette - Gists · GitHub
Maybe your like
Skip to content Search Gists Search Gists All gists Back to GitHub Sign in Sign up Sign in Sign up You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session. You switched accounts on another tab or window. Reload to refresh your session. Dismiss alert {{ message }}
positlabs/Vignette.js Created March 21, 2013 19:47 Show Gist options
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment You can’t perform that action at this time.
Instantly share code, notes, and snippets.
- Download ZIP
- Star (2) You must be signed in to star a gist
- Fork (0) You must be signed in to fork a gist
- Embed Select an option
- Embed Embed this gist in your website.
- Share Copy sharable link for this gist.
- Clone via HTTPS Clone using the web URL.
No results found
Learn more about clone URLs Clone this repository at <script src="https://gist.github.com/positlabs/5216101.js"></script> - Save positlabs/5216101 to your computer and use it in GitHub Desktop.
- Embed Embed this gist in your website.
- Share Copy sharable link for this gist.
- Clone via HTTPS Clone using the web URL.
No results found
Learn more about clone URLs Clone this repository at <script src="https://gist.github.com/positlabs/5216101.js"></script> Save positlabs/5216101 to your computer and use it in GitHub Desktop. Download ZIP A simple canvas vignette Raw Vignette.js This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters Show hidden characters| Vignette = function (canvas) { |
| var alpha = .7, |
| context, |
| visible, |
| data; |
| (function initView() { |
| context = canvas.getContext("2d"); |
| show(); |
| })(); |
| function draw() { |
| var w = canvas.width = window.innerWidth; |
| var h = canvas.height = window.innerHeight; |
| context.clearRect(0, 0, w, h); |
| context.rect(0, 0, w, h); |
| // create radial gradient |
| var outerRadius = w * .5; |
| var innerRadius = w * .2; |
| var grd = context.createRadialGradient(w / 2, h / 2, innerRadius, w / 2, h / 2, outerRadius); |
| // light blue |
| grd.addColorStop(0, 'rgba(0,0,0,0)'); |
| // dark blue |
| grd.addColorStop(1, 'rgba(0,0,0,' + alpha + ')'); |
| context.fillStyle = grd; |
| context.fill(); |
| } |
| this.show = function() { |
| if (!visible) { |
| visible = true; |
| canvas.style.display = "block"; |
| window.addEventListener("resize", draw); |
| draw(); |
| } |
| } |
| this.hide = function() { |
| if (!visible) { |
| visible = false; |
| canvas.style.display = "none"; |
| window.removeEventListener("resize", draw); |
| } |
| } |
| }; |
Tag » How To Vignette In Canva
-
How To Add A Vignette In Canva - JAY VERSLUIS
-
Add Vignette Effect To Your Images - Canva
-
How To Use Photo Filters To Enhance Your Images - Canva
-
How To Create Vignette Effect In Canva, How To Add ... - YouTube
-
Add Vignette Effect To Your Images - Canva - Pinterest
-
How To Create A Spotlight Effect In Canva - Blogging Guide
-
How To Make A Photo Look Old With Canva - Rent My Words
-
How To Create Vignette Effect In Canva, How To Add Vignette To Photo ...
-
How To Use Canva: An 8-Step Guide To Creating Visual Content
-
Canva Surface With Vignette For Texture Or Background ... - 123RF
-
Vignette Effect - Acorn - Flying Meat
-
Conception De Vignette | Trouvez Les Meilleurs Services - Fiverr
-
Vignette Filter In Motion - Apple Support (AZ)