margin: 0;
box-sizing: border-box; }
-@font-face {
- font-family: "Barlow";
- src: url("../BarlowSemiCondensed-Medium.woff") format("woff"); }
+html, body {
+ height: 100%; }
+
body {
- font-family: Barlow, sans-serif; }
+ font-family: Barlow, sans-serif;
+ font-weight: 500; }
.form {
display: inherit; }
background-image: url("../img/background.png");
background-size: cover;
background-repeat: no-repeat;
- width: 100vw;
- height: 100vh;
background-position: center;
+ min-height: 100%;
display: flex;
align-items: center;
flex-direction: column; }
border: none;
font-size: 20px;
color: black;
- padding: 0 24px; }
+ padding: 0 24px;
+ border-radius: 0; }
.mail-btn {
width: 384px;
height: 60px;
@media (max-width: 900px) {
.form {
- display: block; }
-
- .mail-btn {
display: block;
- width: 300px;
- max-width: 300px;
- min-width: 200px;
- margin: 0 20px; }
+ margin-bottom: 40px; }
- .mail {
+ .mail-btn, .mail {
+ display: block;
width: 300px;
- max-width: 300px;
- min-width: 200px;
- margin: 0 20px; }
+ margin: 0 10px; }
.img {
max-width: 250px; }
input::placeholder {
text-align: center; } }
+.sendMessage {
+ color: white;
+ font-size: 24px; }
/*# sourceMappingURL=style.css.map */
padding: 0
margin: 0
box-sizing: border-box
-@font-face
- font-family: "Barlow"
- src: url("../BarlowSemiCondensed-Medium.woff") format("woff")
+html,body
+ height: 100%
body
font-family: Barlow, sans-serif
+ font-weight: 500
+
.form
display: inherit
background-image: url("../img/background.png")
background-size: cover
background-repeat: no-repeat
- width: 100vw
- height: 100vh
background-position: center
+ min-height: 100%
display: flex
align-items: center
flex-direction: column
font-size: 20px
color: black
padding: 0 24px
+ border-radius: 0
&-btn
width: 384px
height: 60px
@media (max-width: 900px)
.form
display: block
- .mail-btn
+ margin-bottom: 40px
+ .mail-btn, .mail
display: block
width: 300px
- max-width: 300px
- min-width: 200px
- margin: 0 20px
- .mail
- width: 300px
- max-width: 300px
- min-width: 200px
- margin: 0 20px
+ margin: 0 10px
.img
max-width: 250px
input::placeholder
text-align: center
+.sendMessage
+ color: white
+ font-size: 24px
-<?php
-if(isset($_POST['mail']))
-{
- $data=$_POST['mail'].PHP_EOL;
- $fp = fopen('mail.txt', 'a');
- fwrite($fp, $data);
- fclose($fp);
-}
-?>
<!doctype html>
<html lang="en">
<head>
<meta name="viewport"
content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
+ <link href="https://fonts.googleapis.com/css?family=Barlow:500&display=swap" rel="stylesheet">
<link rel="stylesheet" href="css/style.css">
<title>Macair</title>
</head>
<div class="container">
<img class="img" src="img/logo.png" alt="">
- <form class="form" method="post">
- <input class="mail" type="email" name="mail" placeholder="votre email">
- <button class="mail-btn" type="submit">S'inscrire à la newsletter</button>
- </form>
+ <?php
+ if (isset($_POST['mail']) && !empty($_POST['mail'])) {
+ $data = $_POST['mail'].PHP_EOL;
+ $fp = fopen('mail.txt', 'a');
+ fwrite($fp, $data);
+ fclose($fp);
+
+ echo "<p class='sendMessage'>Merci de vous être inscrit(e)</p>";
+
+ } else {
+ ?>
+ <form class='form' method='post'>
+ <input class='mail' type='email' name='mail' placeholder='votre email' required>
+ <button class='mail-btn' type='submit'>S'inscrire à la newsletter</button>
+ </form>
+ <?php
+ }
+ ?>
+
</div>
</body>