Comunidad de diseño web y desarrollo en internet online

Super Nintendo y Mario Bros en CSS3

Este es mi primer post en Cristalab y quiero compartir con ustedes uno de mis experimentos, se trata de un gráfico que parece hecho en Illustrator pero en realidad es una de las pruebas que demuestran el poder de CSS3 y HTML5.



Propiedades utilizadas en este Lab


:before / :after } gracias a esta propiedad podemos realizar dos figuras adicionales a la original sin necesidad de crear nuevos divs o elementos en el html + su respectivo estilo.

Código :

#estrella{
    margin: -15px -34px;     position: relative;     display: block;     color: red;     width: 0px;     height: 0px;     border-right:  100px solid transparent;     border-bottom: 70px  solid red;     border-left:   100px solid transparent;     -moz-transform:    rotate(35deg);     -webkit-transform: rotate(35deg);     -ms-transform:     rotate(35deg);     -o-transform:      rotate(35deg);
}
  #estrella:before{
    border-bottom: 80px solid red;     border-left: 30px solid transparent;     border-right: 30px solid transparent;     position: absolute;     height: 0;     width: 0;     top: -45px;     left: -65px;     display: block;     content: '';     -webkit-transform: rotate(-35deg);     -moz-transform:    rotate(-35deg);     -ms-transform:     rotate(-35deg);     -o-transform:      rotate(-35deg);
} 
  #estrella:after{
    position: absolute;     display: block;     color: red;     top: 3px;     left: -105px;     width: 0px;     height: 0px;     border-right: 100px solid transparent;     border-bottom: 70px solid red;     border-left: 100px solid transparent;     -webkit-transform: rotate(-70deg);     -moz-transform:    rotate(-70deg);     -ms-transform:     rotate(-70deg);     -o-transform:      rotate(-70deg);     content: '';
}  


border-radius avanzado


Muchas de las propiedades básicas de css sos extendibles agregando unos cuantos valores más, en este caso tenemos un simple cuadro con un border-radius que no solamente especifica las medidas de cada esquina, sino que divide cada esquina en 2, permitiendo así realizar figuras geométricas mas inorgánicas.

Código :

#pantalla-borde
{
    width: 294px;  
    height: 259px;    
    background-color: #615D5D;  
    border-radius: 143px 143px 143px 143px / 30px 30px 30px 30px;
}


Igualmente ocurre con figuras como Triángulos que se modifican completamente.

Código :

#rocas1 {
border-bottom: 53px solid #99993C;
border-left: 52px solid rgba(0, 0, 0, 0);
border-right: 53px solid rgba(0, 0, 0, 0);
height: 0;
width: 19px;
}


Otra propiedad que muchos conocen pero pocos explotan es el shadow-box que aparte de permitirnos realizar sombras bonitas, también podemos crear figuras pixel por pixel, es algo dispendioso pero su resultado es bueno...

Código :

#token2{
    border-radius: 0;  
display: inline-block;  
width: 1px;  
height: 1px;  
box-shadow: 0px 0px rgba(0, 0, 0, 0),0px 1px rgba(183, 153, 10, 0.1),0px 2px rgba(65, 65, 60, 0.98),0px 3px rgba(59, 61, 63, 1),0px 4px rgba(59, 61, 63, 1),0px 5px rgba(54, 38, 13, 1),0px 6px rgba(59, 60, 60, 1),0px 7px rgba(53, 38, 13, 1),0px 8px rgba(53, 36, 10, 1),0px 9px rgba(53, 36, 10, 1),0px 10px rgba(53, 36, 10, 1),0px 11px rgba(53, 36, 10, 1),0px 12px rgba(53, 37, 10, 1),0px 13px rgba(31, 17, 3, 0.95),0px 14px rgba(144, 110, 11, 0.09),0px 15px rgba(0, 0, 0, 0),1px 0px rgba(182, 157, 12, 0.08),1px 1px rgba(62, 62, 59, 0.98),1px 2px rgba(221, 229, 237, 1),1px 3px rgba(232, 230, 196, 1),1px 4px rgba(179, 185, 188, 1),1px 5px rgba(160, 113, 39, 1),1px 6px rgba(228, 223, 182, 1),1px 7px rgba(218, 161, 43, 1),1px 8px rgba(217, 156, 32, 1),1px 9px rgba(217, 156, 32, 1),1px 10px rgba(217, 156, 32, 1),1px 11px rgba(217, 156, 32, 1),1px 12px rgba(209, 142, 37, 1),1px 13px rgba(142, 88, 20, 1),1px 14px rgba(37, 22, 4, 0.89),1px 15px rgba(127, 104, 11, 0.09),2px 0px rgba(13, 12, 4, 1),2px 1px rgba(219, 228, 236, 1),2px 2px rgba(232, 231, 198, 1),2px 3px rgba(194, 166, 24, 1),2px 4px rgba(59, 59, 52, 1),2px 5px rgba(51, 54, 54, 1),2px 6px rgba(184, 156, 17, 1),2px 7px rgba(242, 204, 18, 1),2px 8px rgba(246, 207, 18, 1),2px 9px rgba(246, 207, 18, 1),2px 10px rgba(246, 207, 18, 1),2px 11px rgba(246, 207, 18, 1),2px 12px rgba(219, 160, 32, 1),2px 13px rgba(208, 142, 37, 1),2px 14px rgba(122, 71, 15, 1),2px 15px rgba(7, 4, 1, 1),3px 0px rgba(13, 12, 4, 1),3px 1px rgba(219, 228, 234, 1),3px 2px rgba(198, 169, 26, 1),3px 3px rgba(57, 57, 50, 1),3px 4px rgba(219, 227, 235, 1),3px 5px rgba(229, 238, 246, 1),3px 6px rgba(18, 18, 18, 1),3px 7px rgba(228, 193, 17, 1),3px 8px rgba(246, 207, 18, 1),3px 9px rgba(246, 207, 18, 1),3px 10px rgba(246, 207, 18, 1),3px 11px rgba(246, 207, 18, 1),3px 12px rgba(246, 207, 18, 1),3px 13px rgba(211, 146, 36, 1),3px 14px rgba(122, 71, 15, 1),3px 15px rgba(7, 4, 1, 1),4px 0px rgba(13, 11, 4, 1),4px 1px rgba(214, 210, 199, 1),4px 2px rgba(15, 15, 14, 1),4px 3px rgba(217, 226, 234, 1),4px 4px rgba(229, 238, 247, 1),4px 5px rgba(229, 238, 246, 1),4px 6px rgba(18, 18, 19, 1),4px 7px rgba(188, 159, 14, 1),4px 8px rgba(203, 170, 15, 1),4px 9px rgba(244, 206, 18, 1),4px 10px rgba(207, 174, 15, 1),4px 11px rgba(203, 170, 15, 1),4px 12px rgba(242, 203, 18, 1),4px 13px rgba(211, 146, 36, 1),4px 14px rgba(122, 71, 15, 1),4px 15px rgba(7, 4, 1, 1),5px 0px rgba(12, 10, 1, 1),5px 1px rgba(197, 134, 35, 1),5px 2px rgba(14, 11, 5, 1),5px 3px rgba(217, 226, 234, 1),5px 4px rgba(229, 238, 247, 1),5px 5px rgba(196, 203, 210, 1),5px 6px rgba(14, 15, 16, 1),5px 7px rgba(34, 36, 37, 1),5px 8px rgba(37, 39, 40, 1),5px 9px rgba(201, 171, 17, 1),5px 10px rgba(53, 51, 38, 1),5px 11px rgba(38, 39, 40, 1),5px 12px rgba(190, 162, 18, 1),5px 13px rgba(208, 143, 36, 1),5px 14px rgba(122, 71, 15, 1),5px 15px rgba(7, 4, 1, 1),6px 0px rgba(12, 10, 1, 1),6px 1px rgba(197, 134, 35, 1),6px 2px rgba(14, 11, 5, 1),6px 3px rgba(217, 226, 234, 1),6px 4px rgba(228, 237, 245, 1),6px 5px rgba(16, 16, 17, 1),6px 6px rgba(1, 2, 2, 1),6px 7px rgba(213, 222, 229, 1),6px 8px rgba(230, 239, 248, 1),6px 9px rgba(12, 12, 12, 1),6px 10px rgba(210, 218, 225, 1),6px 11px rgba(230, 239, 247, 1),6px 12px rgba(25, 26, 26, 1),6px 13px rgba(193, 131, 34, 1),6px 14px rgba(122, 71, 15, 1),6px 15px rgba(7, 4, 1, 1),7px 0px rgba(12, 10, 1, 1),7px 1px rgba(197, 134, 35, 1),7px 2px rgba(14, 11, 5, 1),7px 3px rgba(217, 226, 234, 1),7px 4px rgba(228, 237, 245, 1),7px 5px rgba(16, 16, 17, 1),7px 6px rgba(1, 2, 1, 1),7px 7px rgba(213, 222, 229, 1),7px 8px rgba(230, 239, 248, 1),7px 9px rgba(12, 12, 12, 1),7px 10px rgba(210, 218, 225, 1),7px 11px rgba(230, 239, 247, 1),7px 12px rgba(25, 26, 26, 1),7px 13px rgba(193, 131, 34, 1),7px 14px rgba(122, 71, 15, 1),7px 15px rgba(7, 4, 1, 1),8px 0px rgba(12, 10, 1, 1),8px 1px rgba(197, 134, 35, 1),8px 2px rgba(14, 11, 5, 1),8px 3px rgba(217, 226, 234, 1),8px 4px rgba(228, 237, 246, 1),8px 5px rgba(38, 40, 41, 1),8px 6px rgba(25, 26, 27, 1),8px 7px rgba(215, 223, 231, 1),8px 8px rgba(210, 218, 225, 1),8px 9px rgba(34, 31, 13, 1),8px 10px rgba(192, 199, 204, 1),8px 11px rgba(209, 216, 223, 1),8px 12px rgba(45, 42, 25, 1),8px 13px rgba(194, 133, 34, 1),8px 14px rgba(122, 71, 15, 1),8px 15px rgba(7, 4, 1, 1),9px 0px rgba(12, 10, 1, 1),9px 1px rgba(197, 134, 35, 1),9px 2px rgba(14, 11, 5, 1),9px 3px rgba(217, 226, 234, 1),9px 4px rgba(229, 238, 247, 1),9px 5px rgba(229, 238, 247, 1),9px 6px rgba(229, 238, 247, 1),9px 7px rgba(231, 240, 248, 1),9px 8px rgba(19, 20, 20, 1),9px 9px rgba(236, 200, 18, 1),9px 10px rgba(50, 43, 4, 1),9px 11px rgba(30, 26, 3, 1),9px 12px rgba(224, 190, 17, 1),9px 13px rgba(210, 146, 36, 1),9px 14px rgba(122, 71, 15, 1),9px 15px rgba(7, 4, 1, 1),10px 0px rgba(12, 10, 1, 1),10px 1px rgba(197, 134, 35, 1),10px 2px rgba(27, 22, 6, 1),10px 3px rgba(206, 214, 221, 1),10px 4px rgba(228, 237, 246, 1),10px 5px rgba(229, 238, 247, 1),10px 6px rgba(229, 238, 247, 1),10px 7px rgba(219, 227, 234, 1),10px 8px rgba(31, 30, 20, 1),10px 9px rgba(236, 199, 17, 1),10px 10px rgba(246, 208, 18, 1),10px 11px rgba(246, 208, 18, 1),10px 12px rgba(246, 207, 18, 1),10px 13px rgba(211, 146, 36, 1),10px 14px rgba(122, 71, 15, 1),10px 15px rgba(7, 4, 1, 1),11px 0px rgba(12, 9, 1, 1),11px 1px rgba(199, 136, 36, 1),11px 2px rgba(240, 198, 20, 1),11px 3px rgba(35, 30, 6, 1),11px 4px rgba(202, 209, 215, 1),11px 5px rgba(212, 221, 228, 1),11px 6px rgba(213, 221, 228, 1),11px 7px rgba(35, 33, 19, 1),11px 8px rgba(229, 194, 17, 1),11px 9px rgba(246, 207, 18, 1),11px 10px rgba(246, 207, 18, 1),11px 11px rgba(246, 207, 18, 1),11px 12px rgba(243, 202, 19, 1),11px 13px rgba(210, 145, 36, 1),11px 14px rgba(122, 71, 15, 1),11px 15px rgba(7, 4, 1, 1),12px 0px rgba(11, 9, 1, 1),12px 1px rgba(194, 131, 34, 1),12px 2px rgba(208, 141, 37, 1),12px 3px rgba(240, 200, 20, 1),12px 4px rgba(29, 22, 4, 1),12px 5px rgba(15, 10, 3, 1),12px 6px rgba(16, 11, 3, 1),12px 7px rgba(227, 191, 18, 1),12px 8px rgba(244, 203, 19, 1),12px 9px rgba(244, 203, 19, 1),12px 10px rgba(244, 203, 19, 1),12px 11px rgba(244, 203, 19, 1),12px 12px rgba(211, 146, 36, 1),12px 13px rgba(203, 137, 36, 1),12px 14px rgba(122, 71, 15, 1),12px 15px rgba(7, 4, 1, 1),13px 0px rgba(25, 19, 1, 0.98),13px 1px rgba(104, 60, 12, 1),13px 2px rgba(196, 132, 34, 1),13px 3px rgba(200, 135, 35, 1),13px 4px rgba(200, 135, 35, 1),13px 5px rgba(200, 135, 35, 1),13px 6px rgba(200, 135, 35, 1),13px 7px rgba(201, 135, 35, 1),13px 8px rgba(201, 135, 35, 1),13px 9px rgba(201, 135, 35, 1),13px 10px rgba(201, 135, 35, 1),13px 11px rgba(201, 135, 35, 1),13px 12px rgba(200, 135, 35, 1),13px 13px rgba(122, 71, 15, 1),13px 14px rgba(107, 61, 12, 1),13px 15px rgba(15, 9, 2, 1),14px 0px rgba(0, 0, 0, 0),14px 1px rgba(17, 12, 1, 0.97),14px 2px rgba(107, 61, 12, 1),14px 3px rgba(112, 64, 13, 1),14px 4px rgba(112, 64, 13, 1),14px 5px rgba(112, 64, 13, 1),14px 6px rgba(112, 64, 13, 1),14px 7px rgba(112, 64, 13, 1),14px 8px rgba(112, 64, 13, 1),14px 9px rgba(112, 64, 13, 1),14px 10px rgba(112, 64, 13, 1),14px 11px rgba(112, 64, 13, 1),14px 12px rgba(112, 64, 13, 1),14px 13px rgba(112, 64, 12, 1),14px 14px rgba(14, 8, 1, 0.85),14px 15px rgba(85, 0, 0, 0.01),15px 0px rgba(0, 0, 0, 0),15px 1px rgba(0, 0, 0, 0),15px 2px rgba(14, 10, 1, 0.98),15px 3px rgba(7, 4, 1, 1),15px 4px rgba(6, 4, 1, 1),15px 5px rgba(6, 4, 1, 1),15px 6px rgba(6, 4, 1, 1),15px 7px rgba(6, 3, 1, 1),15px 8px rgba(5, 3, 1, 1),15px 9px rgba(5, 3, 1, 1),15px 10px rgba(5, 3, 1, 1),15px 11px rgba(5, 3, 1, 1),15px 12px rgba(5, 3, 1, 1),15px 13px rgba(5, 2, 0, 0.94),15px 14px rgba(0, 0, 0, 0),15px 15px rgba(0, 0, 0, 0);  
} 


Estos son los links de mi experimento <source>:

http://cristiangartner.com/css3/
https://github.com/gartner90/Super-Nintendo-Css3
http://codepen.io/gartner90/pen/vFwep

:cool:

¿Sabes SQL? ¿No-SQL? Aprende MySQL, PostgreSQL, MongoDB, Redis y más con el Curso Profesional de Bases de Datos que empieza el martes, en vivo.

Publica tu comentario

El autor de este artículo ha cerrado los comentarios. Si tienes preguntas o comentarios, puedes hacerlos en el foro

Entra al foro y participa en la discusión

o puedes...

¿Estás registrado en Cristalab y quieres
publicar tu URL y avatar?

¿No estás registrado aún pero quieres hacerlo antes de publicar tu comentario?

Registrate