├── teste.png ├── src └── tela.png ├── uml ├── teste.png └── teste.drawio ├── index.html ├── style.css ├── README.md ├── teste.drawio └── script.js /teste.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/thiago-rferreira/Projeto-Agenda/HEAD/teste.png -------------------------------------------------------------------------------- /src/tela.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/thiago-rferreira/Projeto-Agenda/HEAD/src/tela.png -------------------------------------------------------------------------------- /uml/teste.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/thiago-rferreira/Projeto-Agenda/HEAD/uml/teste.png -------------------------------------------------------------------------------- /index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 |
4 | 5 | 6 | 7 | 8 | 9 |Detalhe
37 | 38 |Telefone Fixo: ${formateCelular(contato.phone)}
141 |Telefone Celular: ${formateCelular(contato.cellphone)}
142 |${msg}
165 | `; 166 | 167 | msgDiv.innerHTML += msgP; 168 | 169 | setTimeout(function () { 170 | msgDiv.innerHTML = ""; 171 | }, 3000); 172 | } 173 | 174 | function isAnyInputEmpty() { 175 | const fullname = document.getElementById("fullname").value; 176 | const phone = document.getElementById("phone").value; 177 | const cellphone = document.getElementById("cellphone").value; 178 | const photo = document.getElementById("photo").value; 179 | const birthdate = document.getElementById("birthdate").value; 180 | const email = document.getElementById("email").value; 181 | const cep = document.getElementById("cep").value; 182 | const city = document.getElementById("city").value; 183 | const insta = document.getElementById("insta").value; 184 | const github = document.getElementById("github").value; 185 | 186 | 187 | if(fullname == "" || phone == "" || cellphone == "" || photo == "" || birthdate == "" || email == "" || cep == "" || city == "" || insta == "" || github == ""){ 188 | return true; 189 | }else{ 190 | return false; 191 | } 192 | } 193 | 194 | function randomId() { 195 | let id = Math.floor(Math.random() * 10000); 196 | if (checarIdExiste(id) == false) { 197 | console.log("Id não existe: " + id) 198 | return id; 199 | } else { 200 | console.log("Id já existe, tente novamente") 201 | sendMSG("Id já existe, tente novamente", "error"); 202 | } 203 | } 204 | 205 | function checarIdExiste(id) { 206 | console.log("Entrou na checagem: " + id) 207 | const array = listaDeContatos.contatos; 208 | let existe = false; 209 | array.forEach(contato => { 210 | if (contato.id == id) { 211 | console.log("id existe: " + id); 212 | existe = true; 213 | } 214 | }); 215 | 216 | return existe; 217 | } 218 | 219 | function gerarLinkWhatsapp(telefone) { 220 | let link = "https://api.whatsapp.com/send?phone=55" + telefone; 221 | return link; 222 | } 223 | 224 | function gerarLinkInstagram(insta) { 225 | let link = "https://www.instagram.com/" + insta; 226 | return link; 227 | } 228 | 229 | function gerarLinkGithub(github) { 230 | let link = "https://www.github.com/" + github; 231 | return link; 232 | } 233 | 234 | function contatoDetalhe(id) { 235 | const contato = document.getElementById("recebeContato"); 236 | let html = ""; 237 | const pessoa = listaDeContatos.getContactById(id); 238 | let linkWhatsapp = gerarLinkWhatsapp(pessoa.cellphone); 239 | let linkInstagram = gerarLinkInstagram(pessoa.insta); 240 | let linkGithub = gerarLinkGithub(pessoa.github); 241 | 242 | console.log(pessoa) 243 | 244 | html += ` 245 |Identificador: ${pessoa.id}
249 |Celular: ${formateCelular(pessoa.cellphone)}
251 |Telefone: ${formateCelular(pessoa.cellphone)}
252 |Data nascimento: ${formateDataPTBR(pessoa.birthdate)}
253 |Idade: ${pessoa.age}
254 |Signo: ${pessoa.signo}
255 |Email: ${pessoa.email}
256 |CEP: ${formateCEP(pessoa.cep)}
257 |Cidade: ${pessoa.city}
258 |Instagram: ${pessoa.insta}
259 |Github: ${pessoa.github}
260 |