Created
August 3, 2016 15:08
-
-
Save battis/5ce73d00bbcbb0a62a6155899c8402ce to your computer and use it in GitHub Desktop.
Overlay Canvas course card with an arbitrary image
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
/* assume the course ID we're interested in is 3494 */ | |
var id = 3494; | |
/* layer in CSS to load an arbitrary image */ | |
$('.ic-DashboardCard__header_hero[data-reactid*="$' + id + '"]').css('background-image', 'url("https://skunkworks.stmarksschool.org/skunkworks.png")') | |
/* | |
* interesting next steps to consider include... | |
* | |
* - Scanning course file directories for a specifically named card image, | |
* caching that information and generating the JS dynamically. | |
* - Adjusting transparency of image in CSS to allow for colored overlay. | |
*/ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment