-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
139 lines (108 loc) · 4.56 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
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
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
<!DOCTYPE html>
<html lang="pt-br">
<head>
<!-- METAS -->
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<meta name="description" content="App Lista de afazeres usando Javascript Puro - Fziliotti">
<meta name="mobile-web-app-capable" content="yes">
<meta name="theme-color" content="#317EFB" />
<!-- LINKS -->
<link rel="icon" sizes="192x192" href="imgs/launcher-icon-2x.png">
<link href="manifest.json" rel="manifest" type="UTF-8">
<link rel="shortcut icon" href="imgs/favicon.ico" type="image/x-icon" />
<link rel="stylesheet" href="css/bootstrap4.css">
<link href="https://use.fontawesome.com/releases/v5.4.1/css/all.css" rel="stylesheet">
<link href="https://fonts.googleapis.com/css?family=Ubuntu+Condensed" rel="stylesheet">
<link rel="stylesheet" href="css/sweetalert.css">
<link rel="stylesheet" href="css/main.css">
<title>PWA - FZ Lista de Tarefas</title>
<script type="text/javascript">
if ("serviceWorker" in navigator) {
navigator.serviceWorker.register("sw.js").then(function (registration) {
console.info("Service Worker registration successful with scope: ", registration.scope);
}).catch(function (err) {
console.error("Service Worker registration failed: ", err);
});
}
</script>
</head>
<body>
<header class="header py-4 mb-4">
<h1 class="text-center"> <span class="simbol">
<</span> Lista de Tarefas <span class="simbol">/>
</span>
</h1>
</header>
<div class="container">
<but id="app">
<label class="lblCadastrar" for="novaTarefa">Digite o nome da sua tarefa:</label>
<div class="input-group mb-3">
<input id="novaTarefa" type="text" maxlength="38" class="form-control" placeholder="ex: passear com o cachorro..">
<div class="input-group-append">
<button class="btnPLUS btn btn-success btn-lg" onclick="addTodo()"><span class="btnPLUS-text">+</span></button>
</div>
</div>
<ul id="render" class="my-4 list-group">
</ul>
<!-- <ul style="height: 500px; background-color: #f1f1f1;" ondrop="drop(event)" ondragover="allowDrop(event)" id="render2"
class="my-4 list-group">
</ul> -->
<footer class="footer mt-3">
<span class="text-muted">Desenvolvido por <a class="linkSite" href="https://fziliotti.github.io/Fziliotti/">Fabrício
Fernandes
Ziliotti</a> =)
</span>
<div class="btn-group" role="group" aria-label="Basic example">
<button id="toggleTema" onclick="mudarTema()" class="btn btn-light btn-sm">Mudar-Tema</button>
<button class="add-button btn btn-success">Install this APP</button>
<button type="button" onclick="cronometroFade()" class="btn btn-warning ">Cronometro</button>
<!-- <button type="button" onclick="mostrarConcluidas()" class="btn btn-secondary ">Concluídas</button> -->
</div>
</footer>
<div class="container d-flex ">
<div id="boxCronometro" class="containerTimer esconder mx-auto mt-4">
<h1 class="text-center" data-chronometer>00:00:00</h1>
<button class="btn btn-success" id="play">Começar</button>
<button class="btn btn-secondary" id="pause">Pausar</button>
<button class="btn btn-danger" id="reset">Resetar</button>
</div>
</div>
<button onclick="displayNotification()">Enviar notificação</button>
<script src="js/notification.js"></script>
<script src="js/dragndrop.js"></script>
<script src="js/toDo.js"></script>
<script src="js/pomodoro.js"></script>
<script src="js/temas.js"></script>
<script src="js/cronometro.js"></script>
<script src="js/sweetalert2.js"></script>
<script>
let deferredPrompt;
const addBtn = document.querySelector('.add-button');
addBtn.style.display = 'none';
window.addEventListener('beforeinstallprompt', (e) => {
// Prevent Chrome 67 and earlier from automatically showing the prompt
e.preventDefault();
// Stash the event so it can be triggered later.
deferredPrompt = e;
// Update UI to notify the user they can add to home screen
addBtn.style.display = 'block';
addBtn.addEventListener('click', (e) => {
// hide our user interface that shows our A2HS button
addBtn.style.display = 'none';
// Show the prompt
deferredPrompt.prompt();
// Wait for the user to respond to the prompt
deferredPrompt.userChoice.then((choiceResult) => {
if (choiceResult.outcome === 'accepted') {
console.log('User accepted the A2HS prompt');
} else {
console.log('User dismissed the A2HS prompt');
}
deferredPrompt = null;
});
});
});
</script>
</body>
</html>