Advertisement
MrPauloeN

Okienko Modal jako wysuwany prawy/lewy panel HTML + CSS

May 14th, 2017
177
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
HTML 5 4.99 KB | None | 0 0
  1. <div class="container demo">
  2.    
  3.    
  4.     <div class="text-center">
  5.         <button type="button" class="btn btn-demo" data-toggle="modal" data-target="#myModal">
  6.             Left Sidebar Modal
  7.         </button>
  8.  
  9.         <button type="button" class="btn btn-demo" data-toggle="modal" data-target="#myModal2">
  10.             Right Sidebar Modal
  11.         </button>
  12.     </div>
  13.  
  14.     <!-- Modal -->
  15.     <div class="modal left fade" id="myModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel">
  16.         <div class="modal-dialog" role="document">
  17.             <div class="modal-content">
  18.  
  19.                 <div class="modal-header">
  20.                     <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
  21.                     <h4 class="modal-title" id="myModalLabel">Left Sidebar</h4>
  22.                 </div>
  23.  
  24.                 <div class="modal-body">
  25.                     <p>Anim pariatur cliche reprehenderit, enim eiusmod high life accusamus terry richardson ad squid. 3 wolf moon officia aute, non cupidatat skateboard dolor brunch. Food truck quinoa nesciunt laborum eiusmod. Brunch 3 wolf moon tempor, sunt aliqua put a bird on it squid single-origin coffee nulla assumenda shoreditch et. Nihil anim keffiyeh helvetica, craft beer labore wes anderson cred nesciunt sapiente ea proident. Ad vegan excepteur butcher vice lomo. Leggings occaecat craft beer farm-to-table, raw denim aesthetic synth nesciunt you probably haven't heard of them accusamus labore sustainable VHS.
  26.                     </p>
  27.                 </div>
  28.  
  29.             </div><!-- modal-content -->
  30.         </div><!-- modal-dialog -->
  31.     </div><!-- modal -->
  32.    
  33.     <!-- Modal -->
  34.     <div class="modal right fade" id="myModal2" tabindex="-1" role="dialog" aria-labelledby="myModalLabel2">
  35.         <div class="modal-dialog" role="document">
  36.             <div class="modal-content">
  37.  
  38.                 <div class="modal-header">
  39.                     <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
  40.                     <h4 class="modal-title" id="myModalLabel2">Right Sidebar</h4>
  41.                 </div>
  42.  
  43.                 <div class="modal-body">
  44.                     <p>Anim pariatur cliche reprehenderit, enim eiusmod high life accusamus terry richardson ad squid. 3 wolf moon officia aute, non cupidatat skateboard dolor brunch. Food truck quinoa nesciunt laborum eiusmod. Brunch 3 wolf moon tempor, sunt aliqua put a bird on it squid single-origin coffee nulla assumenda shoreditch et. Nihil anim keffiyeh helvetica, craft beer labore wes anderson cred nesciunt sapiente ea proident. Ad vegan excepteur butcher vice lomo. Leggings occaecat craft beer farm-to-table, raw denim aesthetic synth nesciunt you probably haven't heard of them accusamus labore sustainable VHS.
  45.                     </p>
  46.                 </div>
  47.  
  48.             </div><!-- modal-content -->
  49.         </div><!-- modal-dialog -->
  50.     </div><!-- modal -->
  51.    
  52.    
  53. </div><!-- container -->
  54.  
  55. <footer class="demo-footer">
  56.     <a href="http://www.bootpen.com" target="_blank">Get more code snippets</a>
  57. </footer>
  58.  
  59.  
  60.  
  61. /*******************************
  62. * MODAL AS LEFT/RIGHT SIDEBAR
  63. * Add "left" or "right" in modal parent div, after class="modal".
  64. * Get free snippets on bootpen.com
  65. *******************************/
  66.     .modal.left .modal-dialog,
  67.     .modal.right .modal-dialog {
  68.         position: fixed;
  69.         margin: auto;
  70.         width: 320px;
  71.         height: 100%;
  72.         -webkit-transform: translate3d(0%, 0, 0);
  73.             -ms-transform: translate3d(0%, 0, 0);
  74.              -o-transform: translate3d(0%, 0, 0);
  75.                 transform: translate3d(0%, 0, 0);
  76.     }
  77.  
  78.     .modal.left .modal-content,
  79.     .modal.right .modal-content {
  80.         height: 100%;
  81.         overflow-y: auto;
  82.     }
  83.    
  84.     .modal.left .modal-body,
  85.     .modal.right .modal-body {
  86.         padding: 15px 15px 80px;
  87.     }
  88.  
  89. /*Left*/
  90.     .modal.left.fade .modal-dialog{
  91.         left: -320px;
  92.         -webkit-transition: opacity 0.3s linear, left 0.3s ease-out;
  93.            -moz-transition: opacity 0.3s linear, left 0.3s ease-out;
  94.              -o-transition: opacity 0.3s linear, left 0.3s ease-out;
  95.                 transition: opacity 0.3s linear, left 0.3s ease-out;
  96.     }
  97.    
  98.     .modal.left.fade.in .modal-dialog{
  99.         left: 0;
  100.     }
  101.        
  102. /*Right*/
  103.     .modal.right.fade .modal-dialog {
  104.         right: -320px;
  105.         -webkit-transition: opacity 0.3s linear, right 0.3s ease-out;
  106.            -moz-transition: opacity 0.3s linear, right 0.3s ease-out;
  107.              -o-transition: opacity 0.3s linear, right 0.3s ease-out;
  108.                 transition: opacity 0.3s linear, right 0.3s ease-out;
  109.     }
  110.    
  111.     .modal.right.fade.in .modal-dialog {
  112.         right: 0;
  113.     }
  114.  
  115. /* ----- MODAL STYLE ----- */
  116.     .modal-content {
  117.         border-radius: 0;
  118.         border: none;
  119.     }
  120.  
  121.     .modal-header {
  122.         border-bottom-color: #EEEEEE;
  123.         background-color: #FAFAFA;
  124.     }
  125.  
  126. /* ----- v CAN BE DELETED v ----- */
  127. body {
  128.     background-color: #78909C;
  129. }
  130.  
  131. .demo {
  132.     padding-top: 60px;
  133.     padding-bottom: 110px;
  134. }
  135.  
  136. .btn-demo {
  137.     margin: 15px;
  138.     padding: 10px 15px;
  139.     border-radius: 0;
  140.     font-size: 16px;
  141.     background-color: #FFFFFF;
  142. }
  143.  
  144. .btn-demo:focus {
  145.     outline: 0;
  146. }
  147.  
  148. .demo-footer {
  149.     position: fixed;
  150.     bottom: 0;
  151.     width: 100%;
  152.     padding: 15px;
  153.     background-color: #212121;
  154.     text-align: center;
  155. }
  156.  
  157. .demo-footer > a {
  158.     text-decoration: none;
  159.     font-weight: bold;
  160.     font-size: 16px;
  161.     color: #fff;
  162. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement