Created
June 15, 2018 16:22
-
-
Save wvuwebgist/fbf48fed5c43c8726501bf9273c78730 to your computer and use it in GitHub Desktop.
CleanSlate: Randomize the hero image and generate variables for different sizes based on a label:
This file contains 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
<r:comment><!-- Randomize the hero image and generate variables for different sizes based on a label: --></r:comment> | |
<r:files:each labels="random-image-collection" limit="1" types="image" random="true"> | |
<r:set_var name="image_small"><r:file:image_url size="500x400" /></r:set_var> | |
<r:set_var name="image_large"><r:file:image_url size="1000x800" /></r:set_var> | |
</r:files:each> | |
<style> | |
.wvu-hero { | |
background-image: url(<r:var name="image_small" />); | |
} /* /.wvu-hero */ | |
@media (min-width: 501px) { | |
.wvu-hero { | |
background-image: url(<r:var name="image_large" />); | |
} /* /.wvu-hero */ | |
} /* /mq */ | |
</style> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment