Skip to content

Instantly share code, notes, and snippets.

View glaucia86's full-sized avatar
💭
Are you coding?! Yep! Always!

Glaucia Lemos glaucia86

💭
Are you coding?! Yep! Always!
View GitHub Profile
@glaucia86
glaucia86 / index.html
Created January 25, 2017 14:24
Página Principal do Projeto
<!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 -->
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
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,
(...)
<a id="dl-btn" href="#" download="sua_foto_selfie.png">Salvar Foto</a>
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;
@glaucia86
glaucia86 / index.html
Created March 8, 2017 15:32
Página Principal - App Intro Star Wars: Parte I
<!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">
@glaucia86
glaucia86 / index.html
Created March 8, 2017 15:50
Página Principal - App Intro Star Wars: Parte II
<!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">
@glaucia86
glaucia86 / style.css
Created March 8, 2017 15:54
Estilo - App Intro Star Wars: Parte I
@import url(https://fonts.googleapis.com/css?family=News+Cycle:400,700);
body {
margin: 0;
background: #000;
overflow: hidden;
}
.intro {
position: absolute;
@glaucia86
glaucia86 / style.css
Created March 8, 2017 16:19
Estilo- App Intro Star Wars: Parte II
@import url(https://fonts.googleapis.com/css?family=News+Cycle:400,700);
body {
margin: 0;
background: #000;
overflow: hidden;
}
.intro {
position: absolute;
@glaucia86
glaucia86 / script.js
Last active March 8, 2017 16:49
Script - App Intro Star Wars: Parte I
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;