Last active
May 5, 2022 21:26
-
-
Save otakupahp/604cf2e03fc4f94bddf92a9daa44694d to your computer and use it in GitHub Desktop.
Add a shadow text with the desired content to a H2
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
| // To add the text dynamically, use a class (overlay-title) in the h2 to catch the object and modify h2::before for "overlay-title-shadow" | |
| (function( $ ) { | |
| 'use strict'; | |
| // Window loaded | |
| $(window).on("load",function(){ | |
| const postTitleObj = $( '.overlay-title h2' ); | |
| if( 0 < postTitleObj.length ) { | |
| postTitleObj.before( '<div class="overlay-title-shadow">' + postTitleObj.html() + '</div>' ); | |
| } | |
| }); | |
| })( jQuery ); |
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
| h2:before { | |
| content: "PLAYING SERIUSLY"; | |
| position: absolute; | |
| color: #DD3131; | |
| opacity: .1; | |
| font-size: 12rem; | |
| top: 50%; | |
| left: 55%; | |
| -moz-transform: translate(-50%, -50%); | |
| -ms-transform: translate(-50%, -50%); | |
| -webkit-transform: translate(-50%, -50%); | |
| transform: translate(-50%, -50%); | |
| font-weight: 700; | |
| z-index: -1; | |
| width: 100%; | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment