-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
81 lines (78 loc) · 3.34 KB
/
index.html
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
<!DOCTYPE html>
<html lang="fr">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Accueil</title>
<link rel="preconnect" href="https://fonts.googleapis.com">
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
<link rel="manifest" href="/manifest.json">
<link href="https://fonts.googleapis.com/css2?family=Kreon:wght@300..700&display=swap" rel="stylesheet">
<link rel="stylesheet" href="back/Assets/style/style.css">
</head>
<body>
<div class="fond">
</div>
<header>
<div class="logoImage">
<img src="back/images/Logo.png">
</div>
</header>
<main>
<a class="button type--C cachetel" href="public/camera/give_me_color.html">
<div class="button__line"></div>
<div class="button__line"></div>
<span class="button__text">Importe</span>
<div class="button__drow1"></div>
<div class="button__drow2"></div>
</a>
<a class="button type--C btnphoto" href="public/camera/the-color-is.html">
<div class="button__line"></div>
<div class="button__line"></div>
<span class="button__text">Photo</span>
<div class="button__drow1"></div>
<div class="button__drow2"></div>
</a>
<a class="button type--C" href="public/jeux/find-the-color.html">
<div class="button__line"></div>
<div class="button__line"></div>
<span class="button__text">Trouve la couleur</span>
<div class="button__drow1"></div>
<div class="button__drow2"></div>
</a>
<button id="install-button" class="button type--C" style="display:none;" >
<div class="button__line"></div>
<div class="button__line"></div>
<span class="button__text">Installer l'application</span>
<div class="button__drow1"></div>
<div class="button__drow2"></div>
</button>
</main>
<script>
let deferredPrompt;
window.addEventListener('beforeinstallprompt', (e) => {
// Empêchez le navigateur d'afficher automatiquement la bannière d'installation
e.preventDefault();
// Stockez l'événement pour l'utiliser plus tard
deferredPrompt = e;
// Affichez votre interface utilisateur personnalisée pour proposer l'installation
document.getElementById('install-button').style.display = 'block';
});
document.getElementById('install-button').addEventListener('click', (e) => {
// Masquez l'interface utilisateur de l'installation
document.getElementById('install-button').style.display = 'none';
// Affichez la bannière d'installation
deferredPrompt.prompt();
// Attendez la réponse de l'utilisateur
deferredPrompt.userChoice.then((choiceResult) => {
if (choiceResult.outcome === 'accepted') {
console.log('Utilisateur a accepté l\'installation');
} else {
console.log('Utilisateur a refusé l\'installation');
}
deferredPrompt = null;
});
});
</script>
</body>
</html>