Difference between revisions of "Template:IONIS Paris/CSS2"

Line 3,201: Line 3,201:
  
 
/* NOTEBOOK  */
 
/* NOTEBOOK  */
@import "bourbon";
 
 
// variables - colors
 
 
$main-text: #7f8c97; // main text
 
$link: #acb7c0; // anchor tags
 
$background: #e9f0f5; // body background color
 
 
$color-1: #303e49; // blue dark
 
$color-2: #c03b44; // red
 
$color-3: #ffffff; // white
 
$color-4: #75ce66; // green
 
$color-5: #f0ca45; // yellow
 
 
// variables - fonts
 
 
$primary-font: 'Droid Serif', serif;
 
$secondary-font: 'Open Sans', sans-serif;
 
 
 
 
@function calculateRem($size) {
 
  $remSize: $size / 16px;
 
  @return $remSize * 1rem;
 
}
 
 
@mixin font-size($size) {
 
  font-size: $size;
 
  font-size: calculateRem($size);
 
}
 
 
// mixins - border radius
 
 
@mixin border-radius($radius:.25em) {
 
  border-radius: $radius;
 
}
 
 
// layout - breakpoints
 
 
 
$S:    320px; 
 
$M:    768px;   
 
$L:    1170px;   
 
 
// layout - media queries
 
 
@mixin MQ($canvas) {
 
  @if $canvas == S {
 
  @media only screen and (min-width: $S) { @content; }
 
  }
 
  @else if $canvas == M {
 
  @media only screen and (min-width: $M) { @content; }
 
  }
 
  @else if $canvas == L {
 
  @media only screen and (min-width: $L) { @content; }
 
  }
 
}
 
 
 
/* --------------------------------  
 
/* --------------------------------  
  
Line 3,263: Line 3,206:
  
 
-------------------------------- */
 
-------------------------------- */
 
 
html * {
 
html * {
-webkit-font-smoothing: antialiased;
+
  -webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
+
  -moz-osx-font-smoothing: grayscale;
 
}
 
}
  
 
*, *:after, *:before {
 
*, *:after, *:before {
@include box-sizing(border-box);
+
  -webkit-box-sizing: border-box;
 +
  -moz-box-sizing: border-box;
 +
  box-sizing: border-box;
 
}
 
}
  
 
body {
 
body {
font: {
+
  font-size: 100%;
size: 100%;
+
  font-family: "Droid Serif", serif;
family: $primary-font;
+
  color: #7f8c97;
}
+
  background-color: #e9f0f5;
color: $main-text;
+
background-color: $background;
+
 
}
 
}
  
 
a {
 
a {
color: $link;
+
  color: #acb7c0;
text-decoration: none;
+
  text-decoration: none;
font-family: $secondary-font;
+
  font-family: "Open Sans", sans-serif;
 
}
 
}
  
 
img {
 
img {
max-width: 100%;
+
  max-width: 100%;
 
}
 
}
  
 
h1, h2 {
 
h1, h2 {
font-family: $secondary-font;
+
  font-family: "Open Sans", sans-serif;
font-weight: bold;
+
  font-weight: bold;
 
}
 
}
  
Line 3,302: Line 3,244:
  
 
-------------------------------- */
 
-------------------------------- */
 
+
.cd-container {
.cd-container { /* this class is used to give a max-width to the element it is applied to, and center it horizontally when it reaches that max-width */
+
  /* this class is used to give a max-width to the element it is applied to, and center it horizontally when it reaches that max-width */
width: 90%;
+
  width: 90%;
max-width: $L; // breakpoints inside partials > _layout.scss
+
  max-width: 1170px;
margin: 0 auto;
+
  margin: 0 auto;
 
+
}
&::after { /* clearfix */
+
.cd-container::after {
content: '';
+
  /* clearfix */
display: table;
+
  content: '';
clear: both;
+
  display: table;
}
+
  clear: both;
 
}
 
}
  
Line 3,320: Line 3,262:
  
 
-------------------------------- */
 
-------------------------------- */
 
 
header {
 
header {
height: 200px;
+
  height: 200px;
line-height: 200px;
+
  line-height: 200px;
text-align: center;
+
  text-align: center;
background: $color-1;
+
  background: #303e49;
 
+
}
h1 {
+
header h1 {
color: $color-3;
+
  color: #ffffff;
@include font-size(18px);
+
  font-size: 18px;
}
+
  font-size: 1.125rem;
 
+
}
@include MQ(L) {
+
@media only screen and (min-width: 1170px) {
height: 300px;
+
  header {
line-height: 300px;
+
    height: 300px;
 
+
    line-height: 300px;
h1 {
+
  }
@include font-size(24px);
+
  header h1 {
}
+
    font-size: 24px;
}
+
    font-size: 1.5rem;
 +
  }
 
}
 
}
  
 
#cd-timeline {
 
#cd-timeline {
position: relative;
+
  position: relative;
padding: 2em 0;
+
  padding: 2em 0;
margin: {
+
  margin-top: 2em;
top: 2em;
+
  margin-bottom: 2em;
bottom: 2em;
+
}
}
+
#cd-timeline::before {
 
+
  /* this is the vertical line */
&::before {
+
  content: '';
/* this is the vertical line */
+
  position: absolute;
content: '';
+
  top: 0;
position: absolute;
+
  left: 18px;
top: 0;
+
  height: 100%;
left: 18px;
+
  width: 4px;
height: 100%;
+
  background: #d7e4ed;
width: 4px;
+
}
background: darken($background, 5%);
+
@media only screen and (min-width: 1170px) {
}
+
  #cd-timeline {
 
+
    margin-top: 3em;
@include MQ(L) {
+
    margin-bottom: 3em;
margin: {
+
  }
top: 3em;
+
  #cd-timeline::before {
bottom: 3em;
+
    left: 95%;
}
+
    margin-left: -2px;
 
+
  }
&::before {
+
left: 95%;
+
margin-left: -2px;
+
}
+
}
+
 
}
 
}
  
 
.cd-timeline-block {
 
.cd-timeline-block {
position: relative;
+
  position: relative;
margin: 2em 0;
+
  margin: 2em 0;
@include clearfix;
+
}
 
+
.cd-timeline-block::after {
&:first-child {
+
  clear: both;
margin-top: 0;
+
  content: "";
}
+
  display: table;
 
+
}
&:last-child {
+
.cd-timeline-block:first-child {
margin-bottom: 0;
+
  margin-top: 0;
}
+
}
 
+
.cd-timeline-block:last-child {
@include MQ(L) {
+
  margin-bottom: 0;
margin: 4em 0;
+
}
 
+
@media only screen and (min-width: 1170px) {
&:first-child {
+
  .cd-timeline-block {
margin-top: 0;
+
    margin: 4em 0;
}
+
  }
 
+
  .cd-timeline-block:first-child {
&:last-child {
+
    margin-top: 0;
margin-bottom: 0;
+
  }
}
+
  .cd-timeline-block:last-child {
}
+
    margin-bottom: 0;
 +
  }
 
}
 
}
  
 
.cd-timeline-img {
 
.cd-timeline-img {
position: absolute;
+
  position: absolute;
top: 0;
+
  top: 0;
left: 0;
+
  left: 0;
width: 40px;
+
  width: 40px;
height: 40px;
+
  height: 40px;
border-radius: 50%;
+
  border-radius: 50%;
box-shadow: 0 0 0 4px $color-3, inset 0 2px 0 rgba(#000, .08), 0 3px 0 4px rgba(#000, .05) ;
+
  box-shadow: 0 0 0 4px #ffffff, inset 0 2px 0 rgba(0, 0, 0, 0.08), 0 3px 0 4px rgba(0, 0, 0, 0.05);
 
+
img {
+
display: block;
+
width: 24px;
+
height: 24px;
+
position: relative;
+
left: 50%;
+
top: 50%;
+
margin-left: -12px;
+
margin-top: -12px;
+
}
+
 
+
&.cd-picture {
+
background: $color-4;
+
}
+
 
+
&.cd-movie {
+
background: $color-2;
+
}
+
 
+
&.cd-location {
+
background: $color-5;
+
}
+
 
+
@include MQ(L) {
+
width: 60px;
+
height: 60px;
+
left: 50%;
+
margin-left: -30px;
+
 
+
/* Force Hardware Acceleration in WebKit */
+
-webkit-transform: translateZ(0);
+
-webkit-backface-visibility: hidden;
+
 
+
.cssanimations &.is-hidden {
+
visibility: hidden;
+
}
+
 
+
.cssanimations &.bounce-in {
+
visibility: visible;
+
@include animation(cd-bounce-1 .6s);
+
}
+
}
+
 
}
 
}
 
+
.cd-timeline-img img {
@include keyframes(cd-bounce-1) {
+
  display: block;
0% {
+
  width: 24px;
opacity: 0;
+
  height: 24px;
@include transform(scale(.5));
+
  position: relative;
}
+
  left: 50%;
 
+
  top: 50%;
60% {
+
  margin-left: -12px;
opacity: 1;
+
  margin-top: -12px;
@include transform(scale(1.2));
+
}
}
+
.cd-timeline-img.cd-picture {
 
+
  background: #75ce66;
100% {
+
}
@include transform(scale(1));
+
.cd-timeline-img.cd-movie {
}
+
  background: #c03b44;
 +
}
 +
.cd-timeline-img.cd-location {
 +
  background: #f0ca45;
 +
}
 +
@media only screen and (min-width: 1170px) {
 +
  .cd-timeline-img {
 +
    width: 60px;
 +
    height: 60px;
 +
    left: 50%;
 +
    margin-left: -30px;
 +
    /* Force Hardware Acceleration in WebKit */
 +
    -webkit-transform: translateZ(0);
 +
    -webkit-backface-visibility: hidden;
 +
  }
 +
  .cssanimations .cd-timeline-img.is-hidden {
 +
    visibility: hidden;
 +
  }
 +
  .cssanimations .cd-timeline-img.bounce-in {
 +
    visibility: visible;
 +
    -webkit-animation: cd-bounce-1 0.6s;
 +
    -moz-animation: cd-bounce-1 0.6s;
 +
    animation: cd-bounce-1 0.6s;
 +
  }
 
}
 
}
  
 +
@-webkit-keyframes cd-bounce-1 {
 +
  0% {
 +
    opacity: 0;
 +
    -webkit-transform: scale(0.5);
 +
  }
 +
  60% {
 +
    opacity: 1;
 +
    -webkit-transform: scale(1.2);
 +
  }
 +
  100% {
 +
    -webkit-transform: scale(1);
 +
  }
 +
}
 +
@-moz-keyframes cd-bounce-1 {
 +
  0% {
 +
    opacity: 0;
 +
    -moz-transform: scale(0.5);
 +
  }
 +
  60% {
 +
    opacity: 1;
 +
    -moz-transform: scale(1.2);
 +
  }
 +
  100% {
 +
    -moz-transform: scale(1);
 +
  }
 +
}
 +
@keyframes cd-bounce-1 {
 +
  0% {
 +
    opacity: 0;
 +
    -webkit-transform: scale(0.5);
 +
    -moz-transform: scale(0.5);
 +
    -ms-transform: scale(0.5);
 +
    -o-transform: scale(0.5);
 +
    transform: scale(0.5);
 +
  }
 +
  60% {
 +
    opacity: 1;
 +
    -webkit-transform: scale(1.2);
 +
    -moz-transform: scale(1.2);
 +
    -ms-transform: scale(1.2);
 +
    -o-transform: scale(1.2);
 +
    transform: scale(1.2);
 +
  }
 +
  100% {
 +
    -webkit-transform: scale(1);
 +
    -moz-transform: scale(1);
 +
    -ms-transform: scale(1);
 +
    -o-transform: scale(1);
 +
    transform: scale(1);
 +
  }
 +
}
 
.cd-timeline-content {
 
.cd-timeline-content {
position: relative;
+
  position: relative;
margin-left: 60px;
+
  margin-left: 60px;
background: rgba(178,34,34,0.1);
+
  background: rgba(178, 34, 34, 0.1);
@include border-radius;
+
  border-radius: 0.25em;
padding: 1em;
+
  padding: 1em;
box-shadow: 0 3px 0 darken($background, 5%);
+
  box-shadow: 0 3px 0 #d7e4ed;
@include clearfix;
+
 
+
h2 {
+
color: #ff0000;
+
}
+
 
+
p, .cd-read-more, .cd-date {
+
@include font-size(13px);
+
}
+
 
+
.cd-read-more, .cd-date {
+
display: inline-block;
+
}
+
 
+
p {
+
margin: 1em 0;
+
line-height: 1.6;
+
}
+
 
+
.cd-read-more {
+
float: right;
+
padding: .8em 1em;
+
background: $link;
+
color: $color-3;
+
@include border-radius;
+
 
+
.no-touch &:hover {
+
background-color: lighten($link, 5%);
+
}
+
}
+
 
+
.cd-date {
+
float: left;
+
padding: .8em 0;
+
opacity: .7;
+
}
+
 
+
&::before {
+
content: '';
+
position: absolute;
+
top: 16px;
+
right: 100%;
+
height: 0;
+
width: 0;
+
border: 7px solid transparent;
+
border-right: 7px solid $color-3;
+
}
+
 
+
@include MQ(M) {
+
h2 {
+
@include font-size(20px);
+
}
+
 
+
p {
+
@include font-size(16px);
+
}
+
 
+
.cd-read-more, .cd-date {
+
@include font-size(14px);
+
}
+
}
+
 
+
@include MQ(L) {
+
margin-left: 0;
+
padding: 1.6em;
+
width: 90%;
+
 
+
&::before {
+
top: 24px;
+
left: 100%;
+
border-color: transparent;
+
border-left-color:  rgba(178,34,34,0.1);
+
}
+
 
+
.cd-read-more {
+
float: left;
+
}
+
 
+
.cd-date {
+
position: absolute;
+
width: 100%;
+
left: 108%;
+
top: 6px;
+
@include font-size(16px);
+
}
+
 
+
+
 
+
.cssanimations &.is-hidden {
+
visibility: hidden;
+
}
+
 
+
.cssanimations &.bounce-in {
+
visibility: visible;
+
@include animation(cd-bounce-2 .6s);
+
}
+
}
+
 
}
 
}
 
+
.cd-timeline-content::after {
@include MQ(L) {
+
  clear: both;
/* inverse bounce effect on even content blocks */
+
  content: "";
.cssanimations .cd-timeline-block:nth-child(even) .cd-timeline-content.bounce-in {
+
  display: table;
@include animation(cd-bounce-2-inverse .6s);
+
}
+
 
}
 
}
 
+
.cd-timeline-content h2 {
@include keyframes(cd-bounce-2) {
+
  color: #ff0000;
0% {
+
}
opacity: 0;
+
.cd-timeline-content p, .cd-timeline-content .cd-read-more, .cd-timeline-content .cd-date {
@include transform(translateX(-100px));
+
  font-size: 13px;
}
+
  font-size: 0.8125rem;
 
+
}
60% {
+
.cd-timeline-content .cd-read-more, .cd-timeline-content .cd-date {
opacity: 1;
+
  display: inline-block;
@include transform(translateX(20px));
+
}
}
+
.cd-timeline-content p {
 
+
  margin: 1em 0;
100% {
+
  line-height: 1.6;
@include transform(translateX(0));
+
}
}
+
.cd-timeline-content .cd-read-more {
 +
  float: right;
 +
  padding: .8em 1em;
 +
  background: #acb7c0;
 +
  color: #ffffff;
 +
  border-radius: 0.25em;
 +
}
 +
.no-touch .cd-timeline-content .cd-read-more:hover {
 +
  background-color: #bac4cb;
 +
}
 +
.cd-timeline-content .cd-date {
 +
  float: left;
 +
  padding: .8em 0;
 +
  opacity: .7;
 +
}
 +
.cd-timeline-content::before {
 +
  content: '';
 +
  position: absolute;
 +
  top: 16px;
 +
  right: 100%;
 +
  height: 0;
 +
  width: 0;
 +
  border: 7px solid transparent;
 +
  border-right: 7px solid #ffffff;
 +
}
 +
@media only screen and (min-width: 768px) {
 +
  .cd-timeline-content h2 {
 +
    font-size: 20px;
 +
    font-size: 1.25rem;
 +
  }
 +
  .cd-timeline-content p {
 +
    font-size: 16px;
 +
    font-size: 1rem;
 +
  }
 +
  .cd-timeline-content .cd-read-more, .cd-timeline-content .cd-date {
 +
    font-size: 14px;
 +
    font-size: 0.875rem;
 +
  }
 +
}
 +
@media only screen and (min-width: 1170px) {
 +
  .cd-timeline-content {
 +
    margin-left: 0;
 +
    padding: 1.6em;
 +
    width: 90%;
 +
  }
 +
  .cd-timeline-content::before {
 +
    top: 24px;
 +
    left: 100%;
 +
    border-color: transparent;
 +
    border-left-color: rgba(178, 34, 34, 0.1);
 +
  }
 +
  .cd-timeline-content .cd-read-more {
 +
    float: left;
 +
  }
 +
  .cd-timeline-content .cd-date {
 +
    position: absolute;
 +
    width: 100%;
 +
    left: 110%;
 +
    top: 6px;
 +
    font-size: 16px;
 +
    font-size: 1rem;
 +
  }
 +
  .cd-timeline-block:nth-child(even) .cd-timeline-content {
 +
    float: right;
 +
  }
 +
  .cd-timeline-block:nth-child(even) .cd-timeline-content::before {
 +
    top: 24px;
 +
    left: auto;
 +
    right: 100%;
 +
    border-color: transparent;
 +
    border-right-color: rgba(178, 34, 34, 0.1);
 +
  }
 +
  .cd-timeline-block:nth-child(even) .cd-timeline-content .cd-read-more {
 +
    float: right;
 +
  }
 +
  .cd-timeline-block:nth-child(even) .cd-timeline-content .cd-date {
 +
    left: auto;
 +
    right: 122%;
 +
    text-align: right;
 +
  }
 +
  .cssanimations .cd-timeline-content.is-hidden {
 +
    visibility: hidden;
 +
  }
 +
  .cssanimations .cd-timeline-content.bounce-in {
 +
    visibility: visible;
 +
    -webkit-animation: cd-bounce-2 0.6s;
 +
    -moz-animation: cd-bounce-2 0.6s;
 +
    animation: cd-bounce-2 0.6s;
 +
  }
 
}
 
}
  
@include keyframes(cd-bounce-2-inverse) {
+
@media only screen and (min-width: 1170px) {
0% {
+
  /* inverse bounce effect on even content blocks */
opacity: 0;
+
  .cssanimations .cd-timeline-block:nth-child(even) .cd-timeline-content.bounce-in {
@include transform(translateX(100px));
+
    -webkit-animation: cd-bounce-2-inverse 0.6s;
}
+
    -moz-animation: cd-bounce-2-inverse 0.6s;
 
+
    animation: cd-bounce-2-inverse 0.6s;
60% {
+
  }
opacity: 1;
+
@include transform(translateX(-20px));
+
}
+
 
+
100% {
+
@include transform(translateX(0));
+
}
+
 
}
 
}
 +
@-webkit-keyframes cd-bounce-2 {
 +
  0% {
 +
    opacity: 0;
 +
    -webkit-transform: translateX(-100px);
 +
  }
 +
  60% {
 +
    opacity: 1;
 +
    -webkit-transform: translateX(20px);
 +
  }
 +
  100% {
 +
    -webkit-transform: translateX(0);
 +
  }
 +
}
 +
@-moz-keyframes cd-bounce-2 {
 +
  0% {
 +
    opacity: 0;
 +
    -moz-transform: translateX(-100px);
 +
  }
 +
  60% {
 +
    opacity: 1;
 +
    -moz-transform: translateX(20px);
 +
  }
 +
  100% {
 +
    -moz-transform: translateX(0);
 +
  }
 +
}
 +
@keyframes cd-bounce-2 {
 +
  0% {
 +
    opacity: 0;
 +
    -webkit-transform: translateX(-100px);
 +
    -moz-transform: translateX(-100px);
 +
    -ms-transform: translateX(-100px);
 +
    -o-transform: translateX(-100px);
 +
    transform: translateX(-100px);
 +
  }
 +
  60% {
 +
    opacity: 1;
 +
    -webkit-transform: translateX(20px);
 +
    -moz-transform: translateX(20px);
 +
    -ms-transform: translateX(20px);
 +
    -o-transform: translateX(20px);
 +
    transform: translateX(20px);
 +
  }
 +
  100% {
 +
    -webkit-transform: translateX(0);
 +
    -moz-transform: translateX(0);
 +
    -ms-transform: translateX(0);
 +
    -o-transform: translateX(0);
 +
    transform: translateX(0);
 +
  }
 +
}
 +
@-webkit-keyframes cd-bounce-2-inverse {
 +
  0% {
 +
    opacity: 0;
 +
    -webkit-transform: translateX(100px);
 +
  }
 +
  60% {
 +
    opacity: 1;
 +
    -webkit-transform: translateX(-20px);
 +
  }
 +
  100% {
 +
    -webkit-transform: translateX(0);
 +
  }
 +
}
 +
@-moz-keyframes cd-bounce-2-inverse {
 +
  0% {
 +
    opacity: 0;
 +
    -moz-transform: translateX(100px);
 +
  }
 +
  60% {
 +
    opacity: 1;
 +
    -moz-transform: translateX(-20px);
 +
  }
 +
  100% {
 +
    -moz-transform: translateX(0);
 +
  }
 +
}
 +
@keyframes cd-bounce-2-inverse {
 +
  0% {
 +
    opacity: 0;
 +
    -webkit-transform: translateX(100px);
 +
    -moz-transform: translateX(100px);
 +
    -ms-transform: translateX(100px);
 +
    -o-transform: translateX(100px);
 +
    transform: translateX(100px);
 +
  }
 +
  60% {
 +
    opacity: 1;
 +
    -webkit-transform: translateX(-20px);
 +
    -moz-transform: translateX(-20px);
 +
    -ms-transform: translateX(-20px);
 +
    -o-transform: translateX(-20px);
 +
    transform: translateX(-20px);
 +
  }
 +
  100% {
 +
    -webkit-transform: translateX(0);
 +
    -moz-transform: translateX(0);
 +
    -ms-transform: translateX(0);
 +
    -o-transform: translateX(0);
 +
    transform: translateX(0);
 +
  }
 +
}
 +
  
  

Revision as of 20:43, 8 August 2015