diff options
Diffstat (limited to 'public')
-rw-r--r-- | public/css/form.css | 54 | ||||
-rw-r--r-- | public/css/modif_page.css | 4 | ||||
-rw-r--r-- | public/js/form.js | 28 |
3 files changed, 84 insertions, 2 deletions
diff --git a/public/css/form.css b/public/css/form.css new file mode 100644 index 0000000..473252c --- /dev/null +++ b/public/css/form.css | |||
@@ -0,0 +1,54 @@ | |||
1 | .form form{ | ||
2 | background-color: white; | ||
3 | margin: auto; | ||
4 | padding: 10px; | ||
5 | max-width: 800px; | ||
6 | display: grid; | ||
7 | grid-template-columns: auto 1fr; | ||
8 | gap: 10px; | ||
9 | align-items: center; /* vertical */ | ||
10 | } | ||
11 | .form label{ | ||
12 | text-align: right; | ||
13 | } | ||
14 | .form .full_width_column{ | ||
15 | grid-column: 1 / span 2; | ||
16 | } | ||
17 | .form form input[type=submit] | ||
18 | { | ||
19 | color: #ff1d04; | ||
20 | font-size: medium; | ||
21 | border-radius: 4px; | ||
22 | background-color: white; | ||
23 | border: lightgrey 2px outset; | ||
24 | } | ||
25 | .form form input[type=submit]:hover | ||
26 | { | ||
27 | background-color: #ffff00; | ||
28 | border-radius: 4px; | ||
29 | cursor: pointer; | ||
30 | } | ||
31 | |||
32 | .no_recipient_warning{ | ||
33 | color: red; | ||
34 | text-align: center; | ||
35 | } | ||
36 | |||
37 | .form .admin_form{ | ||
38 | background-color: #f0f0f0; | ||
39 | margin: auto; | ||
40 | padding: 10px; | ||
41 | max-width: 800px; | ||
42 | } | ||
43 | |||
44 | @media screen and (max-width: 600px){ | ||
45 | .form form{ | ||
46 | grid-template-columns: 1fr; | ||
47 | } | ||
48 | .form label{ | ||
49 | text-align: left; | ||
50 | } | ||
51 | .form .full_width_column { | ||
52 | grid-column: 1; | ||
53 | } | ||
54 | } \ No newline at end of file | ||
diff --git a/public/css/modif_page.css b/public/css/modif_page.css index d743e9e..77392d2 100644 --- a/public/css/modif_page.css +++ b/public/css/modif_page.css | |||
@@ -13,10 +13,10 @@ | |||
13 | background-color: white; | 13 | background-color: white; |
14 | border: lightgrey 2px outset; | 14 | border: lightgrey 2px outset; |
15 | } | 15 | } |
16 | .page_modificationselect:hover | 16 | /*.page_modification select:hover |
17 | { | 17 | { |
18 | cursor: pointer; | 18 | cursor: pointer; |
19 | } | 19 | }*/ |
20 | .page_modification form input[type=submit]:hover | 20 | .page_modification form input[type=submit]:hover |
21 | { | 21 | { |
22 | background-color: #ffff00; | 22 | background-color: #ffff00; |
diff --git a/public/js/form.js b/public/js/form.js new file mode 100644 index 0000000..6386ea8 --- /dev/null +++ b/public/js/form.js | |||
@@ -0,0 +1,28 @@ | |||
1 | //function sendMessage(){} | ||
2 | |||
3 | function changeRecipient(){ | ||
4 | const email = document.getElementById('recipient').value; | ||
5 | const id_form = ''; | ||
6 | |||
7 | fetch('index.php?action=recipient_email', { | ||
8 | method: 'POST', | ||
9 | headers: { | ||
10 | 'Content-Type': 'application/json' | ||
11 | }, | ||
12 | body: JSON.stringify({ id_form: id_form, email: email }) | ||
13 | }) | ||
14 | .then(response => response.json()) | ||
15 | .then(data => { | ||
16 | if(data.success) | ||
17 | { | ||
18 | toastNotify('Adresse e-mail de destination modifiée'); | ||
19 | } | ||
20 | else { | ||
21 | |||
22 | console.error('Erreur: echec de la modification de l\'adresse e-mail de destination'); | ||
23 | } | ||
24 | }) | ||
25 | .catch(error => { | ||
26 | console.error('Erreur:', error); | ||
27 | }); | ||
28 | } \ No newline at end of file | ||