Viewing 14 replies - 1 through 14 (of 14 total)
  • Hi Nick
    it is not as easy as u think.
    It is this junk of code to do this small animation:
    JS:

    <script>
    	$(function(){
    		setTimeout(function () {
    			$("#benefits-typed").css('background-color', 'rgb(59, 109, 223)');
    			$("#benefits-typed").css('border-right', 'none');
    			$("#benefits-typed").css('border-left', '2px solid white');
    			setTimeout(function () {
    				$("#benefits-typed").css('border-left', 'none');
    				$("#benefits-typed").css('border-right', '2px solid white');
    				$("#benefits-typed").hide()
    				$("#blink-fix").show()
    			},500)
    		},3500)
            $("#benefits-typed").typed({
                strings: [
                	"profitable",
                	"painless",
    	            "optimized",
    	            "quick & easy",
    	            "stress-free",
                ],
                typeSpeed: 60,
                backSpeed: 1,
                backDelay: 3000,
                loop : true,
                loopCount: false,
                startDelay: 4000,
                // starting callback function before each string
                preStringTyped: function() {
                	$("#benefits-typed").css('background-color', 'transparent')
                	$("#blink-fix").hide()
                	$("#benefits-typed").show()
                },
                //callback for every typed string
                onStringTyped: function() {
                	setTimeout(function () {
                		$("#benefits-typed").css('background-color', 'rgb(59, 109, 223)');
                		$("#benefits-typed").css('border-right', 'none');
                		$("#benefits-typed").css('border-left', '2px solid white');
                		setTimeout(function () {
                			$("#benefits-typed").css('border-left', 'none');
                			$("#benefits-typed").css('border-right', '2px solid white');
                			$("#benefits-typed").hide()
                			$("#blink-fix").show()
                		}, 400+(Math.random()*400))
                	}, 1400+(Math.random()*400))
                }
            });
    
    		$(".scroll").click(function(event){     
    	        event.preventDefault();
    	        $('html,body').animate({scrollTop:$($(this).attr('href')).offset().top}, 500);
    	    });
    
    	    $('.tooltip-target.target-1').qtip({
    	        content: {
    	            text: $('.tooltip-1-content')
    	        },
    	        show: {
    	        	event: 'show-tooltip',
                   	delay: 250,
                   	effect: function(offset) {
                   		//$(this).show()
                       $(this).fadeIn(0); // "this" refers to the tooltip
                       $(this).addClass('animated bounceIn');
                   	},
    
                },
                hide: {
                    fixed: true,
                    leave: false,
                    delay: 1000000000
                },
                position: {
                    my: 'top center',  // Position my top left...
                    at: 'bottom center', // at the bottom right of...
                },
                style: {
                    tip: {
                        corner: true,
                        width: 20,
                        height: 8,
                    }
                }
    	    });
    
    	    $('.tooltip-target.target-2').qtip({
    	        content: {
    	            text: $('.tooltip-2-content')
    	        },
    	        show: {
    	        	//ready : trye
                   event: 'show-tooltip',
                   delay: 500,
                   effect: function(offset) {
                       $(this).fadeIn(0); // "this" refers to the tooltip
                       $(this).addClass('animated bounceIn');
                   }
                },
                hide: {
                    fixed: true,
                    leave: false,
                    delay: 1000000000
                },
                position: {
                    my: 'top center',  // Position my top left...
                    at: 'bottom center', // at the bottom right of...
                },
                style: {
                    tip: {
                        corner: true,
                        width: 20,
                        height: 8,
                    }
                }
    	    });
    
    	    $('.tooltip-target.target-3').qtip({
    	        content: {
    	            text: $('.tooltip-3-content')
    	        },
    	        show: {
                   event: 'show-tooltip',
                   delay: 0,
                   effect: function(offset) {
                       $(this).fadeIn(0); // "this" refers to the tooltip
                       $(this).addClass('animated bounceIn');
                   }
                },
                hide: {
                    fixed: true,
                    leave: false,
                    delay: 1000000000
                },
                position: {
    	            my: 'top center',  // Position my top left...
    	            at: 'bottom center', // at the bottom right of...
    	        },
    	        style: {
    	            tip: {
    	                corner: true,
    	                width: 20,
    	                height: 8,
    	            }
    	        }
    	    });
    
    	    $( window ).resize(function() {
    	      placeTooltips()
    	    });
    	    placeTooltips()
    
    	    var waypoint = new Waypoint({
    	      element: document.getElementById('waypoint'),
    	      handler: function() {
    	        $('.tooltip-target').trigger('show-tooltip')
    	      },
    	      offset: 500
    	    })
        });
    
        function placeTooltips(){
        	var img = $('.interface-image');
        	var img_width = img.width();
        	var img_height = img.height();
        	var image_position = img.position();
        	var new_css_1 = {
        		top : img_height * 0.145, 
        		left : img_width * 0.92 + image_position.left
        	}
        	var new_css_2 = {
        		top : img_height * 0.89, 
        		left : img_width * 0.44 + image_position.left
        	}
        	var new_css_3 = {
        		top : img_height * 0.13, 
        		left : img_width * 0.185 + image_position.left
        	}
    
        	$('.target-1').css(new_css_1)
        	$('.target-2').css(new_css_2)
        	$('.target-3').css(new_css_3)
        }
        setTimeout(function () {
        	$(window).trigger('resize');
        }, 1000)
        
        
    </script>

    …..and CSS:

    <style>
    	.typed-cursor{
    		display:none;
    	}
    	.home-cta {
    		cursor:pointer;
    	}
    	.home-cta:hover {
    		color:white;
    	}
    	.scroll-arrow {
    		-webkit-animation: scrollstrobe 1.5s infinite;
    		-moz-animation: scrollstrobe 1.5s infinite;
    		animation: scrollstrobe 1.5s infinite;
    	}
    	#blink-fix{
    		border-left : 2px solid white;
    		-webkit-animation: blink 0.7s infinite;
    		-moz-animation: blink 0.7s infinite;
    		animation: blink 0.7s infinite;
    	}
    	#benefits-typed{
    	    -webkit-animation: blink 0.7s infinite;
    	    -moz-animation: blink 0.7s infinite;
    	    animation: blink 0.7s infinite;
    	}
    	@keyframes blink{
    	    0% { border-color:white; }
    	    50% { border-color:transparent; }
    	    100% { border-color:white; }
    	}
    
    	.interface {
    		position: relative;
    	}
    
    	.qtip {
    		background-color : #21B171;
    		color: white;
    		text-align :center;
    		border : none;
    		border-color : #21B171;
    	}
    
    	.tooltip-content {
    		display: none;
    	}
    
    	.tooltip-target.target-1, .tooltip-target.target-2, .tooltip-target.target-3{
    		position: absolute;
    		/*background-color: pink;*/
    		top : 50px;
    		left:100px;
    		height:10px;
    		width:10px;
    		border-radius: 999px;
    	}
    
    	.animated {
    	    animation-duration: 0.3s !important;
    	}
    
    	.tooltip-icon {
    		display: none;
    		/*width:120px;*/
    		/*height:120px;*/
    		/*border-right:1px solid #F5F5F8;*/
    		float : left;
    		padding:20px;
    	}
    	.tooltip-description {
    		/*height:120px;*/
    		/*border:1px solid #F5F5F8;*/
    		border-left:none;
    		/*float:left;*/
    	}
    
    	.tooltip-header {
    		font-family: "Exo 2", "Helvetica Neue", Helvetica, Arial, sans-serif;
    	    font-weight: 600;
    	    text-transform: uppercase;
    	    letter-spacing: 0px;
    	    font-size:12px;
    	    padding-top:25px;
    	    text-align: center;
    	}
    
    	.tooltip-subheader {
    		text-align: center;
    		/*padding-left:30px;*/
    		padding-top:14px;
    		padding-bottom:25px;
    		padding-right:25px;
    		padding-left:25px;
    		font-size :11px;
    		line-height : 17px;
    
    	}
    </style>

    You would have to fit it to your classes and IDs
    Cheers
    TR

    Thread Starter nickprbat

    (@nickprbat)

    Thanks for the information.

    Where did you find the code?
    I’ve tried to find the script on firebug but i couldn’t find it…

    Hi Nick,
    Try typed.js plugin. it should serve your purpose.

    Demo: https://www.mattboldt.com/demos/typed-js/

    It’s a free jQuery plugin and follow the instructions on github for details.

    thanks,
    Pamir

    Hi Nick,
    I got a code from Chrome Dev tools.
    Chrome Dev Tools is the best place to tweak the code.
    The plugin above can serve you to your desire.
    Cheers
    TR

    Thread Starter nickprbat

    (@nickprbat)

    Thanks all! If i look in the google dev tools : https://prntscr.com/cdyzcl
    I can find the code of typed.js but not the code that you’ve pasted. Where did you get that from?

    Thread Starter nickprbat

    (@nickprbat)

    I’m tryng to add the css code above in the typed.php css section but it seems not working.. How can i make the css work? Should i link it or “activate” in another file?

    Thread Starter nickprbat

    (@nickprbat)

    As you can see it on this screenshot: https://prntscr.com/ce4xvr

    The css doesnt do any action …

    Thread Starter nickprbat

    (@nickprbat)

    Dear Tahoe, im stuck at the moment. When you have time, could you please reply back…

    Hi Nick,
    I do not know how and where you took this css code. Anyway…..TRY TO

    ….Cut out that code from that typed.php file….php file in general is not mentioned for css tweaking……and….
    …..put this code to your Child Theme style.css file
    OR
    Install Simple Custom CSS plugin and put the code there.
    I do not know anything about typed-js plugin, but believe it can be solution for you.
    It can happen that it is not working.
    Then we have to look further.
    I hope it will help you
    Let me know
    Cheers
    TR

    • This reply was modified 8 years, 2 months ago by Tahoerock.

    Here I got the code I sent to you in the past.

    SCRIPT CODE

    CSS CODE

    Both codes are coming from index.html in Source in CHROME DEV TOOLS
    Cheers
    TR

    • This reply was modified 8 years, 2 months ago by Tahoerock.
    • This reply was modified 8 years, 2 months ago by Tahoerock.

    I took a look and that site you refered to is using type-js plugin also

    ScreenShot

    Thread Starter nickprbat

    (@nickprbat)

    Thanks Tahoe everything i tried ended up not working… Do you have skype? I can send you some information that you can take a closes look at…

    Hi Nick,
    I have a Skype
    I would help you but I do not want screw up my credit here.
    I do not know if it is allowed to present Skype connection here.
    I think NOT
    This is Q for WordPress administrators.
    If they say here I can, Im happy to be helpful.
    Cheers
    TR

    Hi Nick
    I do not know what you you have done.
    Did you installed WordPress plugin TYPED-JS??????
    I NOT, delete all the code you have tried put somewhere.
    Then install that plugin, Activate it and put short Code where you want to have text behavior to be executed.

    
    How to use: After installing af activating the plugin, simply insert this shortcode: [typedjs]First text example,Second text example, Third text example[/typedjs]
    Each , splits the sentence / word.
    

    HERE is my TEST SERVER WEBSITE.
    You can see it is working right from the box.
    I have seen this plugin for the first time today.
    To tweak the time and so on you have to go to the plugin edit page.
    Tell me what you want to change and I will send you other code, if you will need it. ??
    Sound easy, isn’t it?
    Let me know
    Cheers
    TR

    • This reply was modified 8 years, 2 months ago by Tahoerock.
Viewing 14 replies - 1 through 14 (of 14 total)
  • The topic ‘CSS animated typhography’ is closed to new replies.