diff --git a/Rytis_George_Baltakys/Javascript/jQuery/gameOfThrones/img/baratheon.png b/Rytis_George_Baltakys/Javascript/jQuery/gameOfThrones/img/baratheon.png new file mode 100644 index 0000000..345e562 Binary files /dev/null and b/Rytis_George_Baltakys/Javascript/jQuery/gameOfThrones/img/baratheon.png differ diff --git a/Rytis_George_Baltakys/Javascript/jQuery/gameOfThrones/img/lannister.jpg b/Rytis_George_Baltakys/Javascript/jQuery/gameOfThrones/img/lannister.jpg new file mode 100644 index 0000000..e3a0358 Binary files /dev/null and b/Rytis_George_Baltakys/Javascript/jQuery/gameOfThrones/img/lannister.jpg differ diff --git a/Rytis_George_Baltakys/Javascript/jQuery/gameOfThrones/img/stark.jpg b/Rytis_George_Baltakys/Javascript/jQuery/gameOfThrones/img/stark.jpg new file mode 100644 index 0000000..c5ab0b7 Binary files /dev/null and b/Rytis_George_Baltakys/Javascript/jQuery/gameOfThrones/img/stark.jpg differ diff --git a/Rytis_George_Baltakys/Javascript/jQuery/gameOfThrones/img/targaryen.jpg b/Rytis_George_Baltakys/Javascript/jQuery/gameOfThrones/img/targaryen.jpg new file mode 100644 index 0000000..97b7d5f Binary files /dev/null and b/Rytis_George_Baltakys/Javascript/jQuery/gameOfThrones/img/targaryen.jpg differ diff --git a/Rytis_George_Baltakys/Javascript/jQuery/gameOfThrones/index.html b/Rytis_George_Baltakys/Javascript/jQuery/gameOfThrones/index.html new file mode 100644 index 0000000..1a8740c --- /dev/null +++ b/Rytis_George_Baltakys/Javascript/jQuery/gameOfThrones/index.html @@ -0,0 +1,21 @@ + + + + Game of Thrones + + + + + + + +
+ + + + +
+
+
+ + \ No newline at end of file diff --git a/Rytis_George_Baltakys/Javascript/jQuery/gameOfThrones/jquery_code.js b/Rytis_George_Baltakys/Javascript/jQuery/gameOfThrones/jquery_code.js new file mode 100644 index 0000000..5f24c01 --- /dev/null +++ b/Rytis_George_Baltakys/Javascript/jQuery/gameOfThrones/jquery_code.js @@ -0,0 +1,23 @@ +$(document).ready(function() { // jQuery bootstrap + + $('.houses img').click(function() { + + // get the data + $.get(`http://www.anapioficeandfire.com/api/houses/${$(this).attr('id')}`, function(res) { + var html = `

${res.name}

`; + html += `
`; + html += `

${res.words}

`; + html += `

Region: ${res.region}

`; + html += `

Coat of Arms: ${res.coatOfArms}

`; + html += `

Founded ${res.founded}

`; + html += ``; + html += `
`; + $('.container').html(html); + }, "json"); + }); + +}); // end of $(document).ready(function() { diff --git a/Rytis_George_Baltakys/Javascript/jQuery/gameOfThrones/style.css b/Rytis_George_Baltakys/Javascript/jQuery/gameOfThrones/style.css new file mode 100644 index 0000000..b938d53 --- /dev/null +++ b/Rytis_George_Baltakys/Javascript/jQuery/gameOfThrones/style.css @@ -0,0 +1,25 @@ +/*CSS reset settings here*/ +* { + margin: 0px; + padding: 0px; +/* border: 1px solid red;*/ +} + +html { + height: 100%; +} + +body { + color: white; + background: #181B1D; + font-family: 'Oxygen Mono', monospace; +} + +img { + width: 300px; + margin: 30px; +} + +div { + margin: 40px; +} \ No newline at end of file diff --git a/Rytis_George_Baltakys/Javascript/jQuery/weather/index.html b/Rytis_George_Baltakys/Javascript/jQuery/weather/index.html new file mode 100644 index 0000000..e000148 --- /dev/null +++ b/Rytis_George_Baltakys/Javascript/jQuery/weather/index.html @@ -0,0 +1,19 @@ + + + + Weather + + + + + + + +
+ + +
+

+

+ + \ No newline at end of file diff --git a/Rytis_George_Baltakys/Javascript/jQuery/weather/jquery_code.js b/Rytis_George_Baltakys/Javascript/jQuery/weather/jquery_code.js new file mode 100644 index 0000000..2502adb --- /dev/null +++ b/Rytis_George_Baltakys/Javascript/jQuery/weather/jquery_code.js @@ -0,0 +1,21 @@ + +$(document).ready(function() { // jQuery bootstrap + + $('form').submit(function() { + var city = jQuery('#city').val(); + jQuery('#city').val(''); + + // get weather data + $.get(`http://api.openweathermap.org/data/2.5/weather?q=${city}&&appid=713a605ad5f61f33344b811369f8dcc5`, function(response) { + var temperatureKelvin = response.main.temp; + var city = response.name; + var temperatureCelsius = Math.round(temperatureKelvin - 273.15); + var temperatureFarenheit = Math.round(temperatureCelsius * 9 / 5 + 32); + + $('#cityname').text(city); + $('#temperature').html("Temperature: " + temperatureCelsius + "c (" + temperatureFarenheit + "f)"); + }, "json"); + return false; // don't let form submit and refresh page + }); + +}); // end of $(document).ready(function() { diff --git a/Rytis_George_Baltakys/Javascript/jQuery/weather/style.css b/Rytis_George_Baltakys/Javascript/jQuery/weather/style.css new file mode 100644 index 0000000..21ba92d --- /dev/null +++ b/Rytis_George_Baltakys/Javascript/jQuery/weather/style.css @@ -0,0 +1,8 @@ +body { + margin: 50px; +} + +input { + padding: 5px; + margin: 10px; +} \ No newline at end of file