-
Notifications
You must be signed in to change notification settings - Fork 0
/
mod_mirrored_header.php
143 lines (99 loc) · 4.19 KB
/
mod_mirrored_header.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
<?php
/**
* @package Joomla.Site
* @subpackage mod_mirrored_header
* @copyright Copyright (C) 2015 Stip - All rights reserved.
* @license GNU General Public License version 2 or later
*/
//no direct access
defined('_JEXEC') or die('Direct Access to this location is not allowed.');
// Path assignments
$stipbase = JURI::base();
if(substr($stipbase, -1)=="/") { $stipbase = substr($stipbase, 0, -1); }
$modURL = JURI::base().'modules/mod_mirrored_header';
// get parameters
$bgImage = $params->get('bgImage');
$options = $params->get('options');
$bgheight= $params->get('bgheight');
$headerheight= $params->get('headerheight');
$bgposition= $params->get('bgposition');
$usp= $params->get('usp');
$scrolldown = $params->get('scrolldown');
$scrolldownanchor = $params->get('scrolldownanchor');
$moduleclass_sfx = $params->get( 'moduleclass_sfx', '' );
$scrolldowntime= $params->get('scrolldowntime');
$scrolltijd= $params->get('scrolltijd');
// write to header
$app = JFactory::getApplication();
$template = $app->getTemplate();
$doc = JFactory::getDocument(); //only include if not already included
$doc->addStyleSheet( $modURL . '/css/mirror.css');
if($options == 0) {
$style = '
.header-image{background-image: url('.$stipbase.'/'.$bgImage.')!important; background-position: '.$bgposition.'!important; background-repeat: no-repeat!important;} .header-image.reflect {display:none!important;}
';
}
elseif($options == 1 ) {
$style = '
.header-image{background-image: url('.$stipbase.'/'.$bgImage.')!important; background-position: '.$bgposition.'!important; background-repeat: no-repeat!important;}
';
}
elseif($options == 2 ) {
$style = '
.cover-teaser-group-grid {max-width:100%!important;}
.header-image{background-size:cover;}
.header-image{background-image: url('.$stipbase.'/'.$bgImage.')!important; background-position: '.$bgposition.'!important; background-repeat: no-repeat!important;} .header-image.reflect {display:none!important;}
';
}
elseif($options == 3 ) {
$style = '
.cover-teaser-group-grid {max-width:100%!important;}
.header-image{background-size:cover!important;}
.header-image{ background-image: url('.$stipbase.'/'.$bgImage.')!important; background-position: '.$bgposition.'!important; background-repeat: no-repeat!important;} .header-image.reflect {display:none!important;}
';
}
$doc->addStyleDeclaration( $style );
?>
<div id="header">
<section class="cover-teaser-group">
<div class="cover-teaser-group-grid">
<div class="cover-teaser-header-images ">
<div class="header-images-bottom">
<div id="header-image" class="header-image " style="height:<?php echo $bgheight ?>;"><div class="usp"><?php echo $usp ?></div><?php if($scrolldown == 1) { ?><div class="anker-header"><a href="#mirankor"><style>.anker-header a {cursor: url('/modules/mod_mirrored_header/images/cursordown.png'), auto;}</style><img alt="arrowdown" src="/modules/mod_mirrored_header/images/arrowdown.png"></a></div><?php }; ?></div>
<div class="header-image reflect right " style="height:<?php echo $bgheight ?>;" ></div>
<div class="header-image reflect left " style="height:<?php echo $bgheight ?>;"></div>
</div>
</div>
</div>
<div class="ankor-mirror-header"><a name="mirankor" id="mirankor"> </a> </div>
</section>
</div>
<?php if($options == 3) { ?>
<link rel="stylesheet" type="text/css" href="/modules/mod_mirrored_header/css/fullscreen.css">
<script type="text/javascript">//<![CDATA[
function resize()
{
var heights = window.innerHeight;
document.getElementById("header-image").style.height = heights -<?php echo $headerheight ?> + "px";
}
resize();
window.onresize = function() {
resize();
};
//]]>
</script>
<?php }; ?>
<?php if($scrolldowntime == 1) { ?>
<script type="text/javascript">//<![CDATA[
setTimeout(function(){ gotoanchor(); }, <?php echo $scrolltijd ?>000);
function gotoanchor()
{
if(jQuery(document).scrollTop()==0)
{
jQuery('html, body').animate({
scrollTop: jQuery('#mirankor').offset().top
},2000);
}
}
</script>
<?php }; ?>