예제 #1
0
파일: type.php 프로젝트: vicpril/rep_bidqa
    protected function renderType()
    {
        $params = $this->slider->params;
        N2JS::addFiles(N2Filesystem::translate(dirname(__FILE__) . "/gsap"), array("MainAnimationSimple.js", "TypeSimple.js", "ResponsiveSimple.js"), "smartslider-simple-type-frontend");
        N2JS::addFiles(N2Filesystem::translate(dirname(__FILE__) . "/gsap"), array("BackgroundAnimation.js"), "smartslider-simple-type-frontend");
        N2JS::addFiles(NEXTEND_SMARTSLIDER_ASSETS . "/js/animation", array("BackgroundAnimationAbstract.js", 'Flux.js'), "smartslider-simple-type-frontend");
        $background = $params->get('background');
        $css = $params->get('slider-css');
        $slidecss = $params->get('slide-css');
        if (!empty($background)) {
            $css = 'background-image: url(' . N2ImageHelper::fixed($background) . ');';
        }
        $this->initBackgroundAnimation();
        echo $this->openSliderElement();
        ?>

        <div class="n2-ss-slider-1" style="<?php 
        echo $css;
        ?>
">
            <?php 
        echo $this->getBackgroundVideo($params);
        ?>
            <div class="n2-ss-slider-2">
                <?php 
        if ($this->backgroundAnimation) {
            ?>
                    <div class="n2-ss-background-animation"></div>
                <?php 
        }
        ?>
                <div class="n2-ss-slider-3" style="<?php 
        echo $slidecss;
        ?>
">

                    <?php 
        echo $this->slider->staticHtml;
        foreach ($this->slider->slides as $i => $slide) {
            echo N2Html::tag('div', $slide->attributes + array('class' => 'n2-ss-slide n2-ss-canvas ' . $slide->classes, 'style' => $slide->style), $slide->background . $slide->getHTML());
        }
        ?>
                </div>
            </div>
        </div>
        <?php 
        $this->widgets->echoRemainder();
        echo N2Html::closeTag('div');
        $this->javaScriptProperties['mainanimation'] = array('type' => $params->get('animation'), 'duration' => intval($params->get('animation-duration')), 'delay' => intval($params->get('animation-delay')), 'ease' => $params->get('animation-easing'), 'parallax' => floatval($params->get('animation-parallax')), 'shiftedBackgroundAnimation' => $params->get('animation-shifted-background-animation'));
        $this->javaScriptProperties['mainanimation']['shiftedBackgroundAnimation'] = 0;
        $this->javaScriptProperties['carousel'] = intval($params->get('carousel'));
        $this->javaScriptProperties['dynamicHeight'] = intval($params->get('dynamic-height', '0'));
        $this->javaScriptProperties['dynamicHeight'] = 0;
        N2Plugin::callPlugin('nextendslider', 'onNextendSliderProperties', array(&$this->javaScriptProperties));
        N2JS::addFirstCode("new NextendSmartSliderSimple('#{$this->slider->elementId}', " . json_encode($this->javaScriptProperties) . ");");
        echo N2Html::clear();
    }
예제 #2
0
 public function assetsBackend()
 {
     $path = $this->getAssetsPath();
     N2JS::addFiles($path . "/admin/js", array("visual.js", "modals.js", "sets.js", "visualeditor.js"), 'system-backend');
     foreach (glob($path . "/admin/js/*.js") as $file) {
         N2JS::addFile($file, 'system-backend');
     }
     foreach (glob($path . "/admin/js/fontservices/*.js") as $file) {
         N2JS::addFile($file, 'system-backend');
     }
 }
예제 #3
0
파일: fonts.php 프로젝트: MBerguer/wp-demo
 public function loadFonts()
 {
     $familyQuery = array();
     if (count($this->files)) {
         foreach ($this->files as $family => $styles) {
             if (count($styles)) {
                 $familyQuery[] = $family . ':' . implode(',', $styles);
             }
         }
     }
     if (empty($familyQuery)) {
         return false;
     }
     $subsets = array_unique($this->inline);
     $familyQuery[count($familyQuery) - 1] .= ':' . implode(',', $subsets);
     N2JS::addFiles(N2LIBRARYASSETS . "/js", array('webfontloader.js'), 'nextend-webfontloader');
     N2JS::addInline("\r\n        nextend.fontsLoaded = false;\r\n        nextend.fontsLoadedActive = function () {nextend.fontsLoaded = true;};\r\n        var fontData = {\r\n            google: {\r\n                families: " . json_encode($familyQuery) . "\r\n            },\r\n            active: function(){nextend.fontsLoadedActive()},\r\n            inactive: function(){nextend.fontsLoadedActive()}\r\n        };\r\n        if(typeof WebFont === 'undefined'){\r\n            window.WebFontConfig = fontData;\r\n        }else{\r\n            WebFont.load(fontData);\r\n        }", true);
     N2JS::addFirstCode("\r\n        nextend.fontsDeferred = n2.Deferred();\r\n        if(nextend.fontsLoaded){\r\n            nextend.fontsDeferred.resolve();\r\n        }else{\r\n            nextend.fontsLoadedActive = function () {\r\n                nextend.fontsLoaded = true;\r\n                nextend.fontsDeferred.resolve();\r\n            };\r\n        }", true);
 }
예제 #4
0
 public static function custom_animation_framework()
 {
     N2JS::addFiles(N2LIBRARYASSETS . "/js/core/n2timeline", array("array.js", "raf.js", "animation.js", "css.js", "tween.js", "timeline.js", "easing.js"), "nextend-frontend");
 }