Cours session 5

master
Juan 3 years ago
parent f0d74412e8
commit ef119a32e4

@ -0,0 +1,28 @@
<!DOCTYPE html>
<html lang="fr">
<head>
<meta charset="utf-8" />
<title></title>
<link rel="stylesheet" href="style.css">
</head>
<body>
<form method="get">
<h4>S'abonner à </h4>
<span>fermer le formulaire</span>
<hr/>
<input type="checkbox" name="sport" id="sport" /><label for="sport">sports et activités sportives</label>
<div class="freq wrap sport">
<input type="radio" class="radio-sport" id="s_hebdo" name="sport_freq" value="hebdo" /><label for="s_hebdo">Hebdomadaire</label>
<input type="radio" class="radio-sport" id="s_daily" name="sport_freq" value="daily" /><label for="s_daily">Journalier</label>
</div>
<br/>
<input type="checkbox" name="culture" id="culture" /><label for="culture">arts et cultures</label>
<div class="freq wrap culture">
<input type="radio" id="c_hebdo" name="culture_freq" value="hebdo" /><label for="c_hebdo">Hebdomadaire</label>
<input type="radio" id="c_daily" name="culture_freq" value="daily" /><label for="c_daily">Journalier</label>
</div>
<hr/>
<input type="email" required name="mail" placeholder="votre email" /><button type="submit">Enregistrer mon abonnement</button>
</form>
</body>
</html>

@ -0,0 +1,16 @@
.freq {
display: none;
}
#sport:checked ~ .freq.sport {
display: block;
}
#culture {
background-color: red;
}
#culture:checked ~ .freq.culture {
display: block;
}
/*# sourceMappingURL=style.css.map */

@ -0,0 +1,19 @@
.freq {
display:none;
}
#sport:checked {
~ .freq.sport {
display:block;
}
}
#culture {
background-color:red;
&:checked {
~ .freq.culture {
display:block;
}
}
}

@ -0,0 +1,117 @@
body {
height: 600px;
margin: 0;
display: grid;
grid-template-rows: 500px 100px;
grid-template-columns: 1fr 30px 30px 30px 30px 30px 1fr;
align-items: center;
justify-items: center;
}
main#carousel {
grid-row: 1 / 2;
grid-column: 1 / 8;
width: 100vw;
height: 500px;
display: flex;
align-items: center;
justify-content: center;
overflow: hidden;
transform-style: preserve-3d;
perspective: 600px;
--items: 5;
--middle: 3;
--position: 1;
pointer-events: none;
}
div.item {
position: absolute;
width: 300px;
height: 400px;
--r: calc(var(--position) - var(--offset));
--abs: max(calc(var(--r) * -1), var(--r));
transition: all 0.25s linear;
transform: rotateY(calc(-10deg * var(--r)))
translateX(calc(-300px * var(--r)));
z-index: calc((var(--position) - var(--abs)));
}
div.item:nth-of-type(1) {
--offset: 1;
background-image: url(images/chateau-smith-haut-lafitte-pessac-leognan.png);
}
div.item:nth-of-type(2) {
--offset: 2;
background-image: url(images/chateau-smith-haut-lafitte-pessac-leognan.png);
}
div.item:nth-of-type(3) {
--offset: 3;
background-image: url(images/chateau-smith-haut-lafitte-pessac-leognan.png);
}
div.item:nth-of-type(4) {
--offset: 4;
background-image: url(images/chateau-smith-haut-lafitte-pessac-leognan.png);
}
div.item:nth-of-type(5) {
--offset: 5;
background-image: url(images/chateau-smith-haut-lafitte-pessac-leognan.png);
}
input:nth-of-type(1) {
grid-column: 2 / 3;
grid-row: 2 / 3;
}
input:nth-of-type(1):checked ~ main#carousel {
--position: 1;
}
input:nth-of-type(2) {
grid-column: 3 / 4;
grid-row: 2 / 3;
}
input:nth-of-type(2):checked ~ main#carousel {
--position: 2;
}
input:nth-of-type(3) {
grid-column: 4 /5;
grid-row: 2 / 3;
}
input:nth-of-type(3):checked ~ main#carousel {
--position: 3;
}
input:nth-of-type(4) {
grid-column: 5 / 6;
grid-row: 2 / 3;
}
input:nth-of-type(4):checked ~ main#carousel {
--position: 4;
}
input:nth-of-type(5) {
grid-column: 6 / 7;
grid-row: 2 / 3;
}
input:nth-of-type(5):checked ~ main#carousel {
--position: 5;
}
h1{
padding-bottom: auto;
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 11 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 20 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 30 KiB

@ -0,0 +1,30 @@
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="stylesheet" href="style.css">
<title>Slider à Pinards</title>
</head>
<body>
<h1>Slider à pinard</h1>
<input type="radio" name="position" checked />
<input type="radio" name="position" />
<input type="radio" name="position" />
<input type="radio" name="position" />
<input type="radio" name="position" />
<main id="carousel">
<div class="item"></div>
<div class="item"></div>
<div class="item"></div>
<div class="item"></div>
<div class="item"></div>
<main>
</body>
</html>

@ -0,0 +1,113 @@
body {
height: 600px;
margin: 0;
display: grid;
grid-template-rows: 500px 100px;
grid-template-columns: 1fr 30px 30px 30px 30px 30px 1fr;
align-items: center;
justify-items: center;
}
main#carousel {
grid-row: 1/2;
grid-column: 1/8;
width: 100vw;
height: 500px;
display: flex;
align-items: center;
justify-content: center;
overflow: hidden;
transform-style: preserve-3d;
perspective: 600px;
--items: 5;
--middle: 3;
--position: 1;
pointer-events: none;
}
div.item {
position: absolute;
width: 300px;
height: 400px;
--r: calc(var(--position) - var(--offset));
--abs: max(calc(var(--r) * -1), var(--r));
transition: all 0.25s linear;
transform: rotateY(calc(-10deg * var(--r))) translateX(calc(-300px * var(--r)));
z-index: calc((var(--position) - var(--abs)));
}
div.item:nth-of-type(1) {
--offset: 1;
background-image: url(images/chateau-smith-haut-lafitte-pessac-leognan.png);
}
div.item:nth-of-type(2) {
--offset: 2;
background-image: url(images/chateau-smith-haut-lafitte-pessac-leognan.png);
}
div.item:nth-of-type(3) {
--offset: 3;
background-image: url(images/chateau-smith-haut-lafitte-pessac-leognan.png);
}
div.item:nth-of-type(4) {
--offset: 4;
background-image: url(images/chateau-smith-haut-lafitte-pessac-leognan.png);
}
div.item:nth-of-type(5) {
--offset: 5;
background-image: url(images/chateau-smith-haut-lafitte-pessac-leognan.png);
}
input:nth-of-type(1) {
grid-column: 2/3;
grid-row: 2/3;
}
input:nth-of-type(1):checked ~ main#carousel {
--position: 1;
}
input:nth-of-type(2) {
grid-column: 3/4;
grid-row: 2/3;
}
input:nth-of-type(2):checked ~ main#carousel {
--position: 2;
}
input:nth-of-type(3) {
grid-column: 4/5;
grid-row: 2/3;
}
input:nth-of-type(3):checked ~ main#carousel {
--position: 3;
}
input:nth-of-type(4) {
grid-column: 5/6;
grid-row: 2/3;
}
input:nth-of-type(4):checked ~ main#carousel {
--position: 4;
}
input:nth-of-type(5) {
grid-column: 6/7;
grid-row: 2/3;
}
input:nth-of-type(5):checked ~ main#carousel {
--position: 5;
}
h1 {
padding-bottom: auto;
}
/*# sourceMappingURL=style.css.map */

Binary file not shown.

After

Width:  |  Height:  |  Size: 126 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 63 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 38 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 242 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 77 KiB

@ -0,0 +1,158 @@
img {
max-width: 100%;
}
#slider {
margin: 0 auto;
width: 800px;
max-width: 100%;
text-align: center;
}
#slider label {
cursor: pointer;
text-decoration: none;
}
#slides {
padding: 10px;
border: 3px solid #ccc;
background: #fff;
position: relative;
z-index: 1;
}
#overflow {
width: 100%;
overflow: hidden;
}
#slide1:checked ~ #slides .inner {
margin-left: 0;
}
#slide2:checked ~ #slides .inner {
margin-left: -100%;
}
#slide3:checked ~ #slides .inner {
margin-left: -200%;
}
#slide4:checked ~ #slides .inner {
margin-left: -300%;
}
#slides .inner {
transition: margin-left 800ms cubic-bezier(0.77, 0, 0.175, 1);
width: 400%;
line-height: 0;
height: 300px;
}
#slides .slide {
width: 25%;
float: left;
display: flex;
justify-content: center;
align-items: center;
height: 100%;
color: #fff;
}
#slides .slide_1 {
background: #00171F;
}
#slides .slide_2 {
background: #003459;
}
#slides .slide_3 {
background: #007EA7;
}
#slides .slide_4 {
background: #00A8E8;
}
#controls {
margin: -180px 0 0 0;
width: 100%;
height: 50px;
z-index: 3;
position: relative;
}
#controls label {
transition: opacity 0.2s ease-out;
display: none;
width: 50px;
height: 50px;
opacity: 0.4;
}
#controls label:hover {
opacity: 1;
}
#slide1:checked ~ #controls label:nth-child(2),
#slide2:checked ~ #controls label:nth-child(3),
#slide3:checked ~ #controls label:nth-child(4),
#slide4:checked ~ #controls label:nth-child(1) {
background: url(https://image.flaticon.com/icons/svg/130/130884.svg) no-repeat;
float: right;
margin: 0 -50px 0 0;
display: block;
}
#slide1:checked ~ #controls label:nth-last-child(2),
#slide2:checked ~ #controls label:nth-last-child(3),
#slide3:checked ~ #controls label:nth-last-child(4),
#slide4:checked ~ #controls label:nth-last-child(1) {
background: url(https://image.flaticon.com/icons/svg/130/130882.svg) no-repeat;
float: left;
margin: 0 0 0 -50px;
display: block;
}
#bullets {
margin: 150px 0 0;
text-align: center;
}
#bullets label {
display: inline-block;
width: 10px;
height: 10px;
border-radius: 100%;
background: #ccc;
margin: 0 10px;
}
#slide1:checked ~ #bullets label:nth-child(1),
#slide2:checked ~ #bullets label:nth-child(2),
#slide3:checked ~ #bullets label:nth-child(3),
#slide4:checked ~ #bullets label:nth-child(4) {
background: #444;
}
@media screen and (max-width: 900px) {
#slide1:checked ~ #controls label:nth-child(2),
#slide2:checked ~ #controls label:nth-child(3),
#slide3:checked ~ #controls label:nth-child(4),
#slide4:checked ~ #controls label:nth-child(1),
#slide1:checked ~ #controls label:nth-last-child(2),
#slide2:checked ~ #controls label:nth-last-child(3),
#slide3:checked ~ #controls label:nth-last-child(4),
#slide4:checked ~ #controls label:nth-last-child(1) {
margin: 0;
}
#slides {
max-width: calc(100% - 140px);
margin: 0 auto;
}
}
/*# sourceMappingURL=slider.css.map */

@ -0,0 +1,155 @@
img {
max-width: 100%;
}
#slider {
margin: 0 auto;
width: 800px;
max-width: 100%;
text-align: center;
}
#slider label {
cursor:pointer;
text-decoration: none;
}
#slides {
padding: 10px;
border: 3px solid #ccc;
background: #fff;
position: relative;
z-index: 1;
}
#overflow {
width: 100%;
overflow: hidden;
}
#slide1:checked ~ #slides .inner {
margin-left: 0;
}
#slide2:checked ~ #slides .inner {
margin-left: -100%;
}
#slide3:checked ~ #slides .inner {
margin-left: -200%;
}
#slide4:checked ~ #slides .inner {
margin-left: -300%;
}
#slides .inner {
transition: margin-left 800ms cubic-bezier(0.770, 0.000, 0.175, 1.000);
width: 400%;
line-height: 0;
height: 300px;
}
#slides .slide {
width: 25%;
float:left;
display: flex;
justify-content: center;
align-items: center;
height: 100%;
color: #fff;
}
#slides .slide_1 {
background: #00171F;
}
#slides .slide_2 {
background: #003459;
}
#slides .slide_3 {
background: #007EA7;
}
#slides .slide_4 {
background: #00A8E8;
}
#controls {
margin: -180px 0 0 0;
width: 100%;
height: 50px;
z-index: 3;
position: relative;
}
#controls label {
transition: opacity 0.2s ease-out;
display: none;
width: 50px;
height: 50px;
opacity: .4;
}
#controls label:hover {
opacity: 1;
}
#slide1:checked ~ #controls label:nth-child(2),
#slide2:checked ~ #controls label:nth-child(3),
#slide3:checked ~ #controls label:nth-child(4),
#slide4:checked ~ #controls label:nth-child(1) {
background: url(https://image.flaticon.com/icons/svg/130/130884.svg) no-repeat;
float:right;
margin: 0 -50px 0 0;
display: block;
}
#slide1:checked ~ #controls label:nth-last-child(2),
#slide2:checked ~ #controls label:nth-last-child(3),
#slide3:checked ~ #controls label:nth-last-child(4),
#slide4:checked ~ #controls label:nth-last-child(1) {
background: url(https://image.flaticon.com/icons/svg/130/130882.svg) no-repeat;
float:left;
margin: 0 0 0 -50px;
display: block;
}
#bullets {
margin: 150px 0 0;
text-align: center;
}
#bullets label {
display: inline-block;
width: 10px;
height: 10px;
border-radius:100%;
background: #ccc;
margin: 0 10px;
}
#slide1:checked ~ #bullets label:nth-child(1),
#slide2:checked ~ #bullets label:nth-child(2),
#slide3:checked ~ #bullets label:nth-child(3),
#slide4:checked ~ #bullets label:nth-child(4) {
background: #444;
}
@media screen and (max-width: 900px) {
#slide1:checked ~ #controls label:nth-child(2),
#slide2:checked ~ #controls label:nth-child(3),
#slide3:checked ~ #controls label:nth-child(4),
#slide4:checked ~ #controls label:nth-child(1),
#slide1:checked ~ #controls label:nth-last-child(2),
#slide2:checked ~ #controls label:nth-last-child(3),
#slide3:checked ~ #controls label:nth-last-child(4),
#slide4:checked ~ #controls label:nth-last-child(1) {
margin: 0;
}
#slides {
max-width: calc(100% - 140px);
margin: 0 auto;
}
}

@ -0,0 +1,58 @@
<!DOCTYPE html>
<html lang="fr">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Slider</title>
<link rel="stylesheet" href="css/slider.css">
</head>
<body>
<main>
<div id="slider">
<input type="radio" name="slider" hidden id="slide1" checked>
<input type="radio" name="slider" hidden id="slide2">
<input type="radio" name="slider" hidden id="slide3">
<input type="radio" name="slider" hidden id="slide4">
<div id="slides">
<div id="overflow">
<div class="inner">
<div class="slide slide_1">
<div class="slide-content">
<img src="assets/img/img-1.jpeg" alt="">
</div>
</div>
<div class="slide slide_2">
<div class="slide-content">
<img src="assets/img/img-2.jpeg" alt="">
</div>
</div>
<div class="slide slide_3">
<div class="slide-content">
<img src="assets/img/img-5.jpeg" alt="">
</div>
</div>
<div class="slide slide_4">
<div class="slide-content">
<img src="assets/img/img-4.jpeg" alt="">
</div>
</div>
</div>
</div>
</div>
<div id="controls">
<label for="slide1"></label>
<label for="slide2"></label>
<label for="slide3"></label>
<label for="slide4"></label>
</div>
<div id="bullets">
<label for="slide1"></label>
<label for="slide2"></label>
<label for="slide3"></label>
<label for="slide4"></label>
</div>
</div>
</main>
</body>
</html>

@ -0,0 +1,7 @@
## howto :
uses sass to generate style.css in root dir :
```
sass .\scss\common.scss .\style.css
```

@ -0,0 +1,21 @@
<?xml version="1.0" standalone="no"?>
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd" >
<svg xmlns="http://www.w3.org/2000/svg">
<metadata>Generated by IcoMoon</metadata>
<defs>
<font id="icomoon" horiz-adv-x="1024">
<font-face units-per-em="1024" ascent="960" descent="-64" />
<missing-glyph horiz-adv-x="1024" />
<glyph unicode="&#x20;" horiz-adv-x="512" d="" />
<glyph unicode="&#xea0d;" glyph-name="close-circle" d="M512 960c-282.77 0-512-229.23-512-512s229.23-512 512-512 512 229.23 512 512-229.23 512-512 512zM512 32c-229.75 0-416 186.25-416 416s186.25 416 416 416 416-186.25 416-416-186.25-416-416-416zM672 704l-160-160-160 160-96-96 160-160-160-160 96-96 160 160 160-160 96 96-160 160 160 160z" />
<glyph unicode="&#xea0f;" glyph-name="close" d="M1014.662 137.34c-0.004 0.004-0.008 0.008-0.012 0.010l-310.644 310.65 310.644 310.65c0.004 0.004 0.008 0.006 0.012 0.010 3.344 3.346 5.762 7.254 7.312 11.416 4.246 11.376 1.824 24.682-7.324 33.83l-146.746 146.746c-9.148 9.146-22.45 11.566-33.828 7.32-4.16-1.55-8.070-3.968-11.418-7.31 0-0.004-0.004-0.006-0.008-0.010l-310.648-310.652-310.648 310.65c-0.004 0.004-0.006 0.006-0.010 0.010-3.346 3.342-7.254 5.76-11.414 7.31-11.38 4.248-24.682 1.826-33.83-7.32l-146.748-146.748c-9.148-9.148-11.568-22.452-7.322-33.828 1.552-4.16 3.97-8.072 7.312-11.416 0.004-0.002 0.006-0.006 0.010-0.010l310.65-310.648-310.65-310.652c-0.002-0.004-0.006-0.006-0.008-0.010-3.342-3.346-5.76-7.254-7.314-11.414-4.248-11.376-1.826-24.682 7.322-33.83l146.748-146.746c9.15-9.148 22.452-11.568 33.83-7.322 4.16 1.552 8.070 3.97 11.416 7.312 0.002 0.004 0.006 0.006 0.010 0.010l310.648 310.65 310.648-310.65c0.004-0.002 0.008-0.006 0.012-0.008 3.348-3.344 7.254-5.762 11.414-7.314 11.378-4.246 24.684-1.826 33.828 7.322l146.746 146.748c9.148 9.148 11.57 22.454 7.324 33.83-1.552 4.16-3.97 8.068-7.314 11.414z" />
<glyph unicode="&#xea1c;" glyph-name="play3" d="M192 832l640-384-640-384z" />
<glyph unicode="&#xea1d;" glyph-name="pause2" d="M128 832h320v-768h-320zM576 832h320v-768h-320z" />
<glyph unicode="&#xea41;" glyph-name="circle-up" d="M0 448c0-282.77 229.23-512 512-512s512 229.23 512 512-229.23 512-512 512-512-229.23-512-512zM928 448c0-229.75-186.25-416-416-416s-416 186.25-416 416 186.25 416 416 416 416-186.25 416-416zM706.744 290.744l90.512 90.512-285.256 285.254-285.254-285.256 90.508-90.508 194.746 194.744z" />
<glyph unicode="&#xea42;" glyph-name="circle-right" d="M512 960c-282.77 0-512-229.23-512-512s229.23-512 512-512 512 229.23 512 512-229.23 512-512 512zM512 32c-229.75 0-416 186.25-416 416s186.25 416 416 416 416-186.25 416-416-186.25-416-416-416zM354.744 253.256l90.512-90.512 285.254 285.256-285.256 285.254-90.508-90.508 194.744-194.746z" />
<glyph unicode="&#xea43;" glyph-name="circle-down" d="M1024 448c0 282.77-229.23 512-512 512s-512-229.23-512-512 229.23-512 512-512 512 229.23 512 512zM96 448c0 229.75 186.25 416 416 416s416-186.25 416-416-186.25-416-416-416-416 186.25-416 416zM317.256 605.256l-90.512-90.512 285.256-285.254 285.254 285.256-90.508 90.508-194.746-194.744z" />
<glyph unicode="&#xea44;" glyph-name="circle-left" d="M512-64c282.77 0 512 229.23 512 512s-229.23 512-512 512-512-229.23-512-512 229.23-512 512-512zM512 864c229.75 0 416-186.25 416-416s-186.25-416-416-416-416 186.25-416 416 186.25 416 416 416zM669.256 642.744l-90.512 90.512-285.254-285.256 285.256-285.254 90.508 90.508-194.744 194.746z" />
<glyph unicode="&#xea54;" glyph-name="radio-checked" d="M512 960c-282.77 0-512-229.23-512-512s229.23-512 512-512 512 229.23 512 512-229.23 512-512 512zM512 64c-212.078 0-384 171.922-384 384s171.922 384 384 384c212.078 0 384-171.922 384-384s-171.922-384-384-384zM320 448c0 106.039 85.961 192 192 192s192-85.961 192-192c0-106.039-85.961-192-192-192s-192 85.961-192 192z" />
<glyph unicode="&#xea55;" glyph-name="radio-checked2" d="M512 960c-282.77 0-512-229.23-512-512s229.23-512 512-512 512 229.23 512 512-229.23 512-512 512zM512 320c-70.692 0-128 57.306-128 128 0 70.692 57.308 128 128 128 70.694 0 128-57.308 128-128 0-70.694-57.306-128-128-128z" />
<glyph unicode="&#xea56;" glyph-name="radio-unchecked" d="M512 960c-282.77 0-512-229.23-512-512s229.23-512 512-512 512 229.23 512 512-229.23 512-512 512zM512 64c-212.078 0-384 171.922-384 384s171.922 384 384 384c212.078 0 384-171.922 384-384s-171.922-384-384-384z" />
</font></defs></svg>

After

Width:  |  Height:  |  Size: 4.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 832 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 827 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.0 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 83 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 83 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 109 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 250 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 255 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 283 KiB

@ -0,0 +1,66 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<title>Welcome to the forest</title>
<link rel="stylesheet" href="style.css" />
<script type="text/javascript" src="scripts/slider.js" async></script>
<style>
@media (max-width: 480px) {
:root { --bg-image: url(./imgs/mobile/forest-river.jpg); }
}
@media (min-width: 481px) and (max-width: 989px) {
:root { --bg-image: url(./imgs/tablet/forest-river.jpg); }
}
@media (min-width: 990px) {
:root { --bg-image: url(./imgs/full/forest-river.jpg); }
}
</style>
</head>
<body>
<header id="top-slider" aria-hidden="true">
<div class="slider">
<div id="slide-1" class="slide img-wrap" style="background-image: var(--bg-image);">
<!-- picture>
<source media="(max-width: 480px)" srcset="./imgs/mobile/forest-river.jpg">
<source media="(orientation: landscape) and (min-width: 481px) and (max-width: 989px)" srcset="./imgs/tablet/forest-river.jpg">
<source media="(min-width: 990px)" srcset="./imgs/full/forest-river.jpg">
<img src="./imgs/tablet/forest-river.jpg" alt="">
</picture -->
</div><!--
<div id="slide-2" class="slide img-wrap" aria-hidden="true">
<picture>
<source media="(max-width: 480px)" srcset="./imgs/mobile/forest-moss.jpg">
<source media="(orientation: landscape) and (min-width: 481px) and (max-width: 989px)" srcset="./imgs/tablet/forest-moss.jpg">
<source media="(min-width: 990px)" srcset="./imgs/full/forest-moss.jpg">
<img src="./imgs/tablet/forest-moss.jpg" alt="">
</picture>
</div>
<div id="slide-3" class="slide img-wrap" aria-hidden="true">
<picture>
<source media="(max-width: 480px)" srcset="./imgs/mobile/forest-autumn.jpg">
<source media="(orientation: landscape) and (min-width: 481px) and (max-width: 989px)" srcset="./imgs/tablet/forest-autumn.jpg">
<source media="(min-width: 990px)" srcset="./imgs/full/forest-autumn.jpg">
<img src="./imgs/tablet/forest-autumn.jpg" alt="">
</picture>
</div> -->
<nav class="slider-nav">
<span class="prev"><i class="ico-circle-left"></i></span>
<span class="pause"><i class="ico-pause2"></i></span>
<span class="next"><i class="ico-circle-right"></i></span>
</nav>
</div>
</header>
<div id="slider-position">
<i class="on"></i>
<i class="ico-radio-unchecked"></i>
<i class="ico-radio-unchecked"></i>
</div>
<h1>Welcome to the forest</h1>
<p>
<!-- https://www.base64encode.net/base64-image-encoder -->
<img src="data:image/png;base64,/9j/4AAQSkZJRgABAQEAYABgAAD/4QPKRXhpZgAASUkqAAgAAAACADIBAgAUAAAAJgAAAGmHBAABAAAAOgAAAEAAAAAyMDIxOjEwOjE5IDE4OjQ0OjI1AAAAAAAAAAMAAwEEAAEAAAAGAAAAAQIEAAEAAABqAAAAAgIEAAEAAABQAwAAAAAAAP/Y/+AAEEpGSUYAAQEAAAEAAQAA/9sAQwAGBAUGBQQGBgUGBwcGCAoQCgoJCQoUDg8MEBcUGBgXFBYWGh0lHxobIxwWFiAsICMmJykqKRkfLTAtKDAlKCko/9sAQwEHBwcKCA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!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<title>Welcome to the forest</title>
<link rel="stylesheet" href="style.css" />
<script type="text/javascript" src="scripts/slider.js" async></script>
</head>
<body>
<header id="top-slider" aria-hidden="true">
<div id="slider" class="slider">
<div id="slide-1" class="slide img-wrap">
<picture>
<source media="(max-width: 480px)" srcset="./imgs/mobile/forest-river.jpg">
<source media="(orientation: landscape) and (min-width: 481px) and (max-width: 989px)" srcset="./imgs/tablet/forest-river.jpg">
<source media="(min-width: 990px)" srcset="./imgs/full/forest-river.jpg">
<img src="./imgs/tablet/forest-river.jpg" alt="">
</picture>
</div>
<div id="slide-2" class="slide img-wrap" aria-hidden="true">
<picture>
<source media="(max-width: 480px)" srcset="./imgs/mobile/forest-moss.jpg">
<source media="(orientation: landscape) and (min-width: 481px) and (max-width: 989px)" srcset="./imgs/tablet/forest-moss.jpg">
<source media="(min-width: 990px)" srcset="./imgs/full/forest-moss.jpg">
<img src="./imgs/tablet/forest-moss.jpg" alt="">
</picture>
</div>
<div id="slide-3" class="slide img-wrap" aria-hidden="true">
<picture>
<source media="(max-width: 480px)" srcset="./imgs/mobile/forest-autumn.jpg">
<source media="(orientation: landscape) and (min-width: 481px) and (max-width: 989px)" srcset="./imgs/tablet/forest-autumn.jpg">
<source media="(min-width: 990px)" srcset="./imgs/full/forest-autumn.jpg">
<img src="./imgs/tablet/forest-autumn.jpg" alt="">
</picture>
</div>
<nav class="slider-nav">
<span class="prev"><i class="ico-circle-left"></i></span>
<span class="pause" id="pause-slider"><i class="ico-pause2"></i></span>
<span class="next"><i class="ico-circle-right"></i></span>
</nav>
</div>
</header>
<div id="slider-position">
<i class="on"></i>
<i class="ico-radio-unchecked"></i>
<i class="ico-radio-unchecked"></i>
</div>
<h1>Welcome to the forest</h1>
</body>
</html>

Binary file not shown.

After

Width:  |  Height:  |  Size: 64 KiB

@ -0,0 +1,64 @@
console.log('scripts loaded');
run = true;
document.onreadystatechange = function(event) {
if (document.readyState === "complete") {
console.log('document loaded');
if(slide = document.getElementById("slide-3"))
{
document.getElementById("slider").setAttribute('data-current-slide',3);
//setTimeout(moveSlide, 10, slide);
}
document.addEventListener("click",function (event) {
console.log(event.target);
if(event.target.matches('.pause') || event.target.matches('.ico-pause2') ) {
console.log("pause requested");
run=false;
}
});
}
}
function moveSlide(slide) {
if(!run) {
slide.setAttribute('style','opacity:0%;margin-left:-100%;z-index:3');
return;
}
start=0;
if(slide.getAttribute('data-position'))
{
start = parseInt(slide.getAttribute('data-position'));
}
slide.setAttribute('data-position',start-1);
slide.setAttribute('style','opacity:'+(100+start)+'%;margin-left:'+(start-1)+'%;z-index:3');
if(start > -100) {
setTimeout(moveSlide, 10, slide);
return;
}
nextSlide();
}
function nextSlide()
{
next = 3;
if(current = document.getElementById("slider").getAttribute('data-current-slide'))
{
next = parseInt(current) -1;
}
if(next < 1)
{
next = 3;
}
console.log("next " + next);
console.log("current " + current);
next_slide = document.getElementById("slide-"+next);
next_slide.setAttribute('data-position',0);
next_slide.setAttribute('style','margin-left:0%;z-index:3');
current_slide = document.getElementById("slide-"+current);
current_slide.setAttribute('data-position',0);
current_slide.setAttribute('style','margin-left:0%;z-index:0');
document.getElementById("slider").setAttribute('data-current-slide',next);
setTimeout(moveSlide, 10, next_slide);
}

@ -0,0 +1,59 @@
@font-face {
font-family: 'icomoon';
src:
url('fonts/icomoon.ttf?e3ejhb') format('truetype'),
url('fonts/icomoon.woff?e3ejhb') format('woff'),
url('fonts/icomoon.svg?e3ejhb#icomoon') format('svg');
font-weight: normal;
font-style: normal;
font-display: block;
}
i {
/* use !important to prevent issues with browser extensions that change fonts */
font-family: 'icomoon' !important;
speak: never;
font-style: normal;
font-weight: normal;
font-variant: normal;
text-transform: none;
line-height: 1;
/* Better Font Rendering =========== */
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
}
.ico-close-circle:before {
content: "\ea0d";
}
.ico-close:before {
content: "\ea0f";
}
.ico-play3:before {
content: "\ea1c";
}
.ico-pause2:before {
content: "\ea1d";
}
.ico-circle-up:before {
content: "\ea41";
}
.ico-circle-right:before {
content: "\ea42";
}
.ico-circle-down:before {
content: "\ea43";
}
.ico-circle-left:before {
content: "\ea44";
}
.ico-radio-checked:before {
content: "\ea54";
}
.ico-radio-checked2:before {
content: "\ea55";
}
.ico-radio-unchecked:before {
content: "\ea56";
}

@ -0,0 +1,349 @@
/*! normalize.css v8.0.1 | MIT License | github.com/necolas/normalize.css */
/* Document
========================================================================== */
/**
* 1. Correct the line height in all browsers.
* 2. Prevent adjustments of font size after orientation changes in iOS.
*/
html {
line-height: 1.15; /* 1 */
-webkit-text-size-adjust: 100%; /* 2 */
}
/* Sections
========================================================================== */
/**
* Remove the margin in all browsers.
*/
body {
margin: 0;
}
/**
* Render the `main` element consistently in IE.
*/
main {
display: block;
}
/**
* Correct the font size and margin on `h1` elements within `section` and
* `article` contexts in Chrome, Firefox, and Safari.
*/
h1 {
font-size: 2em;
margin: 0.67em 0;
}
/* Grouping content
========================================================================== */
/**
* 1. Add the correct box sizing in Firefox.
* 2. Show the overflow in Edge and IE.
*/
hr {
box-sizing: content-box; /* 1 */
height: 0; /* 1 */
overflow: visible; /* 2 */
}
/**
* 1. Correct the inheritance and scaling of font size in all browsers.
* 2. Correct the odd `em` font sizing in all browsers.
*/
pre {
font-family: monospace, monospace; /* 1 */
font-size: 1em; /* 2 */
}
/* Text-level semantics
========================================================================== */
/**
* Remove the gray background on active links in IE 10.
*/
a {
background-color: transparent;
}
/**
* 1. Remove the bottom border in Chrome 57-
* 2. Add the correct text decoration in Chrome, Edge, IE, Opera, and Safari.
*/
abbr[title] {
border-bottom: none; /* 1 */
text-decoration: underline; /* 2 */
text-decoration: underline dotted; /* 2 */
}
/**
* Add the correct font weight in Chrome, Edge, and Safari.
*/
b,
strong {
font-weight: bolder;
}
/**
* 1. Correct the inheritance and scaling of font size in all browsers.
* 2. Correct the odd `em` font sizing in all browsers.
*/
code,
kbd,
samp {
font-family: monospace, monospace; /* 1 */
font-size: 1em; /* 2 */
}
/**
* Add the correct font size in all browsers.
*/
small {
font-size: 80%;
}
/**
* Prevent `sub` and `sup` elements from affecting the line height in
* all browsers.
*/
sub,
sup {
font-size: 75%;
line-height: 0;
position: relative;
vertical-align: baseline;
}
sub {
bottom: -0.25em;
}
sup {
top: -0.5em;
}
/* Embedded content
========================================================================== */
/**
* Remove the border on images inside links in IE 10.
*/
img {
border-style: none;
}
/* Forms
========================================================================== */
/**
* 1. Change the font styles in all browsers.
* 2. Remove the margin in Firefox and Safari.
*/
button,
input,
optgroup,
select,
textarea {
font-family: inherit; /* 1 */
font-size: 100%; /* 1 */
line-height: 1.15; /* 1 */
margin: 0; /* 2 */
}
/**
* Show the overflow in IE.
* 1. Show the overflow in Edge.
*/
button,
input { /* 1 */
overflow: visible;
}
/**
* Remove the inheritance of text transform in Edge, Firefox, and IE.
* 1. Remove the inheritance of text transform in Firefox.
*/
button,
select { /* 1 */
text-transform: none;
}
/**
* Correct the inability to style clickable types in iOS and Safari.
*/
button,
[type="button"],
[type="reset"],
[type="submit"] {
-webkit-appearance: button;
}
/**
* Remove the inner border and padding in Firefox.
*/
button::-moz-focus-inner,
[type="button"]::-moz-focus-inner,
[type="reset"]::-moz-focus-inner,
[type="submit"]::-moz-focus-inner {
border-style: none;
padding: 0;
}
/**
* Restore the focus styles unset by the previous rule.
*/
button:-moz-focusring,
[type="button"]:-moz-focusring,
[type="reset"]:-moz-focusring,
[type="submit"]:-moz-focusring {
outline: 1px dotted ButtonText;
}
/**
* Correct the padding in Firefox.
*/
fieldset {
padding: 0.35em 0.75em 0.625em;
}
/**
* 1. Correct the text wrapping in Edge and IE.
* 2. Correct the color inheritance from `fieldset` elements in IE.
* 3. Remove the padding so developers are not caught out when they zero out
* `fieldset` elements in all browsers.
*/
legend {
box-sizing: border-box; /* 1 */
color: inherit; /* 2 */
display: table; /* 1 */
max-width: 100%; /* 1 */
padding: 0; /* 3 */
white-space: normal; /* 1 */
}
/**
* Add the correct vertical alignment in Chrome, Firefox, and Opera.
*/
progress {
vertical-align: baseline;
}
/**
* Remove the default vertical scrollbar in IE 10+.
*/
textarea {
overflow: auto;
}
/**
* 1. Add the correct box sizing in IE 10.
* 2. Remove the padding in IE 10.
*/
[type="checkbox"],
[type="radio"] {
box-sizing: border-box; /* 1 */
padding: 0; /* 2 */
}
/**
* Correct the cursor style of increment and decrement buttons in Chrome.
*/
[type="number"]::-webkit-inner-spin-button,
[type="number"]::-webkit-outer-spin-button {
height: auto;
}
/**
* 1. Correct the odd appearance in Chrome and Safari.
* 2. Correct the outline style in Safari.
*/
[type="search"] {
-webkit-appearance: textfield; /* 1 */
outline-offset: -2px; /* 2 */
}
/**
* Remove the inner padding in Chrome and Safari on macOS.
*/
[type="search"]::-webkit-search-decoration {
-webkit-appearance: none;
}
/**
* 1. Correct the inability to style clickable types in iOS and Safari.
* 2. Change font properties to `inherit` in Safari.
*/
::-webkit-file-upload-button {
-webkit-appearance: button; /* 1 */
font: inherit; /* 2 */
}
/* Interactive
========================================================================== */
/*
* Add the correct display in Edge, IE 10+, and Firefox.
*/
details {
display: block;
}
/*
* Add the correct display in all browsers.
*/
summary {
display: list-item;
}
/* Misc
========================================================================== */
/**
* Add the correct display in IE 10+.
*/
template {
display: none;
}
/**
* Add the correct display in IE 10.
*/
[hidden] {
display: none;
}

@ -0,0 +1,130 @@
@import "icons";
@import "normalize";
h1
{
font-weight:700;
font-size:24px;
text-align: center;
color:#666;
font-family: Arial, Helvetica, sans-serif;
}
#top-slider
{
position: relative;
max-width: 100vw;
width: 100vw;
height: 50vh;
overflow: hidden;
}
#slider-position
{
width: 100vw;
height: 30px;
line-height: 30px;
text-align: center;
i
{
content:"\00a0";
display: inline-block;
height: 20px;
width: 20px;
border-radius: 20px;
font-size: 20px;
line-height: 1;
vertical-align: middle;
color:lightseagreen;
&.on
{
background-color:lightseagreen;
}
}
}
.slider
{
position:absolute;
top:0;
left:0;
bottom:0;
right:0;
picture
{
display: block;
position:relative;
max-width:100vw;
overflow: hidden;
}
.slide
{
width:100vw;
height:50vh;
position:absolute;
top:0;
left:0;
bottom:0;
right:0;
transition: all 0.01s;
z-index:1;
}
.slider-nav
{
position:absolute;
z-index:12;
top:50%;
left:0;
right:0;
height:15vh;
//background-color:red;
transform: translateY(-50%);
display: inline-block;
line-height: 15vh;
i
{
color:rgba(255,255,255,0.75);
font-size:9vh;
line-height: 1;
display: inline-block;
vertical-align: middle;
}
span
{
display: block;
position: absolute;
opacity:0;
&:hover
{
opacity: 1;
}
}
.pause
{
width:34%;
left:33%;
text-align: center;
}
.next
{
width:33%;
left:67%;
text-align:right;
}
.prev
{
width:33%;
text-align:left;
}
}
}
.ico-pause2
{
pointer-events: none;
}
#slide-1
{
background: url(./imgs/full/forest-river.jpg);
background-position: center center;
background-size: 100% auto;
}
Loading…
Cancel
Save