Guest User

Untitled

a guest
Apr 16th, 2013
87
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 2.92 KB | None | 0 0
  1. //PARTIE JAVASCRIPT
  2.     <script>
  3.         function toggleOverlay()
  4.         {
  5.             document.body.className = document.body.className.indexOf('overlaid') != -1 ? '' : 'overlaid';
  6.         }
  7.         document.addEventListener('DOMContentLoaded', function()
  8.         {
  9.             document.querySelector('.overlay').addEventListener('click', function(ev)
  10.             {
  11.                 if (/overlay|wrap/.test(ev.target.className)) toggleOverlay();
  12.             });
  13.         });
  14.     </script>
  15.  
  16. //PARTIE PHP
  17. $popup = <<<EOT
  18.         <div class="overlay">
  19.             <div class="wrap-outer">
  20.                 <div class="wrap">
  21.                     <div class="login">
  22.                         <h1>Connexion</h1>
  23.                         <hr/>
  24.                         <form method="GET" action="./accueil.php">
  25.                             <input type="text" style="border-style: solid; border-width: 1px; border-color: grey;" name="login" value="Login" onclick="this.value='';"/>
  26.                             <input type="password" style="border-style: solid; border-width: 1px; border-color: grey;" name="password" value="123456" onclick="this.value='';"/><br/>
  27.                             <input style="cursor:pointer; border:none; font-family:bellerose;color:grey;font-size:21px; background:none;" type="submit" value="Se Connecter">
  28.                         </form>
  29.                     </div>
  30.                 </div>
  31.             </div>
  32.         </div>
  33. EOT;
  34.  
  35. //PARTIE CSS
  36. /* Popup de connexion */
  37. body.overlaid .overlay
  38. {
  39.     transform: translateY(0);
  40.     z-index:20;
  41. }
  42.  
  43. .overlay
  44. {    
  45.     transform: translateY(-50000px);
  46.     position: fixed;
  47.     width: 100%;
  48.     height: 100%;
  49.     top: 0;
  50.     left: 0;
  51.     background: rgba(0,0,0,0.8);
  52.     z-index:20;
  53. }
  54. .overlay > .wrap-outer
  55. {
  56.     position: relative;
  57.     width: 100%;
  58.     height: 100%;
  59.     display: -webkit-box;
  60.     display: -moz-box;
  61.     display: box;
  62.     -webkit-box-orient: horizontal;
  63.     -moz-box-orient: horizontal;
  64.     box-orient: horizontal;
  65.     -webkit-box-align: stretch;
  66.     -moz-box-align: stretch;
  67.     box-align: stretch;
  68.     -webkit-box-pack: center;
  69.     -moz-box-pack: center;
  70.     box-pack: center;
  71.     z-index:20;
  72. }
  73. .overlay > .wrap-outer > .wrap
  74. {
  75.     display: -webkit-box;
  76.     display: -moz-box;
  77.     display: box;
  78.     -webkit-box-orient: vertical;
  79.     -moz-box-orient: vertical;
  80.     box-orient: vertical;
  81.     -webkit-box-align: stretch;
  82.     -moz-box-align: stretch;
  83.     box-align: stretch;
  84.     -webkit-box-pack: center;
  85.     -moz-box-pack: center;
  86.     box-pack: center;
  87.     z-index:20;
  88. }
  89.  
  90. .overlay > .wrap-outer > .wrap > *
  91. {
  92.     -webkit-box-flex: 0;
  93.     -moz-box-flex: 0;
  94.     box-flex: 0;
  95.     display: block;
  96.     z-index:20;
  97. }
  98.  
  99. .login
  100. {
  101.     width: 400px;
  102.     background: #080808;
  103.    border-radius: 10px;
  104.     padding: 15px;
  105.     color: grey;
  106.     font: 18px "bellerose";
  107.     text-align:center;
  108.     border-color:white;
  109.     border:solid;
  110.     z-index:20;
  111. }
  112.  
  113. .login h1
  114. {
  115.     margin: 0 0 15px;
  116.     color: white;
  117.     font: 24px "bellerose";
  118.     z-index:20;
  119. }
  120.  
  121. .login hr
  122. {
  123.     border: 0px;
  124.     background-color: white;
  125.     height: 1px;
  126.     z-index:20;
  127. }
Advertisement
Add Comment
Please, Sign In to add comment