-
Notifications
You must be signed in to change notification settings - Fork 0
/
head.php
121 lines (111 loc) · 4.72 KB
/
head.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
<?php
session_start();
?>
<!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">
<link rel="stylesheet" href="head.css">
<link rel="preconnect" href="https://fonts.googleapis.com">
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
<link href="https://fonts.googleapis.com/css2?family=Poppins:wght@600&display=swap" rel="stylesheet">
</head>
<body>
<header>
<a href="pageAccueil.php" class="logo">
<img src="./leaf1.png" alt="logo">
<span>Beautymix</span>
</a>
<div class="group">
<ul class="navigation">
<li>
<a href="#">Recettes</a>
<div class="option">
<ul>
<li>
<span>Par catégorie</span>
<ul>
<li><a href="visage.php"><span>Visage</span></a></li>
<li><a href="cheveux.php"><span>Cheveux</span></a></li>
<li><a href="corps.php"><span>Corps</span></a></li>
</ul>
</li>
</ul>
</div>
</li>
<li><a href="https://dermoplant.com/fr/questionnaire-quel-est-votre-type-de-peau/">Quiz</a></li>
<li><a href="aboutus.php">Sur nous</a></li>
<li><a href="contact.php">Contact</a></li>
<li><a href="connexion.php">Compte</a></li>
</ul>
<div class="search">
<span class="icon">
<ion-icon name="search" class="searchBtn"></ion-icon>
<ion-icon name="close" class="closeBtn"></ion-icon>
</span>
</div>
<ion-icon name="menu-outline" class="menu"></ion-icon>
</div>
<div class="searchBox">
<form action="recherche.php" method="GET">
<div class="searchInput">
<input type="text" placeholder="Recherche . . ." name="searchInput" autocomplete="off">
<datalist id="suggestionsList"></datalist>
</div>
<input type="submit" value="Chercher" class="submitBtn">
</form>
</div>
</header>
<!-- Script pour pouvoir utiliser les icones rechercher et fermer -->
<script type="module" src="https://unpkg.com/[email protected]/dist/ionicons/ionicons.esm.js"></script>
<script nomodule src="https://unpkg.com/[email protected]/dist/ionicons/ionicons.js"></script>
<!-- Script pour les boutons search et close -->
<script>
let searchBtn = document.querySelector('.searchBtn');
let closeBtn = document.querySelector('.closeBtn');
let searchBox = document.querySelector('.searchBox');
let navigation = document.querySelector('.navigation');
let menu = document.querySelector('.menu');
let header = document.querySelector('header');
let searchForm = document.querySelector('.searchBox form');
searchBtn.onclick = function () {
searchBox.classList.add('active');
closeBtn.classList.add('active');
searchBtn.classList.add('active');
menu.classList.add('hide');
header.classList.remove('open');
searchForm.innerHTML = '<input type="text" placeholder="Recherche . . ." name="searchInput"><input type="submit" value="Chercher" class="submitBtn">';
}
closeBtn.onclick = function () {
searchBox.classList.remove('active');
closeBtn.classList.remove('active');
searchBtn.classList.remove('active');
menu.classList.remove('hide');
searchForm.innerHTML = '<input type="text" placeholder="Recherche . . .">';
}
menu.onclick = function () {
header.classList.toggle('open');
searchBox.classList.remove('active');
closeBtn.classList.remove('active');
searchBtn.classList.remove('active');
}
// Fonction pour récupérer les suggestions de recherche
function fetchSuggestions() {
var searchTerm = document.getElementById('searchinfo').value;
suggestionsList.innerHTML = ''; // Réinitialiser la liste des suggestions
// Effectuer une requête AJAX ou utiliser votre propre logique pour obtenir les suggestions
// Ici, nous ajoutons des suggestions statiques à titre d'exemple
var suggestions = ['Visage', 'Cheveux', 'Corps', 'Citron', 'Miel', 'Rass l7anout'];
suggestions.forEach(function (suggestion) {
var option = document.createElement('option');
option.value = suggestion;
suggestionsList.appendChild(option);
});
}
// Écouter l'événement d'entrée dans le champ de recherche pour récupérer les suggestions
document.getElementById('searchinfo').addEventListener('input', fetchSuggestions);
</script>
</body>
</html>