Don't like ads? PRO users don't see any ads ;-)
Guest

Untitled

By: a guest on Sep 18th, 2012  |  syntax: None  |  size: 4.96 KB  |  hits: 14  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. <!DOCTYPE html>
  2. <html>
  3.  
  4. <head>
  5.  
  6.   <meta charset="UTF-8">
  7.   <!-- IF PEN IS PRIVATE -->
  8.   <!-- <meta name="robots" content="noindex"> -->
  9.   <!-- END -->
  10.  
  11.   <title>Print protection &middot; CodePen</title>
  12.  
  13.   <!--
  14.     Copyright (c) 2012 Moritz Gießmann, http://codepen.io/MoritzGiessmann
  15.  
  16.     Permission is hereby granted, free of charge, to any person obtaining
  17.     a copy of this software and associated documentation files (the
  18.     "Software"), to deal in the Software without restriction, including
  19.     without limitation the rights to use, copy, modify, merge, publish,
  20.     distribute, sublicense, and/or sell copies of the Software, and to
  21.     permit persons to whom the Software is furnished to do so, subject to
  22.     the following conditions:
  23.  
  24.     The above copyright notice and this permission notice shall be
  25.     included in all copies or substantial portions of the Software.
  26.  
  27.     THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
  28.     EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
  29.     MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
  30.     NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
  31.     LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
  32.     OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
  33.     WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
  34.   -->
  35.  
  36.   <link rel="stylesheet" href="http://codepen.io/stylesheets/css/normalize.css">
  37.  
  38.   <style>
  39. /**
  40.  * This may be useful for preventing people trying to print the internet *hrhr*
  41.  * Put this piece of CSS into your @media 'all' or 'print' CSS and no
  42.  * one will ever print your website again :D
  43.  *
  44.  * @author: @MoritzGiessmann, http://moritz-giessmann.de
  45.  */
  46.  
  47. @media print {
  48.         body * {
  49.                 display: none!important;
  50.         }
  51.  
  52.         body:before {
  53.                 content:'One does not simply print the internet!'!important;
  54.                 font-size:100px!important;
  55.                 color:#900!important;
  56.         }
  57. }
  58.  
  59. /* Not needed for making the internet printers going insane */
  60. body {
  61.   padding:5em;
  62. }
  63.  
  64. .first {
  65.   color:#900;
  66.   font-size:100px;
  67. }
  68.   </style>
  69.  
  70.   <style>
  71.     #codepen-footer, #codepen-footer * {
  72.       -webkit-box-sizing: border-box !important;
  73.       -moz-box-sizing: border-box !important;
  74.       box-sizing: border-box !important;
  75.     }
  76.     #codepen-footer {
  77.       display: block !important;
  78.       position: fixed !important;
  79.       bottom: 0 !important;
  80.       left: 0 !important;
  81.       width: 100% !important;
  82.       padding: 0 10px !important;
  83.       margin: 0 !important;
  84.       height: 30px !important;
  85.       line-height: 30px !important;
  86.       font-size: 12px !important;
  87.       color: #eeeeee !important;
  88.       background-color: #505050 !important;
  89.       text-align: left !important;
  90.       background: -webkit-linear-gradient(top, #505050, #383838) !important;
  91.       background: -moz-linear-gradient(top, #505050, #383838) !important;
  92.       background: -ms-linear-gradient(top, #505050, #383838) !important;
  93.       background: -o-linear-gradient(top, #505050, #383838) !important;
  94.       border-top: 1px solid black !important;
  95.       border-bottom: 1px solid black !important;
  96.       border-radius: 0 !important;
  97.       border-image: none !important;
  98.       box-shadow: inset 0 1px 0 #6e6e6e, 0 2px 2px rgba(0, 0, 0, 0.4) !important;
  99.       z-index: 300 !important;
  100.       font-family: "Lucida Grande", "Lucida Sans Unicode", Tahoma, sans-serif !important;
  101.       letter-spacing: 0 !important;
  102.       word-spacing: normal !important;
  103.       word-spacing: 0 !important;
  104.       -webkit-transform: none !important;
  105.       -moz-transform: none !important;
  106.       -ms-transform: none !important;
  107.       -o-transform: none !important;
  108.       transform: none !important;
  109.     }
  110.     #codepen-footer a {
  111.       color: #a7a7a7 !important;
  112.       text-decoration: none !important;
  113.       text-shadow: none !important;
  114.       border: 0 !important;
  115.     }
  116.     #codepen-footer a:hover {
  117.       color: white !important;
  118.     }
  119.   </style>
  120.  
  121.   <script>
  122.     // Kill alerts, confirmations and prompts
  123.     // window.alert   = function(){}; we're going to allow alerts for now
  124.     window.confirm = function(){};
  125.     window.prompt  = function(){};
  126.     window.open    = function(){};
  127.     window.print   = function(){};
  128.   </script>
  129.  
  130.   <script src="http://codepen.io/javascripts/libs/prefixfree.min.js"></script>
  131.  
  132. </head>
  133.  
  134. <body>
  135.  
  136.   <h1 class="first">Try to print this!</h1>
  137. <p>Does't work? Strange text on your paper? <a href="http://codepen.io/MoritzGiessmann/pen/bpJLi">Here's why. (Code)</a></p>
  138. <p><strong>Brought to you by:</strong><br>
  139. <a href="http://twitter.com/moritzgiessmann">@MoritzGiessmann</a><br>
  140. <a href="http://moritz-giessmann.de">moritz-giessmann.de</a>
  141. </p>
  142.  
  143.   <script src="http://code.jquery.com/jquery-latest.js"></script>
  144.   <script src="http://codepen.io/javascripts/libs/modernizr.js"></script>
  145.  
  146.   <div id="codepen-footer">
  147.  
  148.     <a style="color: #f73535 !important;" href="https://codepen.wufoo.com/forms/m7x3r3/def/field14=" target="_blank">Report Abuse</a>
  149.  
  150.     &nbsp;
  151.  
  152.     <a href="/MoritzGiessmann/pen/bpJLi" target="_blank">Edit this Pen</a>
  153.   </div>
  154.  
  155. </body>
  156.  
  157. </html>