joeyokey Posted January 12, 2021 Share Posted January 12, 2021 Site URL: https://www.velkendt.dk I just want to share some code that @tuanphan was so kind to help me with for my York site.Make frontpage elements show video on hover, and show images when not hovering: Firstly, for each page under settings --> media you have to link to a YouTube/Vimeo video. Afterwards, add the below code. Edit the Page Title ID and Image URL in the code for your pages and copy paste for each page. I will call the below code for CODE 1 article.index-item.has-item-video[data-url-id="title-of-your-page"] { background-image: url(https://cdn.pixabay.com/photo/2020/12/19/03/27/person-5843476__340.jpg); background-size: cover; background-repeat: no-repeat; background-position: center center } article.index-item.has-item-video[data-url-id="title-of-your-page"] a { visibility: hidden } article.index-item.has-item-video[data-url-id="title-of-your-page"]:hover a { visibility: visible } article.index-item.has-item-video[data-url-id="title-of-your-page"]:hover { background-image: none } When on mobile browser, make videos autoplay on the frontpage and dont show any images: Add this code. @media screen and (min-width:901px) { Add CODE 1 here } Show the Page Title on the front page when on mobile browser: /* show title mobile */ @media screen and (max-width:900px) { body.homepage .index-item-text-wrapper { opacity: 1 !important; } } Hide description on a single page: To hide the description on a single page, add below code under page settings --> Advanced --> Header code Also go to Design --> Site Style --> Disable Ajax Loading <style> .page-text-wrapper.clearfix { display: none; } </style> Link to comment
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment