Guest

Untitled

By: a guest on Jan 24th, 2012  |  syntax: HTML  |  size: 4.40 KB  |  hits: 3  |  expires: Never
download  |  raw  |  embed  |  report abuse
Copied
  1.                 <style type="text/css">
  2.         #blackclose a, #blackclose a:visited{
  3.                 text-decoration: none;
  4.                 font-family: "Arial",Helvetica,sans-serif;
  5.         }
  6.         #overlayblack{
  7.            background: -moz-radial-gradient(center center 45deg, circle closest-side, transparent 0pt, black 350px) repeat scroll 0 0 transparent;
  8.            background: -webkit-gradient(radial, center center, 0, center center, 350, from(transparent), to(rgba(0, 0, 0, 1)));
  9.                 background: -o-radial-gradient(center, circle cover, rgba(0,0,0,0) 0%,rgba(0,0,0,0.74) 5%,rgba(0,0,0,1) 10%,rgba(0,0,0,1) 100%); /* Opera 12+ */
  10.                 background: -ms-radial-gradient(center, circle cover, rgba(0,0,0,0) 0%,rgba(0,0,0,0.74) 10%,rgba(0,0,0,1) 19%,rgba(0,0,0,1) 100%); /* IE10+ */
  11.                 background: radial-gradient(center, circle cover, rgba(0,0,0,0) 0%,rgba(0,0,0,0.74) 10%,rgba(0,0,0,1) 19%,rgba(0,0,0,1) 100%); /* W3C */
  12.            height: 100%;
  13.            left: 0;
  14.            pointer-events: none;
  15.            position: absolute;
  16.            top: 0;
  17.            width: 200%;
  18.            bottom: 0;
  19.            top: 0;
  20.            right: 0;
  21.            left: 0;
  22.            z-index: 2003;
  23.         }
  24.         #blackclose{
  25.            -moz-box-sizing: border-box;
  26.            box-sizing: border-box;
  27.            text-align: center;
  28.            width: 100%;
  29.            left: 0;
  30.            position: fixed;
  31.            top: 50%;
  32.            z-index: 2004;
  33.            background: #000;
  34.            padding: 20px 0;
  35.            margin-top: -50px;
  36.         }
  37.         #blackclose .hard{
  38.                 font-size: 50px;
  39.         }
  40.         #blackclose a{font-size: 12px; margin-right: 10px; color: #fff; margin-top: 10px;}
  41.         #blackclose p {padding: 0px; margin: 0px;}
  42.         #blackclose p a{color: #fff; font-size: 30px; padding-top: 20px;}
  43.         #blackclose .fright{ float:right; }
  44. </style>
  45. <script type="text/javascript">
  46. $(document).ready(function(){
  47. if (new Date() > (new Date("2012/01/24 00:00")) && new Date() < new Date("2012/01/25 00:00"))
  48.         {
  49.          function getBlackdownCookie()
  50.       {
  51.               var i, name, value, cookies = document.cookie.split(";");
  52.                for (i = 0; i < cookies.length; i++)
  53.               {
  54.                       name =cookies[i].substr(0, cookies[i].indexOf("="));
  55.                       value = cookies[i].substr(cookies[i].indexOf("=") + 1);
  56.                       name = name.replace(/^\s+|\s+$/g,"");
  57.                       if (name == "blackdownCookie")
  58.                       {
  59.                               return unescape(name);
  60.                       }
  61.               }
  62.       }
  63.  
  64.       function setBlackdownCookie()
  65.       {
  66.               var exdate = new Date();
  67.               exdate.setDate(exdate.getDate() + 500);
  68.               document.cookie = "blackdownCookie" + "=" + ("1; expires=" + exdate.toUTCString());
  69.       }
  70.  
  71.       function checkBlackdownCookie()
  72.       {
  73.               var username = getBlackdownCookie("blackdownCookie");
  74.               return (username != null && username != "");
  75.       }
  76.  
  77.       if (!checkBlackdownCookie())
  78.       {
  79.               $('body').append('<div id="overlayblack"></div>');
  80.                $('body').css('overflow-x','hidden');
  81.  
  82. // tu jest liczona wysokosc stony - podany kod dziala na wykop.pl, prosze dostosowac go do wlasnego serwisu
  83.                var siteheight = $('body').outerHeight();
  84.  
  85.  
  86. // szerokosc strony
  87.                var sitewidth = $('body').outerWidth();
  88.  
  89. // ustawienie wysokosci warstwy
  90.                $('#overlayblack').css('height', siteheight + 400);
  91.                var mouseX = 0;
  92.                var mouseY = 0;
  93.                        $(document).mousemove( function(e) {
  94.                                mouseX = e.pageX - (sitewidth / .2);
  95.                                mouseY = e.pageY - ((siteheight + 400)/2);
  96.  
  97.                                $('#overlayblack').css({backgroundPosition: mouseX + 'px' + ' ' + mouseY + 'px' });
  98.                        });
  99.  
  100. // 'http://c3416512.r12.cf0.rackcdn.com/noacta.html' prosze podmienic na odpowiedni adres do Panstwa serwisu
  101.                $('body').append('<div id="blackclose"><a href="#" class="fright">zamknij</a><p><a href="/noacta">Niebawem tak może wyglądać internet<br /><span class="hard">NIE DLA ACTA!</span></a></p></div>');
  102.  
  103.                $('#blackclose a').click(function(){
  104.                        $('#overlayblack').remove();
  105.                        $('#blackclose').remove();
  106.                        setBlackdownCookie();
  107.                });
  108.                            //jak ktos nie kliknie po 10 sekundach to automatycznie blokujemy pokazywanie
  109.                            setTimeout(function(){
  110.                                    setBlackdownCookie();
  111.                            }, 10000);
  112.        }
  113. }
  114. });
  115. </script>