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
47 changes: 47 additions & 0 deletions Rytis_George_Baltakys/Javascript/jQuery/arenaGame/arena.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
body {
font-family: sans-serif;
text-align: center;
background: url("img/freshprince.jpg");
background-size: 100%;
}


.box {
width: 460px;
margin: 80px auto;
padding: 20px;
background-color: rgba(150, 150, 150, 0.5);
border-radius: 20px;
}

button {
display: inline-block;
font-size: 20px;
width: 180px;
padding: 15px;
margin: 15px;
}

#next {
color: lightblue;
text-decoration: underline;
margin-left: 60%;
}

select {
font-size: 20px;
width: 150px;
margin: 20px;
}

.player1 {
width: 200px;
margin-right: 200px;
display: inline-block;
}

.player2 {
width: 200px;
margin-left: 200px;
display: inline-block;
}
123 changes: 123 additions & 0 deletions Rytis_George_Baltakys/Javascript/jQuery/arenaGame/arena.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,123 @@
<!DOCTYPE html>
<html>

<head>

<meta charset="utf-8">
<title>Arena</title>
<link rel="stylesheet" href="arena.css">
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script>
<script type="text/javascript">

$(document).ready(function() {
$('#box2').hide();

$("button[name='beach']").click(function() {
$('body').css('background', 'url("img/beach.jpg")').css('background-size', '100%');
});

$("button[name='mars']").click(function() {
$('body').css('background', 'url("img/mars.jpg")').css('background-size', '100%');
});

$("button[name='finalDestination']").click(function() {
$('body').css('background', 'url("img/final.jpg")').css('background-size', '100%');
});

$("button[name='desert']").click(function() {
$('body').css('background', 'url("img/desert.jpg")').css('background-size', '100%');
});

$('#next').click(function() {
$('#box1').hide();
$('#box2').fadeIn();
});

$('#select1').change(function() {
if ($(this).val() == 'gary') {
$('.player1').html('<img src="img/gary.gif">');
$('.player1 img').css('width', '120%')
}
else if ($(this).val() == 'spongebob') {
$('.player1').html('<img src="img/spongebob.gif">');
$('.player1 img').css('width', '120%')
}
else if ($(this).val() == 'kerrigan') {
$('.player1').html('<img src="img/kerr.png">');
$('.player1 img').css('width', '200%')
}
else if ($(this).val() == 'tassadar') {
$('.player1').html('<img src="img/tass.png">');
$('.player1 img').css('width', '120%')
}
});

$('#select2').change(function() {
if ($(this).val() == 'gary') {
$('.player2').html('<img src="img/gary.gif">');
$('.player2 img').css('width', '120%')
}
else if ($(this).val() == 'spongebob') {
$('.player2').html('<img src="img/spongebob.gif">');
$('.player2 img').css('width', '120%')
}
else if ($(this).val() == 'kerrigan') {
$('.player2').html('<img src="img/kerr.png">');
$('.player2 img').css('width', '200%')
}
else if ($(this).val() == 'tassadar') {
$('.player2').html('<img src="img/tass.png">');
$('.player2 img').css('width', '120%')
}
});

});
</script>

</head>

<body>

<div class="box" id="box1">

<h1>Select Arena</h1>

<button type="button" name="beach">Beach</button>
<button type="button" name="desert">Desert</button>
<div class=""></div>
<button type="button" name="mars">Mars</button>
<button type="button" name="finalDestination">Final Destination</button>

<span id="next">Next!!!!!!!</span>

</div>

<div class="box" id="box2">

<h1>Select Players</h1>

<select id="select1" name="">
<option value=""></option>
<option value="gary">Gary</option>
<option value="kerrigan">Kerrigan</option>
<option value="tassadar">Tassadar</option>
<option value="spongebob">Spongebob</option>
</select>

<select id="select2" name="">
<option value=""></option>
<option value="gary">Gary</option>
<option value="kerrigan">Kerrigan</option>
<option value="tassadar">Tassadar</option>
<option value="spongebob">Spongebob</option>
</select>

</div>

<div class="player1"></div>

<div class="player2"></div>

</body>

</html>
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.
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.
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.
67 changes: 67 additions & 0 deletions Rytis_George_Baltakys/Javascript/jQuery/colorClicker.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
<html>
<head>
<title>The Codingdojo ColorClicker!</title>
<script type="text/javascript" src='http://code.jquery.com/jquery-1.10.2.min.js'></script>
<script type="text/javascript">
function random_color()
{
var rgb = ['a','b','c','d','e','f','0','1','2','3','4','5','6','7','8','9'];
color = '#' //this is what we'll return!
for(var i = 0; i < 6; i++)
{
x = Math.floor((Math.random()*16))
color += rgb[x];
}
return color;
}
$(document).ready(function(){
$('#large_box').click(function(){
//alert('you clicked the big box!'); //comment this out when you have figured out what event.stopPropagation is used for
$(this).css('background-color', random_color()).children().css('background-color', random_color());
})
$('.side_box').click(function(event){
event.stopPropagation();
$(this).siblings().css('background-color', random_color());
})
$('.middle_box').click(function(event){
event.stopPropagation();
$(this).parent().css('background-color', random_color());
})
});
</script>
<style type="text/css">
*{
font-family: sans-serif;
}
h2, h1, h3 {
text-align: center;
}
#large_box {
margin: 0px auto;
margin-top: 30px;
background-color: lightblue;
width: 1200px;
height: 300px;
}
#large_box div {
background-color: blue;
display: inline-block;
width: 350px;
height: 130px;
margin: 60px 20px;
}
</style>
</head>
<body>
<h1>The Codingdojo ColorClicker! </h1>
<div id='large_box'>
<div class='side_box'></div>
<div class='middle_box'></div>
<div class='side_box'></div>
</div>
<h2>Rules</h2>
<h3>1. Clicking the big box should change background colors of both the small and large boxes!</h3>
<h3>2. Clicking the middle small box should change the color of the big box!</h3>
<h3>3. Clicking the left or right small box should change the color of that box's siblings</h3>
</body>
</html>
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
Contact Card assigment on Git Hub:

https://github.com/livelite/webFun_jan_2017/tree/Rytis_George_Baltakys_02-01-2017_21.22/Rytis_George_Baltakys/Javascript/jQuery/contactCard
23 changes: 23 additions & 0 deletions Rytis_George_Baltakys/Javascript/jQuery/contactCard/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
<!DOCTYPE html>
<html>
<head>
<title>Contact Card</title>
<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="https://cdn.rawgit.com/nnattawat/flip/master/dist/jquery.flip.min.js"></script>
<script src="jquery_code.js"></script>
</head>
<body>
<h1>Contact Card</h1>
<form href="">
<h3>Add a contact</h3>
<ul>
<li>First Name: <input type="text" name="fname"></li>
<li>Last Name: <input type="text" name="lname"></li>
<li>Description: <textarea name="description" rows="5" cols="50"></textarea></li>
<li><input class="submit" type="submit" value="Add User"></li>
</ul>
</form>
<div class="container"><div class="contactCards"></div></div>
</body>
</html>
13 changes: 13 additions & 0 deletions Rytis_George_Baltakys/Javascript/jQuery/contactCard/jquery_code.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
$(document).ready(function() { // jQuery bootstrap

$('form').submit(function() {
var contactCard = $(`<div id="card"><div class="front"><h4>${$('input[name="fname"]').val()} ${$('input[name="lname"]').val()}</h4><p>Click for description<p></div><div class="back"><p>${$('textarea').val()}</div></div></p>`);
$('.contactCards').append(contactCard);

contactCard.flip({
trigger: 'click'
});

return false; // don't submit the form
});
}); // end of $(document).ready(function() {
100 changes: 100 additions & 0 deletions Rytis_George_Baltakys/Javascript/jQuery/contactCard/style.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,100 @@
/*CSS reset settings here*/
* {
margin: 0px;
padding: 0px;
border: 0px solid red;
}

html {
height: 100%;
}

body {
background: linear-gradient(to bottom, #E7F5C1, #5AA16C);
color: #5EB1DF;
font-family: sans-serif;
font-size: 16px;
margin: 20px;
}

h1 {
margin: 20px;
}

h3 {
border-bottom: 2px solid lightblue;
width: 400px;
margin: 40px 0;
padding: 10px;
}

img {
display: block;
}

input, textarea {
padding: 5px;
margin: 5px 10px;
font-size: 14px;
background: #FEFAD0;
}

input[type="submit"] {
color: white;
background-color: purple;
margin: 15px 0 15px 100px;
}

li {
list-style: none;
}

form {
display: inline-block;
vertical-align: top;
}

ul {
display: inline-block;
color: #9732DE;
margin: 0 50px;
}

.container {
display: inline-block;
width: 300px;
height: 800px;
}

.contactCards {
display: block;
box-sizing: border-box;
}

#card {
color: white;
height: 70px;
margin: 40px;
}

.front {
background: red;
border-radius: 7px;
padding: 10px;
background: linear-gradient(to bottom, #4493EB, #5466F9);
}

.front p {
margin-top: 10px;
}

.back {
background: blue;
border-radius: 7px;
padding: 10px;
background: linear-gradient(to bottom, #3483DB, #4456E9);
}

.back p {
margin-top: 20px;
}
Loading