Ver Mensaje Individual
  #1 (permalink)  
Antiguo 22/04/2014, 10:45
alvarols
 
Fecha de Ingreso: diciembre-2008
Mensajes: 738
Antigüedad: 15 años, 5 meses
Puntos: 15
Problemas tratando de hacer elementos que sean responsivos y que roten (flip)

Estoy hacieno un layout para un portafolio de proyectos donde al pasar el mouse por cada item, este gire (que es algo que está como de moda).

El problema es que quiero que el tamaño de estos elementos se ajusten al tamaño de la pantalla y que sean responsivos y parece que hay un conflicto porque tengo que poner ancho y alto definidos, si no no se ven los elementos completos.

Este es el HTML "está en Wordpress por lo tanto es un loop en PHP"

Código PHP:
Ver original
  1. <?php query_posts( 'posts_per_page=12' );?>
  2.             <?php if(have_posts()) : ?><?php while(have_posts()) : the_post(); ?>
  3.                
  4.                     <div class="col2 span_1_of_3">
  5.                     <div class="flip-container" ontouchstart="this.classList.toggle('hover');">
  6.                         <div class="flipper">
  7.                             <div class="front">
  8.                                 <a href="<?php the_permalink(); ?>"><?php the_post_thumbnail('portfolio'); ?></a>
  9.                             </div>
  10.                             <div class="back">
  11.                                 <div class="backtabla">
  12.                                     <?php the_title(); ?>
  13.                                 </div>
  14.                             </div>
  15.                         </div>
  16.                     </div>
  17.                    
  18.                 </div>
  19.                
  20.             <?php endwhile; ?>
  21.             <?php endif; ?>

Este es el CSS

Código CSS:
Ver original
  1. .span_1_of_3 {
  2.     width: 32.2%;
  3.         padding:7.2px;
  4.         -webkit-box-sizing: border-box; /* Safari/Chrome, other WebKit */ -moz-box-sizing: border-box; /* Firefox, other Gecko */ box-sizing: border-box;
  5.         margin:0px 12px 3px 0px;
  6. }
  7.  
  8. .flip-container {
  9.   -webkit-perspective: 1000;
  10.   -moz-perspective: 1000;
  11.   -o-perspective: 1000;
  12.   perspective: 1000;
  13.  
  14. }
  15. .flip-container:hover{
  16.     z-index:1000000;
  17. }
  18.     .flip-container:hover .flipper,  
  19.   .flip-container.hover .flipper {
  20.         -webkit-transform: rotateY(180deg);
  21.         -moz-transform: rotateY(180deg);
  22.     -o-transform: rotateY(180deg);
  23.         transform: rotateY(180deg);
  24.     }
  25.  
  26.  
  27. // ESTA ES LA PARTE DONDE DECLARO EN ABSOLUTOS, SI DECLARO EN PORCENTAJE O CON max-width y/o max-height SOLO SE VEN UNAS FRANJAS HORIZONTALES
  28.  
  29. .flip-container, .front, .back {
  30.     width: 395px;
  31.     height: 263px;
  32.  
  33. }
  34.  
  35. .flipper {
  36.     -webkit-transition: 0.6s;
  37.     -webkit-transform-style: preserve-3d;
  38.  
  39.     -moz-transition: 0.6s;
  40.     -moz-transform-style: preserve-3d;
  41.  
  42.   -o-transition: 0.6s;
  43.     -o-transform-style: preserve-3d;
  44.  
  45.     transition: 0.6s;
  46.     transform-style: preserve-3d;
  47.  
  48.     position: relative;
  49. }
  50.  
  51. .front, .back {
  52.     -webkit-backface-visibility: hidden;
  53.     -moz-backface-visibility: hidden;
  54.   -o-backface-visibility: hidden;
  55.     backface-visibility: hidden;
  56.  
  57.     position: absolute;
  58.     top: 0;
  59.     left: 0;
  60. }
  61.  
  62. .front {
  63.     z-index: 2;
  64. }
  65.  
  66. .back {
  67.     display:table;
  68.     -webkit-transform: rotateY(180deg);
  69.     -moz-transform: rotateY(180deg);
  70.   -o-transform: rotateY(180deg);
  71.     transform: rotateY(180deg);
  72.  
  73.     background: #282828;
  74.     color:#fff;
  75.     text-align:center;
  76.     z-index:1000 !important;
  77. }
  78.  
  79. .backtabla{
  80.     display: table-cell;
  81.     vertical-align: middle;
  82. }
  83.  
  84. .front .name {
  85.     font-size: 2em;
  86.     display: inline-block;
  87.     background: rgba(33, 33, 33, 0.9);
  88.     color: #f8f8f8;
  89.     font-family: Courier;
  90.     padding: 5px 10px;
  91.     border-radius: 5px;
  92.     bottom: 60px;
  93.     left: 25%;
  94.     position: absolute;
  95.     text-shadow: 0.1em 0.1em 0.05em #333;
  96.  
  97.     -webkit-transform: rotate(-20deg);
  98.     -moz-transform: rotate(-20deg);
  99.   -o-transform: rotate(-20deg);
  100.     transform: rotate(-20deg);
  101. }
  102.  
  103.  
  104.  
  105. .back p {
  106.     position: absolute;
  107.     bottom: 40px;
  108.     left: 0;
  109.     right: 0;
  110.     text-align: center;
  111.     padding: 0 20px;
  112.   font-family: arial;
  113.   line-height: 2em;
  114. }
  115.  
  116. .section2 .span_1_of_3 {
  117.     -webkit-transform: scale(1,1);
  118.  
  119.  
  120. }
  121.  
  122. .section2 .span_1_of_3:hover {
  123.    
  124. }
  125. @media only screen and (max-width: 1100px) {
  126.     .span_1_of_3{
  127.         width:48.2%;
  128.     }
  129.  
  130. }
  131. @media only screen and (max-width: 715px) {
  132.  
  133.     .section2 {
  134.     clear: both;
  135.     padding:15px 3% 0px 3%;
  136. }
  137.     .span_1_of_3{
  138.         margin:0 auto;
  139.         width:100%;
  140.     }
  141.     .flip-container, .front, .back {
  142.     width: 300px;
  143.     height: 200px;
  144. }
  145. }
  146. @media only screen and (max-width: 400px) {
  147.         .span_3_of_3 {
  148.         width: 100%;
  149.        
  150.     }
  151.     .span_2_of_3 {
  152.         width: 100%;
  153.     }
  154.     .span_1_of_3 {
  155.         width: 100%;
  156.         margin:0px 0px 0px 0px;
  157.     }
  158.     .section2{
  159.        
  160.     }
  161. }
  162. /*  GO FULL WIDTH AT LESS THAN 480 PIXELS */
  163.  
  164. @media only screen and (max-width: 900px) {
  165.     .span_2_of_2 {
  166.         width: 100%;
  167.     }
  168.     .span_1_of_2 {
  169.         width: 100%;
  170.     }
  171.     .section{
  172.         width:auto;
  173.     }
  174.     #blog{
  175.         margin:0px;
  176.         padding:0px;
  177.     }
  178. }