Pen Settings

HTML

CSS

CSS Base

Vendor Prefixing

Add External Stylesheets/Pens

Any URLs added here will be added as <link>s in order, and before the CSS in the editor. You can use the CSS from another Pen by using its URL and the proper URL extension.

+ add another resource

JavaScript

Babel includes JSX processing.

Add External Scripts/Pens

Any URL's added here will be added as <script>s in order, and run before the JavaScript in the editor. You can use the URL of any other Pen and it will include the JavaScript from that Pen.

+ add another resource

Packages

Add Packages

Search for and use JavaScript packages from npm here. By selecting a package, an import statement will be added to the top of the JavaScript editor for this package.

Behavior

Auto Save

If active, Pens will autosave every 30 seconds after being saved once.

Auto-Updating Preview

If enabled, the preview panel updates automatically as you code. If disabled, use the "Run" button to update.

Format on Save

If enabled, your code will be formatted when you actively save your Pen. Note: your code becomes un-folded during formatting.

Editor Settings

Code Indentation

Want to change your Syntax Highlighting theme, Fonts and more?

Visit your global Editor Settings.

HTML

              
                <!-- inputs to display content-->
<input class='hide' type="radio" id="uno" name="tractor" />    
<input class='hide' type="radio" id="dos" name="tractor" />      
<input class='hide' type="radio" id="tres" name="tractor" />
<input class='hide' type="radio" id="cuatro" name="tractor" />
<input class='hide' type="radio" id="cierra" name="tractor" />
<!--inputs for moving images -->
<input class='hide' type="radio" id="uno1" name="tractor2" checked='checked' /> 
<input class='hide' type="radio" id="dos1" name="tractor2" /> 
<input class='hide' type="radio" id="tres1" name="tractor2" /> 
<input class='hide' type="radio" id="cuatro1" name="tractor2" />

<quote>Click the images & the ◉ ◉ || See the <a href='https://codepen.io/Kseso/full/GgpRym/'>version 2</a></quote>

<section>
  <nav>
    <label for='uno1' data-page='slide 1'></label>
    <label for='dos1' data-page='slide 2'></label>
    <label for='tres1' data-page='slide 3'></label>
    <label for='cuatro1' data-page='slide 4'></label>
  </nav>
  
    <label for='uno'></label>
    <label for='dos'></label>
    <label for='tres'></label>
    <label for='cuatro'></label>
</section>

<article class='uno'>
  <h1>Salamanca</h1>
  <p>El primer hábitat humano en el solar salmantino se ha fechado a comienzos del primer milenio antes de Cristo. Así lo atestiguan los restos cerámicos hallados en el «<i>cerro de San Vicente</i>» y que han sido adscritos a la cultura de Cogotas I del Bronce Final.</p>
</article>

<article class='dos'>
  <h1>Zamora</h1>
  <p>La ciudad fue fundada a inicios de la Edad del Bronce, siendo posteriormente ocupada durante la Edad de Hierro por el pueblo celta de los vacceos, que la denominaron Ocalam. El asentamiento inicial se produjo en la almendra delimitada por el Castillo y la <i>costanilla</i> de San Ildefonso, un emplazamiento estratégico al tratarse de una meseta rocosa defendida por el río Duero.</p>
</article>

<article class='tres'>
  <h1>León</h1>
  <p>La ciudad de León surge hacia 29 a. C. como campamento militar romano de la Legio VI Victrix, en la terraza fluvial entre los ríos Bernesga y Torío, cerca de la ciudad astur de Lancia, con motivo de las llamadas Guerras Cántabras. A finales del siglo I, a partir de 74, el campamento es ocupado por la Legio VII Gemina, fundada por Galba.</p>
</article>

<article class='cuatro'>
  <h1>Ávila</h1>
  <p>Algunos historiadores apuntan que la actual ciudad de Ávila fue una fundación ex-novo de los romanos, quienes le darían la denominación de <i>Abila, Obila, Abyla o Abela</i>. La ciudad romana estaba formada por el actual casco viejo, la zona rodeada hoy día por las murallas.</p>
</article>

<label for='cierra'></label>

<p class='aviso'>Link the <a href='https://escss.blogspot.com/2014/11/imagen-troceada-puro-Css.html'>POST</a>, show the PEN</p>
              
            
!

CSS

              
                @import url(https://fonts.googleapis.com/css?family=Signika:300,600);

*, *:before, *:after {
  box-sizing: inherit;
}
* {margin:0;padding:0;border:0 none; position: relative;}
html {
  background: #444;
  height: 100%;
  color: #ddd;
  box-sizing: border-box;
  font-family: Signika, sans serif;
  font-weight: 300;
  overflow: hidden;
}
body {
  height: inherit;
}
a {color: tomato}
.hide {display: none;}
/*Section ratio 16:9 */
section {
  width: 80vw;
  height: 80vh;
  margin: auto;
  position: absolute;
  top:0;right:0;bottom:0;left:0;
}
section > label {
  position: absolute;
  top:0;
  left:0;
  width:80vw;
  height: 100%;
  cursor: pointer;
  transition: 1s;
  z-index: 1;
  background: no-repeat center;
  background-size: cover;
  visibility: hidden;
}
section > label:nth-of-type(1) {
  background-image: 
url(//c4.staticflickr.com/4/3239/2941793035_067437afc4_z.jpg?zz=1)
}
section > label:nth-of-type(2) {
  background-image:
url(//c1.staticflickr.com/3/2105/2206845048_bc2390388f_b.jpg)
}
section > label:nth-of-type(3) {
  background-image:
url(//c4.staticflickr.com/8/7252/13178947615_6b35443c90_c.jpg)
}
section > label:nth-of-type(4) {
  background-image:  url(//c1.staticflickr.com/9/8142/7456438656_39d7a984a9_b.jpg);
}
/*mostrar imágenes por 1/2*/
section > label:before,
section > label:after {
  content: '';
  background: inherit; 
  background-clip: content-box;
  position: absolute;
  width: 80vw;
  height: 80vh;
  visibility: visible;
  transition: .5s linear;
  transform-origin: center;
}
section > label:before {
  clip: rect(0px, 37vw, 80vh, 0px);
  animation: saleIzq 1s cubic-bezier(0.99,0.1,0.35,1.2) forwards;
}
section > label:after {
  clip: rect(0px, 80vw, 80vh, 43vw);
  top: -100vh;
  animation: saleDch 1s cubic-bezier(0.99,0.1,0.35,1.2) forwards;
}

/* selector de diapositiva y transiciones entre ellas */
nav {
  position: absolute;
  left: 0;
  bottom: -5vh;
  width: 100%;
  text-align: center;
}
nav label {
  background: rgba(0,0,0,0);
  display: inline-block;
  width: 1.3rem;
  height: 1.3rem;
  border: 2px solid #bbb;
  border-radius: 50%;
  cursor: pointer;
  transition: .4s;
  position: static;
}
nav label:before {
  content: attr(data-page);
  position: absolute;
  left: 0;
  top: 0;
  font-size: .9rem;
  color: #aaa;
  display: none;
}

#uno1:checked ~ section nav [for='uno1'],
#dos1:checked ~ section nav [for='dos1'],
#tres1:checked ~ section nav [for='tres1'],
#cuatro1:checked ~ section nav [for='cuatro1'] {
  border: .4rem solid tomato;
}

#uno1:checked ~ section nav [for='uno1']:before,
#dos1:checked ~ section nav [for='dos1']:before,
#tres1:checked ~ section nav [for='tres1']:before,
#cuatro1:checked ~ section nav [for='cuatro1']:before {
  display: block;
}

#uno1:checked ~ section > [for='uno']:before,
#dos1:checked ~ section > [for='dos']:before,
#tres1:checked ~ section > [for='tres']:before,
#cuatro1:checked ~ section > [for='cuatro']:before {
  animation: entraIzq 1s cubic-bezier(0.99,0.1,0.35,1.2) forwards;
}

#uno1:checked ~ section > [for='uno']:after,
#dos1:checked ~ section > [for='dos']:after,
#tres1:checked ~ section > [for='tres']:after,
#cuatro1:checked ~ section > [for='cuatro']:after {
  animation: entraDch 1s cubic-bezier(0.99,0.1,0.35,1.2) forwards;
}

#uno1:checked ~ section > [for='uno']:after,
#dos1:checked ~ section > [for='dos']:after,
#tres1:checked ~ section > [for='tres']:after,
#cuatro1:checked ~ section > [for='cuatro']:after {
  top: 0;
}

@keyframes saleIzq {
  0% {top:0; display: block;}
  98% {top:-100vh;}
  99% {top:-100vh; display: none;}
  100% {top: -100vh;}
}
@keyframes entraIzq {
  0% {top: 100vh;display:none;}
  1% {top:100vh;display: block;}
  100% {top:0;}
}
@keyframes saleDch {
  0% {top:0; display: block;}
  98% {top:100vh;}
  99% {top:100vh; display: none;}
  100% {top: 100vh;}
}
@keyframes entraDch {
  0% {top: -100vh;display:none;}
  1% {top:-100vh;display: block;}
  100% {top:0;}
}

/********* pasar a full */
#uno:checked ~ section [for='uno']:before,
#dos:checked ~ section [for='dos']:before,
#tres:checked ~ section [for='tres']:before,
#cuatro:checked ~ section [for='cuatro']:before {
  clip: rect(0px, 40vw, 80vh, 0px);
  transform: scale(1.25);
}
#uno:checked ~ section [for='uno']:after,
#dos:checked ~ section [for='dos']:after,
#tres:checked ~ section [for='tres']:after,
#cuatro:checked ~ section [for='cuatro']:after {
  clip: rect(0px, 80vw, 80vh, 40vw);
  transform: scale(1.25);
}
#cierra[name='tractor']:checked ~ section:after,
section:after {
  content: '';
  background: rgba(0,0,85,.4);
  position: fixed;
  top:0;
  left:0;
  bottom:0;
  right:0;
  opacity: 0;
  transition: .5s;
  z-index: 5;
  transform: scale(0);
}
[name="tractor"]:checked ~ section:after {
  transform: scale(1);
  opacity: 1;
  transform-origin: center;
}
[for='cierra'] {
  position: absolute;
  right: 1rem;
  top:0;
  z-index: 10;
  cursor: pointer;
}
#cierra:checked ~ [for='cierra']:before {
  content:'';
  font-size:0;
}
[name="tractor"]:checked ~[for='cierra']:before {
  content: '\2297';
  font-size: 4rem;
  color: #fff;
}
[name="tractor"]:checked ~[for='cierra']:hover:before {
  color: tomato;
}

/* La información */
article {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  color: #fff;
  transform: scalex(0);
  transform-origin: 0 0;
  transition: .5s;
  transition-delay: 0;
  padding: 5vh 5vh;
}
article h1 {
  font-weight: 600;
  font-size: 10vw;
  text-shadow: 5px 5px 0 #666;
}
article p {
  font-size: 1.5rem;
  padding: 5vh 5vw;
  line-height: 1.5;
}
#uno:checked ~ .uno,
#dos:checked ~ .dos,
#tres:checked ~ .tres,
#cuatro:checked ~ .cuatro {
  transform: scalex(1);
  z-index: 7;
  transition-delay: .7s;
}

.aviso {
  position: fixed;
  bottom: 0;
  right: 0;
  background: orange;
  color: #fff;
  padding: .5rem;
  border-radius: 5px 0 0;
  box-shadow: 0 0 4px rgba(0,0,0,.4);
  z-index: 100;
}
.aviso a {
  text-decoration: none;
  color: #445;
}
              
            
!

JS

              
                
              
            
!
999px

Console