HEX
Server: LiteSpeed
System: Linux eko108.isimtescil.net 4.18.0-477.21.1.lve.1.el8.x86_64 #1 SMP Tue Sep 5 23:08:35 UTC 2023 x86_64
User: uyarreklamcomtr (11202)
PHP: 7.4.33
Disabled: opcache_get_status
Upload Files
File: /var/www/vhosts/uyarreklam.com.tr/httpdocs/animated-image.tar
animated-image.php000064400000002464151547103100010122 0ustar00<?php

class SiteOrigin_Panels_Widget_Animated_Image extends SiteOrigin_Panels_Widget  {
	function __construct() {
		parent::__construct(
			__('Animated Image (PB)', 'siteorigin-panels'),
			array(
				'description' => __('An image that animates in when it enters the screen.', 'siteorigin-panels'),
				'default_style' => 'simple',
			),
			array(),
			array(
				'image' => array(
					'type' => 'text',
					'label' => __('Image URL', 'siteorigin-panels'),
				),
				'animation' => array(
					'type' => 'select',
					'label' => __('Animation', 'siteorigin-panels'),
					'options' => array(
						'fade' => __('Fade In', 'siteorigin-panels'),
						'slide-up' => __('Slide Up', 'siteorigin-panels'),
						'slide-down' => __('Slide Down', 'siteorigin-panels'),
						'slide-left' => __('Slide Left', 'siteorigin-panels'),
						'slide-right' => __('Slide Right', 'siteorigin-panels'),
					)
				),
			)
		);
	}

	function enqueue_scripts(){
		static $enqueued = false;
		if(!$enqueued) {
			wp_enqueue_script('siteorigin-widgets-'.$this->origin_id.'-onscreen', plugin_dir_url(__FILE__).'js/onscreen.js', array('jquery'), SITEORIGIN_PANELS_VERSION);
			wp_enqueue_script('siteorigin-widgets-'.$this->origin_id, plugin_dir_url(__FILE__).'js/main.js', array('jquery'), SITEORIGIN_PANELS_VERSION);
			$enqueued = true;
		}

	}
}js/main.js000064400000003335151547103100006443 0ustar00jQuery(function($){
    var theInterval = setInterval(function(){
        // Check if any images that weren't visible, now are
        $('.origin-widget-animated-image img').not('.animated').filter(':onScreen').each(function(){
            var $$ = $(this);
            // TODO wait for images
            if(!$$.get(0).complete) return;

            $$.addClass('animated');

            setTimeout(function(){
                var a = $$.data('animation');

                if(a == 'fade') {
                    $$.css('visibility', 'visible');
                    $$.hide().fadeIn(750);
                }
                else {
                    var offset;
                    if(a == 'slide-up') offset = {top : 25, left: 0};
                    else if(a == 'slide-down') offset = {top : -25, left: 0};
                    else if(a == 'slide-left') offset = {top : 0, left: 25};
                    else if(a == 'slide-right') offset = {top : 0, left: -25};

                    var $a = $$.clone().insertAfter($$).css({
                        'visibility' : 'visible',
                        'opacity' : 0,
                        'position' : 'absolute',
                        'top' : $$.position().top + offset.top,
                        'left' : $$.position().left + offset.left,
                        'width' : $$.width(),
                        'height' : $$.height()
                    }).animate({top: $$.position().top, left: $$.position().left, opacity: 1}, 750, function(){$(this).remove(); $$.css('visibility', 'visible');});
                }
            }, 750);
        } );

        if($('.origin-widget-animated-image img').not('.animated').length == 0) {
            clearInterval(theInterval);
        }
    }, 500);
});js/main.min.js000064400000001552151547103100007224 0ustar00jQuery((function(i){var t=setInterval((function(){i(".origin-widget-animated-image img").not(".animated").filter(":onScreen").each((function(){var t=i(this);t.get(0).complete&&(t.addClass("animated"),setTimeout((function(){var e=t.data("animation");if("fade"==e)t.css("visibility","visible"),t.hide().fadeIn(750);else{var o;"slide-up"==e?o={top:25,left:0}:"slide-down"==e?o={top:-25,left:0}:"slide-left"==e?o={top:0,left:25}:"slide-right"==e&&(o={top:0,left:-25});t.clone().insertAfter(t).css({visibility:"visible",opacity:0,position:"absolute",top:t.position().top+o.top,left:t.position().left+o.left,width:t.width(),height:t.height()}).animate({top:t.position().top,left:t.position().left,opacity:1},750,(function(){i(this).remove(),t.css("visibility","visible")}))}}),750))})),0==i(".origin-widget-animated-image img").not(".animated").length&&clearInterval(t)}),500)}));js/onscreen.js000064400000001245151547103100007331 0ustar00// onScreen jQuery plugin v0.2.1
// (c) 2011 Ben Pickles
//
// http://benpickles.github.com/onScreen
//
// Released under MIT license.
;(function($) {
    $.expr[":"].onScreen = function(elem) {
        // The viewport position
        var $window = $(window);
        var viewport_top = $window.scrollTop();
        var viewport_height = $window.height();
        var viewport_bottom = viewport_top + viewport_height;

        // Element position
        var $elem = $(elem);
        var top = $elem.offset().top;
        var height = $elem.height();
        var bottom = top + height;

        return (top >= viewport_top && bottom + 30 < viewport_bottom);

    }
})(jQuery);js/onscreen.min.js000064400000000242151547103100010107 0ustar00!function(e){e.expr[":"].onScreen=function(n){var o=e(window),r=o.scrollTop(),t=r+o.height(),i=e(n),c=i.offset().top,f=i.height();return c>=r&&c+f+30<t}}(jQuery);tpl/default.php000064400000000221151547103100007470 0ustar00<img src="<?php echo esc_url($instance['image']) ?>" style="visibility:hidden" data-animation="<?php echo esc_attr($instance['animation']) ?>" />