Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
21 changes: 21 additions & 0 deletions Rytis_George_Baltakys/Javascript/jQuery/gameOfThrones/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
<!DOCTYPE html>
<html>
<head>
<title>Game of Thrones</title>
<meta charset="utf-8">
<link href="https://fonts.googleapis.com/css?family=Oxygen+Mono" rel="stylesheet">
<link rel="stylesheet" href="style.css"></style>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.1.1/jquery.min.js"></script>
<script src="jquery_code.js"></script>
</head>
<body>
<div class="houses">
<img id="15" src="img/baratheon.png">
<img id="40" src="img/lannister.jpg">
<img id="3" src="img/stark.jpg">
<img id="5" src="img/targaryen.jpg">
</div>
<div class="container">
</div>
</body>
</html>
Original file line number Diff line number Diff line change
@@ -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 = `<h1>${res.name}</h1>`;
html += `<div class='info'>`;
html += `<p>${res.words}</p>`;
html += `<p>Region: ${res.region}</p>`;
html += `<p>Coat of Arms: ${res.coatOfArms}</p>`;
html += `<p>Founded ${res.founded}</p>`;
html += `<ul>`;
for (var i = 0; i < res.titles.length; i++) {
html += `<li>${res.titles[i]}</li>`;
}
html += `</ul>`;
html += `</div>`;
$('.container').html(html);
}, "json");
});

}); // end of $(document).ready(function() {
25 changes: 25 additions & 0 deletions Rytis_George_Baltakys/Javascript/jQuery/gameOfThrones/style.css
Original file line number Diff line number Diff line change
@@ -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;
}
19 changes: 19 additions & 0 deletions Rytis_George_Baltakys/Javascript/jQuery/weather/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
<!DOCTYPE html>
<html>
<head>
<title>Weather</title>
<meta charset="utf-8">
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" integrity="sha384-BVYiiSIFeK1dGmJRAkycuHAHRg32OmUcww7on3RYdg4Va+PmSTsz/K68vbdEjh4u" crossorigin="anonymous">
<link rel="stylesheet" href="style.css"></style>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.1.1/jquery.min.js"></script>
<script src="jquery_code.js"></script>
</head>
<body>
<form>
<label for="city">City:</label>
<input id="city" type="text" name="city" placeholder="City"><button type="submit" class="btn btn-default">Search Weather</button>
</form>
<h2 class="col-md-12" id="cityname"></h2>
<h3 class="col-md-12" id="temperature"></h3>
</body>
</html>
21 changes: 21 additions & 0 deletions Rytis_George_Baltakys/Javascript/jQuery/weather/jquery_code.js
Original file line number Diff line number Diff line change
@@ -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 <small>(" + temperatureFarenheit + "f)</small>");
}, "json");
return false; // don't let form submit and refresh page
});

}); // end of $(document).ready(function() {
8 changes: 8 additions & 0 deletions Rytis_George_Baltakys/Javascript/jQuery/weather/style.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
body {
margin: 50px;
}

input {
padding: 5px;
margin: 10px;
}