Skip to content

Instantly share code, notes, and snippets.

@tyv
Created July 23, 2012 12:28
Show Gist options
  • Save tyv/3163370 to your computer and use it in GitHub Desktop.
Save tyv/3163370 to your computer and use it in GitHub Desktop.
reset css
@charset "utf-8";
/* reset css */
html, body, div, span, dl, dt, dd, pre, a, form, fieldset, img, input, textarea, blockquote, table, caption, tbody, tfoot, thead {margin: 0; padding: 0; }
img, iframe {border: 0; vertical-align: top; }
table {border-collapse: collapse; border-spacing: 0; }
input, textarea, select, a, div {outline: none; }
article, aside, details, figcaption, figure, footer, header, hgroup, menu, nav, time, section {display: block; margin: 0; padding: 0; }
/* fonts */
@font-face {
font-family: 'PT Sans';
src: url('fonts/pts55f_w.eot');
src: local('PT Sans'),
url('fonts/PTS55F_W.woff') format('woff'),
url('fonts/PTS55F_W.ttf') format('truetype'),
url('fonts/PTS55F_W.svg#PTSans-Regular') format('svg');
}
/* base */
html {
height: 100%;
overflow-y: scroll;
}
body {
font: normal 14px/1.3 'PT Sans', Tahoma, Verdana, sans-serif;
position: relative;
width: 100%;
min-width: 1000px;
min-height: 100%;
height: auto !important; height:100%;
color: #000;
background: #fff;
}
/* зачем весь этот base? */
.card
{
position: absolute;
width: 700px;
/* можно и желательно не ограничивать высоту
ты же завязываешься на количество текста, которое может быть сильно разным */
height: 320px;
left: 50%;
top: 50%;
margin: -160px 0 0 -350px;
background: #f1ecd0;
}
.card:after {
z-index: -1;
position: absolute;
content: "";
bottom: 15px;
right: 10px;
left: auto;
width: 350px;
/* опять на высоту завязка, можно же через bottom */
top: 300px;
-webkit-box-shadow: 0 12px 10px #888;
-moz-box-shadow: 0 12px 10px #888;
box-shadow: 0 12px 10px #888;
-webkit-transform: rotate(3deg);
-moz-transform: rotate(3deg);
-o-transform: rotate(3deg);
-ms-transform: rotate(3deg);
transform: rotate(3deg);
}
.close {
font-size: 30px;
line-height: 0.4;
text-align: center;
position: absolute;
right: 10px;
top: 10px;
width: 15px;
height: 15px;
/* зачем overflow? */
overflow: hidden;
color: #666;
z-index: 100;
cursor: pointer;
}
/* radio buttons effects */
input[type="radio"] {
display: none;
}
#photo-1:checked ~ .texts .text-1,
#photo-2:checked ~ .texts .text-2,
#photo-3:checked ~ .texts .text-3,
#photo-4:checked ~ .texts .text-4,
#photo-5:checked ~ .texts .text-5,
#photo-6:checked ~ .texts .text-6 {
opacity: 1;
top: 0;
}
#photo-1:checked ~ .photo-chooser label[for="photo-1"] img,
#photo-2:checked ~ .photo-chooser label[for="photo-2"] img,
#photo-3:checked ~ .photo-chooser label[for="photo-3"] img,
#photo-4:checked ~ .photo-chooser label[for="photo-4"] img,
#photo-5:checked ~ .photo-chooser label[for="photo-5"] img,
#photo-6:checked ~ .photo-chooser label[for="photo-6"] img {
-webkit-box-shadow: 0 0 5px #f4f4f4;
-moz-box-shadow: 0 0 5px #f4f4f4;
box-shadow: 0 0 5px #f4f4f4;
}
#photo-1:checked ~ .photo-chooser .photos {
left: 0;
}
#photo-2:checked ~ .photo-chooser .photos {
left: -100px;
}
#photo-3:checked ~ .photo-chooser .photos {
left: -200px;
}
#photo-4:checked ~ .photo-chooser .photos {
left: -300px;
}
#photo-5:checked ~ .photo-chooser .photos {
left: -400px;
}
#photo-6:checked ~ .photo-chooser .photos {
left: -500px;
}
/* photos */
.photo-chooser {
white-space: nowrap;
float: left;
position: relative;
margin: 60px 30px 0 50px;
width: 100px;
height: 151px;
overflow: hidden;
/* там кажется не градиента */
background-image: -moz-linear-gradient(top, #474747 0%, #474747 94%, #a3a3a3 94%, #a3a3a3 100%);
background-image: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#474747), color-stop(94%,#474747), color-stop(94%,#a3a3a3), color-stop(100%,#a3a3a3));
background-image: -webkit-linear-gradient(top, #474747 0%,#474747 94%,#a3a3a3 94%,#a3a3a3 100%);
background-image: -o-linear-gradient(top, #474747 0%,#474747 94%,#a3a3a3 94%,#a3a3a3 100%);
background: -ms-linear-gradient(top, #474747 0%,#474747 94%,#a3a3a3 94%,#a3a3a3 100%);
background-image: linear-gradient(to bottom, #474747 0%,#474747 94%,#a3a3a3 94%,#a3a3a3 100%);
-webkit-border-radius: 8px;
-moz-border-radius: 8px;
border-radius: 8px;
-webkit-box-shadow: 0 4px 10px #888;
-moz-box-shadow: 0 4px 10px #888;
box-shadow: 0 4px 10px #888;
}
.photo-chooser label {
display: inline-block;
margin: 100px 0 0 0;
padding: 5px;
}
.photo-chooser label img {
width: 30px;
height: 30px;
-webkit-border-radius: 4px;
-moz-border-radius: 4px;
border-radius: 4px;
cursor: pointer;
}
.photos {
position: absolute;
width: auto;
height: 100px;
overflow: hidden;
left: 0;
top: 0;
-webkit-transition: left 0.3s ease-in;
-moz-transition: left 0.3s ease-in;
-o-transition: left 0.3s ease-in;
transition: left 0.3s ease-in;
}
.photos div {
/* inline-block загрузится быстрее, особенно заметно если фоток много */
display: table-cell;
}
.photos div img {
width: 100px;
height: 100px;
-webkit-border-radius: 8px 8px 0 0;
-moz-border-radius: 8px 8px 0 0;
border-radius: 8px 8px 0 0;
}
/* animation */
@-webkit-keyframes label-roller {
from {-webkit-transform: translateX(0); }
to {-webkit-transform: translateX(-140px); }
}
@-moz-keyframes label-roller {
from {-moz-transform: translateX(0); }
to {-moz-transform: translateX(-140px); }
}
@keyframes label-roller {
from {transform: translateX(0); }
to {transform: translateX(-140px); }
}
.animation-runner {
position: absolute;
bottom: 0;
left: 0;
height: 11px;
width: 100%;
background: #6c6c6c;
-webkit-border-radius: 0 0 8px 8px;
-moz-border-radius: 0 0 8px 8px;
border-radius: 0 0 8px 8px;
cursor: pointer;
}
.animation-runner:hover {
background: #a3a3a3;
}
.animation-runner ~ label {
-webkit-animation: 3s label-roller infinite alternate linear;
-moz-animation: 3s label-roller infinite alternate linear;
animation: 3s label-roller infinite alternate linear;
-webkit-transform: translate3d(0, 0, 0);
-webkit-animation-play-state: paused;
-moz-animation-play-state: paused;
animation-play-state: paused;
}
.animation-runner:hover ~ label {
-webkit-animation-play-state: running;
-moz-animation-play-state: running;
animation-play-state: running;
}
/* text */
.texts {
position: relative;
margin: 55px 0 0 0;
width: 410px;
/* опять высота */
height: 250px;
overflow: hidden;
}
.texts div {
position: absolute;
left: 0;
top: 100%;
/* зачем ширина? */
width: 100%;
height: auto;
opacity: 0;
-webkit-transition: opacity 0.4s ease-in;
-moz-transition: opacity 0.4s ease-in;
-o-transition: opacity 0.4s ease-in;
transition: opacity 0.4s ease-in;
}
.texts h1 {
margin: 0 0 10px 0;
padding: 1px 0;
line-height: 1.1;
}
.texts h1:first-letter {
color: red;
}
.texts p {
margin: 1px 0 15px 0;
padding: 1px 0;
}
{"view":"separate","fontsize":"110","seethrough":"","prefixfree":"1","page":"all"}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment