File indexing completed on 2024-05-19 06:00:35
0001 /** 0002 * ocs-webserver 0003 * 0004 * Copyright 2016 by pling GmbH. 0005 * 0006 * This file is part of ocs-webserver. 0007 * 0008 * This program is free software: you can redistribute it and/or modify 0009 * it under the terms of the GNU Affero General Public License as 0010 * published by the Free Software Foundation, either version 3 of the 0011 * License, or (at your option) any later version. 0012 * 0013 * This program is distributed in the hope that it will be useful, 0014 * but WITHOUT ANY WARRANTY; without even the implied warranty of 0015 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 0016 * GNU Affero General Public License for more details. 0017 * 0018 * You should have received a copy of the GNU Affero General Public License 0019 * along with this program. If not, see <http://www.gnu.org/licenses/>. 0020 **/ 0021 /******************+ 0022 HOME PAGE THUMBS 0023 ***********************/ 0024 0025 $(window).load(function () { 0026 //$('main').find('#loading').remove(); 0027 //$('#thumbs').show(); 0028 }); 0029 0030 $(document).ready(function () { 0031 0032 // QUICK REG 0033 0034 $('#quick-reg').find('button.btn').on('click', function () { 0035 0036 var cur_active_tab = $('#quick-reg').find('.tab-pane.active'); 0037 var cur_active_li = $('#quick-reg').find('li.active'); 0038 0039 var this_target = $(this).attr('rel'); 0040 var this_target_tab = $('#quick-reg').find('.tab-pane#' + this_target); 0041 var this_target_li = $('#quick-reg').find('li.' + this_target); 0042 0043 cur_active_tab.removeClass('active'); 0044 cur_active_li.removeClass('active'); 0045 0046 this_target_tab.addClass('active'); 0047 this_target_li.addClass('active'); 0048 0049 if ($(this).attr('id') == 'next-step-one') { 0050 0051 } 0052 0053 }); 0054 0055 // THUMBS 0056 0057 var thumbNumber = 0; 0058 0059 $('.thumb').each(function () { 0060 thumbNumber++; 0061 $(this).attr('rel', thumbNumber); 0062 }); 0063 0064 $('.thumb').hover(function (event) { 0065 0066 if ($(window).width() <= 992 && $(window).width() >= 768) { 0067 var variable = 7; 0068 } else if ($(window).width() <= 768 && $(window).width() >= 420) { 0069 var variable = 5; 0070 } else if ($(window).width() <= 420) { 0071 var variable = 3; 0072 } else { 0073 var variable = 9; 0074 } 0075 0076 var this_thumb = $(this); 0077 this_thumb.addClass('hoverd'); 0078 thumb_mouseover(this_thumb, variable); 0079 0080 }, function () { 0081 0082 if ($(window).width() <= 992 && $(window).width() >= 768) { 0083 var variable = 7; 0084 } else if ($(window).width() <= 768 && $(window).width() >= 420) { 0085 var variable = 5; 0086 } else if ($(window).width() <= 420) { 0087 var variable = 3; 0088 } else { 0089 var variable = 9; 0090 } 0091 0092 var this_thumb = $(this); 0093 thumb_mouseout(this_thumb, variable); 0094 }); 0095 0096 $('.thumb').on('click', function () { 0097 var this_thumb = $(this); 0098 this_thumb.addClass('hoverd'); 0099 thumb_mouseover(this_thumb); 0100 }); 0101 0102 }); 0103 0104 /** 0105 MOUSE OVER 0106 **/ 0107 0108 /* main thumb */ 0109 0110 function thumb_mouseover(this_thumb, variable) { 0111 0112 var this_rel = this_thumb.attr('rel'); 0113 var this_rel = parseInt(this_rel); 0114 var this_top_rel = this_rel - variable; 0115 var this_bottom_rel = this_rel + variable; 0116 var this_position = this_thumb.position().left; 0117 var this_offset = $(window).width() - this_position - this_thumb.width(); 0118 0119 var this_subhover_class = 'half-hoverd'; 0120 0121 var t_to = $('.thumb[rel="' + this_top_rel + '"]'); 0122 var t_bo = $('.thumb[rel="' + this_bottom_rel + '"]'); 0123 0124 t_to.addClass(this_subhover_class); 0125 t_bo.addClass(this_subhover_class); 0126 0127 /* thumbs on the left */ 0128 0129 if (this_position > 0) { 0130 0131 var t_le = this_thumb.prev('.thumb'); 0132 var t_tl = t_to.prev('.thumb'); 0133 var t_bl = t_bo.prev('.thumb'); 0134 0135 t_le.addClass(this_subhover_class); 0136 t_tl.addClass(this_subhover_class); 0137 t_bl.addClass(this_subhover_class); 0138 0139 if (t_to.size() > 0) { 0140 t_tl.addClass('corner'); 0141 } 0142 0143 if (t_bo.size() > 0) { 0144 t_bl.addClass('corner'); 0145 } 0146 0147 } 0148 0149 /* thumbs on the right */ 0150 0151 if (this_offset > 1) { 0152 0153 var t_ri = this_thumb.next('.thumb'); 0154 var t_tr = t_to.next('.thumb'); 0155 var t_br = t_bo.next('.thumb'); 0156 0157 t_ri.addClass(this_subhover_class); 0158 t_tr.addClass(this_subhover_class); 0159 t_br.addClass(this_subhover_class); 0160 0161 if (t_to.size() > 0) { 0162 t_tr.addClass('corner'); 0163 } 0164 0165 if (t_bo.size() > 0) { 0166 t_br.addClass('corner'); 0167 } 0168 } 0169 0170 /* if this thumbs is the main hoverd thumb, animate the corner thumbs */ 0171 0172 if (this_thumb.hasClass('hoverd')) { 0173 0174 $('.thumb.corner').each(function () { 0175 var this_thumb = $(this); 0176 corner_thumb_mouseover(this_thumb, variable); 0177 }); 0178 } 0179 } 0180 0181 /* corner thumbs */ 0182 0183 function corner_thumb_mouseover(this_thumb, variable) { 0184 var this_rel = this_thumb.attr('rel'); 0185 var this_rel = parseInt(this_rel); 0186 var this_top_rel = this_rel - variable; 0187 var this_bottom_rel = this_rel + variable; 0188 var this_position = this_thumb.position().left; 0189 var this_offset = $(window).width() - this_position - this_thumb.width(); 0190 var this_subhover_class = 'quarter-hoverd'; 0191 var t_to = $('.thumb[rel="' + this_top_rel + '"]'); 0192 var t_bo = $('.thumb[rel="' + this_bottom_rel + '"]'); 0193 t_to.addClass(this_subhover_class); 0194 t_bo.addClass(this_subhover_class); 0195 /* thumbs on the left */ 0196 if (this_position > 0) { 0197 var t_le = this_thumb.prev('.thumb'); 0198 var t_tl = t_to.prev('.thumb'); 0199 var t_bl = t_bo.prev('.thumb'); 0200 t_le.addClass(this_subhover_class); 0201 t_tl.addClass(this_subhover_class); 0202 t_bl.addClass(this_subhover_class); 0203 } 0204 /* thumbs on the right */ 0205 if (this_offset > 1) { 0206 var t_ri = this_thumb.next('.thumb'); 0207 var t_tr = t_to.next('.thumb'); 0208 var t_br = t_bo.next('.thumb'); 0209 t_ri.addClass(this_subhover_class); 0210 t_tr.addClass(this_subhover_class); 0211 t_br.addClass(this_subhover_class); 0212 } 0213 } 0214 0215 0216 /** 0217 MOUSE OUT 0218 **/ 0219 0220 /* main thumb */ 0221 0222 function thumb_mouseout(this_thumb, variable) { 0223 0224 var this_rel = this_thumb.attr('rel'); 0225 var this_rel = parseInt(this_rel); 0226 0227 var t_le = this_thumb.prev('.thumb'); 0228 var t_ri = this_thumb.next('.thumb'); 0229 var t_to = $('.thumb[rel="' + (this_rel - variable) + '"]'); 0230 var t_tl = t_to.prev('.thumb'); 0231 var t_tr = t_to.next('.thumb'); 0232 var t_bo = $('.thumb[rel="' + (this_rel + variable) + '"]'); 0233 var t_bl = t_bo.prev('.thumb'); 0234 var t_br = t_bo.next('.thumb'); 0235 0236 if (this_thumb.hasClass('hoverd')) { 0237 $('.thumb.corner').each(function () { 0238 var this_thumb = $(this); 0239 corner_thumb_mouseout(this_thumb, variable); 0240 }); 0241 } 0242 0243 this_thumb.removeClass('hoverd'); 0244 t_le.removeClass('half-hoverd'); 0245 t_ri.removeClass('half-hoverd'); 0246 t_to.removeClass('half-hoverd'); 0247 t_tl.removeClass('half-hoverd'); 0248 t_tr.removeClass('half-hoverd'); 0249 t_bo.removeClass('half-hoverd'); 0250 t_bl.removeClass('half-hoverd'); 0251 t_br.removeClass('half-hoverd'); 0252 } 0253 0254 /* corner thumbs */ 0255 0256 function corner_thumb_mouseout(this_thumb, variable) { 0257 var this_rel = this_thumb.attr('rel'); 0258 var this_rel = parseInt(this_rel); 0259 var this_top_rel = this_rel - variable; 0260 var this_bottom_rel = this_rel + variable; 0261 var this_position = this_thumb.position().left; 0262 var this_offset = $(window).width() - this_position - this_thumb.width(); 0263 var this_subhover_class = 'quarter-hoverd'; 0264 /* top and bottom */ 0265 var t_to = $('.thumb[rel="' + this_top_rel + '"]'); 0266 var t_bo = $('.thumb[rel="' + this_bottom_rel + '"]'); 0267 t_to.removeClass(this_subhover_class); 0268 t_bo.removeClass(this_subhover_class); 0269 /* thumbs on the left */ 0270 var t_le = this_thumb.prev('.thumb'); 0271 var t_tl = t_to.prev('.thumb'); 0272 var t_bl = t_bo.prev('.thumb'); 0273 t_le.removeClass(this_subhover_class); 0274 t_tl.removeClass(this_subhover_class); 0275 t_bl.removeClass(this_subhover_class); 0276 /* thumbs on the right */ 0277 var t_ri = this_thumb.next('.thumb'); 0278 var t_tr = t_to.next('.thumb'); 0279 var t_br = t_bo.next('.thumb'); 0280 t_ri.removeClass(this_subhover_class); 0281 t_tr.removeClass(this_subhover_class); 0282 t_br.removeClass(this_subhover_class); 0283 0284 this_thumb.removeClass('corner'); 0285 }