parent
63a204ceaf
commit
d87efc614d
@ -0,0 +1,23 @@
|
||||
|
||||
#main-menu
|
||||
{
|
||||
.menu-label
|
||||
{
|
||||
display:none;
|
||||
}
|
||||
ul
|
||||
{
|
||||
display:block;
|
||||
margin-block-start: 1em;
|
||||
margin-block-end: 1em;
|
||||
margin-inline-start: 0px;
|
||||
margin-inline-end: 0px;
|
||||
padding-inline-start: 0px;
|
||||
margin:0px;
|
||||
li
|
||||
{
|
||||
display:inline-block;
|
||||
width:24%;
|
||||
}
|
||||
}
|
||||
}
|
After Width: | Height: | Size: 25 KiB |
After Width: | Height: | Size: 37 KiB |
After Width: | Height: | Size: 25 KiB |
After Width: | Height: | Size: 91 KiB |
@ -0,0 +1,103 @@
|
||||
|
||||
/*
|
||||
|
||||
.contact-form-wrap
|
||||
{
|
||||
position: fixed;
|
||||
top:0;
|
||||
left:0;
|
||||
bottom:0;
|
||||
right:0;
|
||||
background-color: black;
|
||||
}
|
||||
|
||||
.cf
|
||||
{
|
||||
&-form
|
||||
{
|
||||
position: relative;
|
||||
display:table;
|
||||
border-radius:20px;
|
||||
padding:20px;
|
||||
width:auto;
|
||||
margin:0 auto;
|
||||
background-color: white;
|
||||
top:50%;
|
||||
transform:translateY(-50%);
|
||||
}
|
||||
&-input
|
||||
{
|
||||
border: solid 1px #666;
|
||||
border-radius: 4px;
|
||||
padding:4px;
|
||||
}
|
||||
&-label
|
||||
{
|
||||
line-height: 30px;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
&-label
|
||||
{
|
||||
float:left;
|
||||
clear:left;
|
||||
padding-right:20px;
|
||||
}
|
||||
&-input
|
||||
{
|
||||
min-height: 20px;
|
||||
line-height: 20px;
|
||||
float:right;
|
||||
clear:right;
|
||||
box-sizing: border-box;
|
||||
|
||||
}
|
||||
&-textarea
|
||||
{
|
||||
margin:8px 0;
|
||||
display:block;
|
||||
width:100%;
|
||||
clear: both;
|
||||
}
|
||||
&-input-group
|
||||
{
|
||||
&:after
|
||||
{
|
||||
content:"";
|
||||
display: table;
|
||||
clear:both;
|
||||
overflow: auto;
|
||||
}
|
||||
padding:4px;
|
||||
margin:4px;
|
||||
}
|
||||
&-btn
|
||||
{
|
||||
background-color: black;
|
||||
color:white;
|
||||
padding-left:10px;
|
||||
padding-right:10px;
|
||||
}
|
||||
}
|
||||
*/
|
||||
|
||||
/* <form id="cf-main-form" class="cf-form" method="get" action="">
|
||||
<div class="cf-input-group">
|
||||
<label for="nom" class="cf-label">Votre nom</label>
|
||||
<input type="text" id="nom" name="Nom" class="cf-input cf-text" required>
|
||||
</div>
|
||||
|
||||
<div class="cf-input-group">
|
||||
<label for="email" class="cf-label">Votre courriel</label>
|
||||
<input type="email" id="email" name="courriel" class="cf-input cf-email" required>
|
||||
</div>
|
||||
|
||||
<div class="cf-input-group">
|
||||
<label for="message" class="cf-label">Votre message</label>
|
||||
<textarea id="message" name="message" class="cf-input cf-textarea" rows="6" maxlength="3000" required></textarea>
|
||||
</div>
|
||||
|
||||
<div class="cf-input-group">
|
||||
<button type="submit" id="cf-button" class="cf-input cf-btn">Envoyer</button>
|
||||
</div>
|
||||
</form>
|
||||
*/
|
@ -0,0 +1,4 @@
|
||||
#main-menu
|
||||
{
|
||||
display: none!important;
|
||||
}
|
@ -0,0 +1,71 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="utf-8" />
|
||||
<title>A hompage</title>
|
||||
<link rel="stylesheet" href="style-main.css" />
|
||||
<link rel="stylesheet" href="desktop.css" media="screen and (min-width: 480px)" />
|
||||
<link rel="stylesheet" href="print.css" media="print" />
|
||||
</head>
|
||||
<body>
|
||||
<header>
|
||||
<nav id="main-menu">
|
||||
<input type="checkbox" id="switch" hidden />
|
||||
<label for="switch" class="menu-label">
|
||||
<span class="burger"><b class="burger-line"></b><b class="burger-line"></b><b class="burger-line"></b></span>
|
||||
<span class="menu-text">Menu</span>
|
||||
</label>
|
||||
<ul>
|
||||
<li class="top-menu-item "><a href="">About</a></li>
|
||||
<li class="top-menu-item current"><span>Home</span></li>
|
||||
<li class="top-menu-item "><a href="">Blog</a></li>
|
||||
<li class="top-menu-item "><label class="menu-contact-label" for="show-contact">Contact</label></li>
|
||||
</ul>
|
||||
</nav>
|
||||
<div class="img-wrap">
|
||||
<picture>
|
||||
<source type="image/webp" media="(max-width: 359px)" srcset="./espresso.webp">
|
||||
<source media="(max-width: 359px)" srcset="./espresso-vert.jpg">
|
||||
<source media="(orientation: landscape) and (min-width: 360px) and (max-width: 989px)" srcset="./espresso-neg.jpg">
|
||||
<source media="(min-width: 990px)" srcset="./espresso.jpg">
|
||||
<img src="./espresso-vert.jpg" alt="">
|
||||
</picture>
|
||||
</div>
|
||||
<h1>A hompage</h1>
|
||||
</header>
|
||||
<main>
|
||||
Lorem Ipsum is simply dummy text of the printing and typesetting industry.
|
||||
<section>
|
||||
<h2>Lorem Ipsum has been the industry's standard dummy text</h2>
|
||||
<p>ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum</p>
|
||||
</section>
|
||||
<p>ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum</p>
|
||||
</main>
|
||||
<aside></aside>
|
||||
<footer></footer>
|
||||
<input type="checkbox" checked id="show-contact" hidden />
|
||||
<div class="contact-form-wrap">
|
||||
<h3 class="h3">Contact us</h3>
|
||||
<form id="cf-main-form" class="cf-form" method="get" action="">
|
||||
<div class="cf-input-group">
|
||||
<label for="nom" class="cf-label">Votre nom</label>
|
||||
<input type="text" id="nom" name="Nom" class="cf-input cf-text">
|
||||
</div>
|
||||
|
||||
<div class="cf-input-group">
|
||||
<label for="email" class="cf-label">Votre courriel</label>
|
||||
<input type="email" id="email" name="courriel" class="cf-input cf-email">
|
||||
</div>
|
||||
|
||||
<div class="cf-input-group">
|
||||
<label for="message" class="cf-label">Votre message</label>
|
||||
<textarea id="message" name="message" class="cf-input cf-textarea" rows="6" maxlength="3000"></textarea>
|
||||
</div>
|
||||
|
||||
<div class="cf-input-group">
|
||||
<button type="submit" id="cf-button" class="cf-input cf-btn">Envoyer</button>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
@ -0,0 +1,212 @@
|
||||
/////// SESSIONS 1 et 2
|
||||
|
||||
$font : Arial, Helvetica, sans-serif;
|
||||
$normalfontsize : 12px;
|
||||
$marge : 8px;
|
||||
|
||||
body
|
||||
{
|
||||
font-family: $font;
|
||||
font-size:$normalfontsize;
|
||||
}
|
||||
|
||||
h4
|
||||
{
|
||||
font-size:$normalfontsize + 2px;
|
||||
}
|
||||
|
||||
body,figure,img
|
||||
{
|
||||
padding:0;
|
||||
border:none;
|
||||
margin:0;
|
||||
}
|
||||
|
||||
#switch:checked ~ p
|
||||
{
|
||||
background-color:green;
|
||||
}
|
||||
|
||||
img
|
||||
{
|
||||
// avec interpolation
|
||||
width:calc(100% - (#{$marge}*2));
|
||||
height:auto;
|
||||
margin:$marge;
|
||||
top:50%;
|
||||
transform: translateY(-25%);
|
||||
}
|
||||
|
||||
picture
|
||||
{
|
||||
position:relative;
|
||||
display:block;
|
||||
max-height:40vh;
|
||||
overflow:hidden;
|
||||
}
|
||||
|
||||
#main-menu
|
||||
{
|
||||
text-align:center;
|
||||
ul
|
||||
{
|
||||
list-style:none;
|
||||
}
|
||||
|
||||
li
|
||||
{
|
||||
text-align: left;
|
||||
}
|
||||
|
||||
li a,
|
||||
li span,
|
||||
li label
|
||||
{
|
||||
color:black;
|
||||
text-decoration:none;
|
||||
font-size:1.1rem;
|
||||
}
|
||||
|
||||
li span
|
||||
{
|
||||
color:#666;
|
||||
}
|
||||
|
||||
.menu-label
|
||||
{
|
||||
font-size:1.5rem;
|
||||
color:black;
|
||||
text-decoration:none;
|
||||
font-weight:bold;
|
||||
display:inline-block;
|
||||
line-height:2rem;
|
||||
}
|
||||
}
|
||||
.burger
|
||||
{
|
||||
float:left;
|
||||
margin: 3px 8px;
|
||||
b,i
|
||||
{
|
||||
display: block;
|
||||
width: 20px;
|
||||
}
|
||||
b
|
||||
{
|
||||
height: 2px;
|
||||
margin-bottom: 5px;
|
||||
position: relative;
|
||||
background: #000;
|
||||
border-radius: 2px;
|
||||
z-index: 1;
|
||||
&:first-of-type
|
||||
{
|
||||
margin-top:5px;
|
||||
}
|
||||
}
|
||||
i
|
||||
{
|
||||
color:blue;
|
||||
}
|
||||
}
|
||||
|
||||
//switch pour afficher le menu
|
||||
#main-menu ul
|
||||
{
|
||||
display:none;
|
||||
}
|
||||
|
||||
main, h1
|
||||
{
|
||||
margin:1rem;
|
||||
padding:1rem;
|
||||
}
|
||||
|
||||
#main-menu #switch:checked ~ ul
|
||||
{
|
||||
display:block;
|
||||
}
|
||||
|
||||
////////// FORMULAIRE DE CONTACT
|
||||
|
||||
// switch por afficher le conteneur du formulaire
|
||||
.contact-form-wrap
|
||||
{
|
||||
display:none;
|
||||
}
|
||||
|
||||
#show-contact:checked ~ .contact-form-wrap
|
||||
{
|
||||
display:block;
|
||||
}
|
||||
|
||||
// je positionne le fond en fixed pour lui faire occuper toute la page
|
||||
.contact-form-wrap
|
||||
{
|
||||
position:fixed;
|
||||
//fond noir à 25% ce qui donne la transparence
|
||||
background-color:rgba(0,0,0,0.25);
|
||||
top:0;
|
||||
bottom:0;
|
||||
left:0;
|
||||
right:0;
|
||||
.h3
|
||||
{
|
||||
color:white;
|
||||
text-align: center;
|
||||
margin-top:120px;
|
||||
}
|
||||
}
|
||||
|
||||
//je préfixe les éléments du formulaire pour les regrouper dans mon sas
|
||||
.cf
|
||||
{
|
||||
//je centre le formulaire dans son conteneur (.contact-form-wrap)
|
||||
&-form
|
||||
{
|
||||
background-color: white;
|
||||
position: absolute;
|
||||
top:50%;
|
||||
left:50%;
|
||||
transform: translate(-50%,-50%);
|
||||
padding: 20px;
|
||||
border-radius: 20px;
|
||||
}
|
||||
//je normalise tous les inputs / labels
|
||||
&-input, &-label
|
||||
{
|
||||
min-height: 20px;
|
||||
line-height: 20px;
|
||||
box-sizing: border-box;
|
||||
width:100%;
|
||||
min-width:30vh;
|
||||
}
|
||||
&-input
|
||||
{
|
||||
border: solid 1px #666;
|
||||
border-radius: 4px;
|
||||
padding:4px;
|
||||
}
|
||||
&-label
|
||||
{
|
||||
line-height: 30px;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
&-btn
|
||||
{
|
||||
min-width: auto;
|
||||
width:auto;
|
||||
float: right;
|
||||
background-color: black;
|
||||
color:white;
|
||||
padding-left:10px;
|
||||
padding-right:10px;
|
||||
margin-top:4px;
|
||||
&:hover
|
||||
{
|
||||
background-color: white;
|
||||
color:black;
|
||||
transition: color 0.5s;
|
||||
}
|
||||
}
|
||||
}
|
@ -0,0 +1,20 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="fr">
|
||||
<head>
|
||||
<meta charset="utf-8" />
|
||||
<title>Exemple formulaire</title>
|
||||
<link rel="stylesheet" href="style-form.css" />
|
||||
</head>
|
||||
<body>
|
||||
<nav>
|
||||
<label for="formswitch">Contact</label>
|
||||
</nav>
|
||||
<input type="checkbox" id="formswitch" hidden />
|
||||
<form method="get" action="">
|
||||
<label for="nom">Votre nom</label>
|
||||
<input type="text" id="nom" name="name" value="" placeholder="Saisissez votre nom">
|
||||
<label for="message">Votre message</label>
|
||||
<textarea id="message" name="message" placeholder="Votre message"></textarea>
|
||||
</form>
|
||||
</body>
|
||||
</html>
|
Loading…
Reference in new issue