This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html lang="pt-br" class="no-js" ng-app="SenhaSegura"> | |
<head> | |
<meta charset="utf-8" /> | |
<meta http-equiv="X-UA-Compatible" content="IE=edge" /> | |
<meta content="width=device-width, initial-scale=1, maximum-scale=1" name="viewport" /> | |
<title>Aplicação Senha Forte e Segura em AngularJs</title> | |
<!-- Inclusão dos arquivos minified do: Bootstrap e do CSS --> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
navigator.getUserMedia( | |
//Opções: | |
{ | |
video: true | |
}, | |
//Callback - Sucesso: | |
function (stream){ | |
// Criará um objeto URL para o stream de video e irá | |
// iniciar como src do nosso elemento video do HTML |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function tirarFoto(){ | |
var esconder_canvas = document.querySelector('canvas'), | |
video = document.querySelector('video.camera_stream'), | |
imagem = document.querySelector('img.foto'), | |
// Retornará o tamanho exato do elemento do video: | |
largura = video.videoWidth, | |
altura = video.videoHeight, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(...) | |
<a id="dl-btn" href="#" download="sua_foto_selfie.png">Salvar Foto</a> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function tirarFoto(){ | |
//... | |
// Retornará a image através do dataURL para o canvas: | |
var imageDataURL = esconder_canvas.toDataURL('image/png'); | |
// Define o atributo href do botão de download. | |
document.querySelector('#dl-btn').href = imageDataURL; | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html lang="pt-br"> | |
<head> | |
<title>Tutorial - Code4Coders</title> | |
<meta charset="UTF-8"> | |
<meta http-equiv="X-UA-Compatible" content="IE=edge" /> | |
<meta content="width=device-width, initial-scale=1, maximum-scale=1" name="viewport" /> | |
<!-- Latest compiled and minified CSS --> | |
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" integrity="sha384-BVYiiSIFeK1dGmJRAkycuHAHRg32OmUcww7on3RYdg4Va+PmSTsz/K68vbdEjh4u" crossorigin="anonymous"> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html lang="pt-br"> | |
<head> | |
<title>Tutorial - Code4Coders</title> | |
<meta charset="UTF-8"> | |
<meta http-equiv="X-UA-Compatible" content="IE=edge" /> | |
<meta content="width=device-width, initial-scale=1, maximum-scale=1" name="viewport" /> | |
<!-- Latest compiled and minified CSS --> | |
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" integrity="sha384-BVYiiSIFeK1dGmJRAkycuHAHRg32OmUcww7on3RYdg4Va+PmSTsz/K68vbdEjh4u" crossorigin="anonymous"> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@import url(https://fonts.googleapis.com/css?family=News+Cycle:400,700); | |
body { | |
margin: 0; | |
background: #000; | |
overflow: hidden; | |
} | |
.intro { | |
position: absolute; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@import url(https://fonts.googleapis.com/css?family=News+Cycle:400,700); | |
body { | |
margin: 0; | |
background: #000; | |
overflow: hidden; | |
} | |
.intro { | |
position: absolute; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var width = window.innerWidth; | |
var height = window.innerHeight; | |
var intro = document.getElementByClassName("intro")[0]; | |
intro.style.fontSize = width / 30 + "px"; | |
window.addEventListener("resize", function() { | |
width = canvas.width = window.innerWidth; | |
height = canvas.height = window.innerHeight; |
OlderNewer