Skip to content

Instantly share code, notes, and snippets.

View thejungwon's full-sized avatar
🦄
Focusing

Jungwon Seo thejungwon

🦄
Focusing
View GitHub Profile
@thejungwon
thejungwon / README-Template.md
Created July 16, 2018 11:55 — forked from PurpleBooth/README-Template.md
A template to make good README.md

Project Title

One Paragraph of project description goes here

Getting Started

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.

Prerequisites

<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
}
@thejungwon
thejungwon / style.css
Last active September 28, 2018 17:25
phase2
html, body{
height:100%;
}
body{
background-repeat: no-repeat;
background-size: cover;
background-position: 50% 50%;
margin:0;
font-family: sans-serif;
@thejungwon
thejungwon / manifest.json
Created September 28, 2018 17:40
phase 2
{
"name": "MyChromeExtension",
"version": "1.0",
"permissions": ["storage"],
"chrome_url_overrides" : {
"newtab": "index.html"
},
"manifest_version": 2
}
@thejungwon
thejungwon / style.css
Last active September 28, 2018 17:42
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'"
}
@thejungwon
thejungwon / script.js
Created September 28, 2018 20:02
version 1
$(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})`);