Last active
August 29, 2015 14:27
-
-
Save navinpai/840bbad0ef0a3e238273 to your computer and use it in GitHub Desktop.
Look Outside
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
//Script which takes the current APOD photo and shows it in an svg along with a #LookOutside reminder | |
$.get( "https://api.nasa.gov/planetary/apod?api_key=NNKOjkoul8n1CH18TWA9gwngW1s1SmjESPjNoUFo", function(data) { | |
var url = data.url; | |
var bg = document.createElementNS('http://www.w3.org/2000/svg','image'); | |
bg.setAttributeNS(null,'height','450'); | |
bg.setAttributeNS(null,'width','600'); | |
bg.setAttributeNS('http://www.w3.org/1999/xlink','href',url); | |
bg.setAttributeNS(null, 'visibility', 'visible'); | |
$('#lookoutside').append(bg); | |
var fg = document.createElementNS('http://www.w3.org/2000/svg','image'); | |
fg.setAttributeNS(null,'height','250'); | |
fg.setAttributeNS(null,'width','250'); | |
fg.setAttributeNS('http://www.w3.org/1999/xlink','href','http://i.imgur.com/ImNlxrm.png'); | |
fg.setAttributeNS(null,'x','0'); | |
fg.setAttributeNS(null,'y','200'); | |
fg.setAttributeNS(null, 'visibility', 'visible'); | |
$('#lookoutside').append(fg); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment