Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit e6bb9a6
Showing
5 changed files
with
111 additions
and
0 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
<html> | ||
<head> | ||
<title>My IP</title> | ||
<script src="https://code.jquery.com/jquery-2.2.3.js" integrity="sha256-laXWtGydpwqJ8JA+X9x2miwmaiKhn8tVmOVEigRNtP4=" crossorigin="anonymous"></script> | ||
<link rel="stylesheet" type="text/css" href="./style/fonts.css"> | ||
<link rel="stylesheet" type="text/css" href="./style/style.css"> | ||
</head> | ||
<body> | ||
<div id="outer"> | ||
<div id="inner"> | ||
</div> | ||
</div> | ||
<script type="text/javascript" src="./js/main.js" defer></script> | ||
</body | ||
</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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
|
||
|
||
/* | ||
Given http://httpbin.org/ip as an API endpoint that returns your current IP, | ||
write a JavaScript function that makes a call to the endpoint, gets the value | ||
returned and displays it on an HTML page. | ||
How will you test this? */ | ||
|
||
// (function() { | ||
// var result; | ||
// var xhr = new XMLHttpRequest(); | ||
// xhr.open("GET","https://httpbin.org/ip?format=json", false); | ||
// xhr.overrideMimeType("application/json"); | ||
// xhr.send(); | ||
// if(xhr.status === 200){ | ||
// result = JSON.parse(xhr.responseText); | ||
// } | ||
|
||
// console.log("Log result"); | ||
// console.log(result); | ||
// var inner = document.getElementById("inner"); | ||
// inner.innerHTML = result.origin; | ||
// })(); | ||
|
||
$(function() { | ||
var result; | ||
$.getJSON("https://httpbin.org/ip?format=json").success( function(data) { | ||
console.log("Log Result") | ||
result = JSON.stringify(data); | ||
}).then(function(result) { | ||
$('#inner').text(result.origin); | ||
}) | ||
}) |
Binary file not shown.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
@font-face { | ||
font-family: 'LeagueGothicRegular'; | ||
src: url('LeagueGothic-Regular-webfont.eot'); | ||
src: url('LeagueGothic-Regular-webfont.eot?#iefix') format('embedded-opentype'), | ||
url('LeagueGothic-Regular-webfont.woff') format('woff'), | ||
url('LeagueGothic-Regular-webfont.ttf') format('truetype'), | ||
url('LeagueGothic-Regular-webfont.svg#LeagueGothicRegular') format('svg'); | ||
font-weight: normal; | ||
font-style: normal; | ||
|
||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
/* Regular */ | ||
@font-face { | ||
font-family: 'LeagueGothic'; | ||
src: url('leaguegothic-italic-webfont.eot'); | ||
src: url('leaguegothic-italic-webfont.eot?#iefix') format('embedded-opentype'), | ||
url('leaguegothic-italic-webfont.woff') format('woff'), | ||
url('leaguegothic-italic-webfont.ttf') format('truetype'), | ||
url('leaguegothic-italic-webfont.svg#league_gothic_italicregular') format('svg'); | ||
font-weight: normal; | ||
font-style: italic; | ||
|
||
} | ||
|
||
|
||
body { | ||
background-color: ; | ||
text-align: center; | ||
color: red, | ||
font-family: '90px LeagueGothic'; | ||
|
||
} | ||
|
||
#outer { | ||
display: table; | ||
width: 100%; | ||
height: 100%; | ||
} | ||
|
||
#inner { | ||
display: table-cell; | ||
vertical-align: middle; | ||
text-align: center; | ||
padding-left: 100px; | ||
padding-right: 100px; | ||
text-decoration: none; | ||
font: 50px 'LeagueGothicRegular'; | ||
color: red; | ||
} | ||
|
||
#innerd { | ||
display: table-cell; | ||
vertical-align: middle; | ||
text-align: center; | ||
padding-left: 50px; | ||
padding-right: 50px; | ||
text-decoration: none; | ||
font: 50px 'LeagueGothicRegular'; | ||
color: red; | ||
} | ||
|