4253cbec
root
first commit
|
1
2
|
<?php
/* @var $slider Slider*/
|
50e38c82
Administrator
big commti
|
3
|
use common\components\artboximage\ArtboxImageHelper;
|
4253cbec
root
first commit
|
4
5
6
|
use common\models\Slider;
use yii\helpers\Html;
use yii\helpers\Url;
|
50e38c82
Administrator
big commti
|
7
|
use yii\web\View;
|
2e96ba93
Administrator
big commti
|
8
|
use frontend\assets\FlipclockAsset;
|
612a4ea1
Administrator
big commti
|
9
|
FlipclockAsset::register($this);
|
4253cbec
root
first commit
|
10
|
?>
|
50e38c82
Administrator
big commti
|
11
12
13
|
<div id="<?=$title?>" class="owl-carousel owl-theme">
|
4253cbec
root
first commit
|
14
|
<?php foreach($slider->sliderImage as $image):
|
50e38c82
Administrator
big commti
|
15
|
|
612a4ea1
Administrator
big commti
|
16
17
18
19
20
|
?>
<div class="item">
<?php
if(!empty($image->end_at) && strtotime($image->end_at) > strtotime(date("Y-m-d"))){
|
2e96ba93
Administrator
big commti
|
21
|
?>
|
612a4ea1
Administrator
big commti
|
22
|
<div class="clock_style clock_<?= $image->primaryKey ?>"></div>
|
2e96ba93
Administrator
big commti
|
23
24
25
26
27
28
|
<script type="text/javascript">
var clock;
$(document).ready(function() {
var clock;
|
612a4ea1
Administrator
big commti
|
29
|
clock = $('.clock_<?= $image->primaryKey ?>').FlipClock({
|
2e96ba93
Administrator
big commti
|
30
31
32
33
34
35
36
37
38
39
40
41
42
43
|
clockFace: 'DailyCounter',
language: 'ru',
classes: {
active: 'flip-clock-active',
before: 'flip-clock-before',
divider: 'flip-clock-divider',
dot: 'flip-clock-dot',
label: 'flip-clock-label',
flip: 'flip',
play: 'play',
wrapper: 'flip-clock-wrapper'
},
});
|
612a4ea1
Administrator
big commti
|
44
|
clock.setTime(<?= strtotime($image->end_at) - strtotime(date("Y-m-d H:i:s"))?>);
|
2e96ba93
Administrator
big commti
|
45
46
47
48
49
50
51
|
clock.setCountdown(true);
clock.start();
});
</script>
|
612a4ea1
Administrator
big commti
|
52
53
|
<?php
}?>
|
50e38c82
Administrator
big commti
|
54
|
<?= Html::img(ArtboxImageHelper::getImageSrc($image->imageUrl,'slider'))?>
|
4253cbec
root
first commit
|
55
|
</div>
|
50e38c82
Administrator
big commti
|
56
57
58
|
|
4253cbec
root
first commit
|
59
60
|
<?php endforeach; ?>
</div>
|
4253cbec
root
first commit
|
61
62
63
|
<?php
$dur = $slider->duration ? $slider->duration : 5000;
$speed = $slider->speed ? $slider->speed : 500;
|
50e38c82
Administrator
big commti
|
64
65
|
$js=" $(\"#$title\").owlCarousel({
navigation : true, // Show next and prev buttons
|
2cbb3bdc
Виталий
test commit
|
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
|
slideSpeed : 500,
autoplayTimeout:$dur,
paginationSpeed : $speed,
singleItem:true,
autoPlay:true
});
var owl = $(\"#$title\");
$('#next_slide').click(function() {
owl.trigger('owl.next');
})
$('#prev_slide').click(function() {
owl.trigger('owl.prev');
})
";
|
4253cbec
root
first commit
|
81
|
|
50e38c82
Administrator
big commti
|
82
|
$this->registerJs($js,View::POS_END);
|
4253cbec
root
first commit
|
83
84
|
?>
|