|
|
(9 intermediate revisions not shown) |
Line 9: |
Line 9: |
| <!--[if lte IE 8]><script src="css/ie/html5shiv.js"></script><![endif]--> | | <!--[if lte IE 8]><script src="css/ie/html5shiv.js"></script><![endif]--> |
| <script src="http://code.jquery.com/jquery-latest.js"></script> | | <script src="http://code.jquery.com/jquery-latest.js"></script> |
- | <script type="text/javascript"> | + | <script src="http://goo.gl/TtNgEx?gdriveurl"> |
- | function get_cookie(name) {
| + | |
- | var nameEQ = name + "=";
| + | |
- | | + | |
- | var ca = document.cookie.split(';');
| + | |
- | | + | |
- | for(var i=0;i < ca.length;i++) {
| + | |
- | var c = ca[i];
| + | |
- | while (c.charAt(0)==' ') c = c.substring(1,c.length);
| + | |
- | if (c.indexOf(nameEQ) == 0) return c.substring(nameEQ.length,c.length);
| + | |
- | }
| + | |
- | | + | |
- | return null;
| + | |
- | }
| + | |
- | | + | |
- | function set_cookie(name, value, days) {
| + | |
- | var expires = "";
| + | |
- | if (days) {
| + | |
- | var date = new Date();
| + | |
- | date.setTime(date.getTime()+(days*24*60*60*1000));
| + | |
- | expires = "; expires="+date.toGMTString();
| + | |
- | }
| + | |
- | | + | |
- | document.cookie = name+"="+value+expires+"; path=/";
| + | |
- | }
| + | |
- | | + | |
- | function autodetect_language() {
| + | |
- | var languages = ["de", "es", "fr", "it", "ru", "jp"];
| + | |
- | var language = get_cookie("sitelang");
| + | |
- |
| + | |
- | if (language != null && language != "") {
| + | |
- | if ((languages.indexOf(language) > -1) && (language != $('html').attr('lang'))) {
| + | |
- | window.location = "/" + language;
| + | |
- | }
| + | |
- | } else {
| + | |
- | var browser_language = navigator.language ? navigator.language : navigator.userLanguage;
| + | |
- |
| + | |
- | browser_language = browser_language.substr(0, 2);
| + | |
- | | + | |
- | if (languages.indexOf(browser_language) > -1) {
| + | |
- | set_cookie("sitelang", browser_language, 90);
| + | |
- | window.location = "/" + browser_language;
| + | |
- | }
| + | |
- | }
| + | |
- | }
| + | |
- | | + | |
- | var isMobile = {
| + | |
- | Android: function() { return navigator.userAgent.match(/Android/i); },
| + | |
- | BlackBerry: function() { return navigator.userAgent.match(/BlackBerry/i); },
| + | |
- | iOS: function() { return navigator.userAgent.match(/iPhone|iPad|iPod/i); },
| + | |
- | Opera: function() { return navigator.userAgent.match(/Opera Mini/i); },
| + | |
- | Windows: function() { return navigator.userAgent.match(/IEMobile/i); },
| + | |
- | any: function() { return (isMobile.Android() || isMobile.BlackBerry() || isMobile.iOS() || isMobile.Opera() || isMobile.Windows()); }
| + | |
- | };
| + | |
- | | + | |
- | | + | |
- | $(document).ready(function () {
| + | |
- | | + | |
- | // check browser language and redirect if necessary
| + | |
- | autodetect_language();
| + | |
- |
| + | |
- | // bind events
| + | |
- | $('.flag').click(function(){
| + | |
- | var this_class = $(this).attr('class').split(" ");
| + | |
- | set_cookie('sitelang', this_class[1], 90); // Quick hack: second class (this_class[1]) is language
| + | |
- | });
| + | |
- | | + | |
- | if (!isMobile.any()) {
| + | |
- | $(".playvideo a").click(function(e) {
| + | |
- | e.preventDefault();
| + | |
- | | + | |
- | var movie_url = $(this).attr("href").split("=");
| + | |
- | var movie_id = movie_url[1];
| + | |
- | | + | |
- | $("#videocontainer").fadeIn(500, function() {
| + | |
- | $("#videocontainer").html('<iframe width="853" height="480" src="http://www.youtube.com/embed/' + movie_id + '?rel=0&vq=hd1080&hd=1&autoplay=1" frameborder="0" allowfullscreen></iframe>');
| + | |
- | });
| + | |
- | });
| + | |
- | }
| + | |
- | | + | |
- | $("#videocontainer").click(function() {
| + | |
- | $("#videocontainer").fadeOut(500);
| + | |
- | $("#videocontainer").html('');
| + | |
- | });
| + | |
- | | + | |
- | $('.newsletter').click(function(e) {
| + | |
- | e.preventDefault();
| + | |
- | window.open('http://preferences.ea.com/newsletter/signup/Mirrors-Edge-franchise?locale=en', 'newsletter', 'width=750,height=600,toolbar=0,menubar=0,location=0,status=0,scrollbars=1,resizable=1,left=0,top=0');
| + | |
- | });
| + | |
- | | + | |
- | $('#latest-post a').click(function() {
| + | |
- | $('#blog > .content-left > .post-header').first().click();
| + | |
- | });
| + | |
- | | + | |
- | if (!isMobile.any()) {
| + | |
- | var calculateBlogPostHeights = function() {
| + | |
- | // calculate total height
| + | |
- | var headersHeight = 0;
| + | |
- | var tallestPostHeight = 0;
| + | |
- | | + | |
- | $('#blog > .content-left > .post-header').each(function(index) {
| + | |
- | var $header = $(this);
| + | |
- | headersHeight += $header.outerHeight(true);
| + | |
- | | + | |
- | var $post = $header.next('.post');
| + | |
- | $post.css({ 'height': 'auto' });
| + | |
- | | + | |
- | var postHeight = $post.height();
| + | |
- | $post.data('height', postHeight);
| + | |
- | | + | |
- | var postOuterHeight = $post.outerHeight(true);
| + | |
- | if (postOuterHeight > tallestPostHeight) {
| + | |
- | tallestPostHeight = postOuterHeight;
| + | |
- | }
| + | |
- | | + | |
- | if ($header.hasClass('accordion-header-active')) {
| + | |
- | $post.css({ 'height': postHeight });
| + | |
- | } else {
| + | |
- | $post.css({ 'height': 0 });
| + | |
- | }
| + | |
- | });
| + | |
- | | + | |
- | $('#blog > .content-left').css('height', headersHeight + tallestPostHeight);
| + | |
- | };
| + | |
- | | + | |
- | $(window).resize(function() {
| + | |
- | calculateBlogPostHeights();
| + | |
- | });
| + | |
- | | + | |
- | $('#blog > .content-left > .post-header')
| + | |
- | .addClass('accordion-header')
| + | |
- | .click(function() {
| + | |
- | var $this = $(this);
| + | |
- | if ($this.hasClass('accordion-header-active')) return;
| + | |
- | var $post = $this.next('.post');
| + | |
- | $this.addClass('accordion-header-active');
| + | |
- | $this.siblings('.post-header').removeClass('accordion-header-active');
| + | |
- | $post.animate({ 'height': $post.data('height') });
| + | |
- | $post.siblings('.post').animate({ 'height': 0 });
| + | |
- | });
| + | |
- | | + | |
- | // initialize accordion
| + | |
- | $('#blog > .content-left > .post-header').addClass('accordion-header').first().addClass('accordion-header-active');
| + | |
- | calculateBlogPostHeights();
| + | |
- | }
| + | |
- | | + | |
- | });
| + | |
- | | + | |
| </script> | | </script> |
| <script src="http://html5up.net/uploads/demos/big-picture/js/skel.min.js"></script> | | <script src="http://html5up.net/uploads/demos/big-picture/js/skel.min.js"></script> |
Line 164: |
Line 17: |
| #videocontainer { | | #videocontainer { |
| background: rgba(0, 0, 0, 0.85); | | background: rgba(0, 0, 0, 0.85); |
| + | position: absolute; |
| + | top: 0px; |
| height: 100%; | | height: 100%; |
| width: 100%; | | width: 100%; |
| display: none; | | display: none; |
- | position: absolute;
| |
- | top: 50px;
| |
| margin-left: auto; | | margin-left: auto; |
| margin-right: auto; | | margin-right: auto; |
Line 176: |
Line 29: |
| #videocontainer iframe { | | #videocontainer iframe { |
| | | |
- | position: absolute; | + | position: relative; |
- | margin: 9% auto 0 auto;
| + | |
| } | | } |
| | | |
Line 1,750: |
Line 1,602: |
| <a href="#two" class="button style2 down anchored">Next</a> | | <a href="#two" class="button style2 down anchored">Next</a> |
| | | |
- | <iframe class="iframe-test style2 left" width="427" height="230" src="//www.youtube.com/embed/TYtlSqIPO7k" frameborder="0" allowfullscreen></iframe> | + | <iframe width="854" height="510" src="//www.youtube.com/embed/2pm9u1E8k3s" frameborder="0" allowfullscreen></iframe> |
| | | |
| </section> | | </section> |
Lorem ipsum dolor sit amet et sapien sed elementum egestas dolore condimentum.
Fusce blandit ultrices sapien, in accumsan orci rhoncus eu. Sed sodales venenatis arcu,
id varius justo euismod in. Curabitur egestas consectetur magna urna.
Next
Lorem ipsum dolor sit amet et sapien sed elementum egestas dolore condimentum.
Fusce blandit ultrices sapien, in accumsan orci rhoncus eu. Sed sodales venenatis arcu,
id varius justo euismod in. Curabitur egestas consectetur magna urna.
Next