One Paragraph of project description goes here
These instructions will get you a copy of the project up and running on your local machine for development and testing purposes. See deployment for notes on how to deploy the project on a live system.
<input id="test_id" class="test_class" name="test_name" type="hidden" value="test" /> |
html, body{ | |
height:100%; | |
} | |
body{ | |
background-repeat: no-repeat; | |
background-size: cover; | |
background-position: 50% 50%; | |
margin:0; | |
font-family: sans-serif; | |
} |
{ | |
"name": "MyChromeExtension", | |
"version": "1.0", | |
"chrome_url_overrides" : { | |
"newtab": "index.html" | |
}, | |
"manifest_version": 2 | |
} |
html, body{ | |
height:100%; | |
} | |
body{ | |
background-repeat: no-repeat; | |
background-size: cover; | |
background-position: 50% 50%; | |
margin:0; | |
font-family: sans-serif; |
{ | |
"name": "MyChromeExtension", | |
"version": "1.0", | |
"permissions": ["storage"], | |
"chrome_url_overrides" : { | |
"newtab": "index.html" | |
}, | |
"manifest_version": 2 | |
} |
input.user-name{ | |
width:20em; | |
text-align: center; | |
background: 0; | |
border: 0; | |
border-bottom: 2px solid #fff; | |
outline: 0; | |
font-size:30px; | |
color: #fff; | |
margin-top: 20px; |
{ | |
"name": "MyChromeExtension", | |
"version": "1.0", | |
"permissions": ["storage"], | |
"chrome_url_overrides" : { | |
"newtab": "index.html" | |
}, | |
"manifest_version": 2, | |
"content_security_policy": "script-src 'self' https://code.jquery.com; object-src 'self'" | |
} |
$(document).ready(function(){ | |
$('.user-name').keypress(function(e) { | |
if(e.which == 13) { | |
var value = e.target.value; | |
if(!value) return; | |
$('.user-name').fadeOut(function(){ | |
$('.greeting').html(`Hello ${value}.`); | |
$('.greeting').fadeIn(function(){ | |
setCookie('username', value,365); | |
}); |
function newimage(keyword){ | |
if(!ACCESS_KEY){ | |
alert("Please update your access key"); | |
return; | |
} | |
var url = `https://api.unsplash.com/search/photos?query=${keyword}&per_page=20&orientation=landscape&client_id=${ACCESS_KEY}`; | |
$.get(url,function(data){ | |
var picture_url = data.results[0].urls.raw; | |
setCookie("picture",picture_url); | |
$('body').css('background-image',`url(${picture_url})`); |