Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Julia's iconomation assignment #10

Open
wants to merge 1 commit into
base: gh-pages
Choose a base branch
from
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
6 changes: 3 additions & 3 deletions index.html
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<!DOCTYPE html>
<html>
<head>
<title>So-and-so's Iconomation Assignment</title>
<title>Julia's Iconomation Assignment</title>
<link href="https://maxcdn.bootstrapcdn.com/font-awesome/4.2.0/css/font-awesome.min.css" rel="stylesheet">
<link href="http://afeld.github.io/emoji-css/emoji.css" rel="stylesheet">
<style>
Expand All @@ -13,7 +13,7 @@
height: 400px;
margin: auto;
position: relative;
border: 3px solid green;
border: 5px solid #414B4F;
}
i {
position: absolute;
Expand All @@ -23,7 +23,7 @@
<script src="scripts/jquery-ui.min.js"></script>
</head>
<body>
<h1>Play Chicken!</h1>
<h1>Phases of the Moon</h1>
<div class="playspace"></div>
<p><em>refresh to see it again</em></p>
<script src="scripts/iconomation.js"></script>
Expand Down
118 changes: 100 additions & 18 deletions scripts/iconomation.js
Original file line number Diff line number Diff line change
@@ -1,31 +1,113 @@
// add icons
$('.playspace').append('<i class="em em-rooster"></i>');
$('.playspace').append('<i class="fa fa-futbol-o"></i>');

// add first icon
$('.playspace').append('<i class="em em-new_moon"></i>');

// set the initial positions

$('.em-rooster').css({
$('.em-new_moon').css({
top: 200,
left: 300
left: 50
});

$('.fa-futbol-o').css({
top: 210,
$('.em-new_moon').animate({
left: 100
});
}, 1000, 'easeInOutSine');

setTimeout(function() {
$('.playspace').append('<i class="em em-waxing_crescent_moon"></i>');
$('.em-waxing_crescent_moon').css({
top: 200,
left: 100
});

// play!
$('.em-waxing_crescent_moon').animate({
left: 150
}, 1000, 'easeInOutSine');

$('.em-rooster').animate({
left: 50
}, 1000);

// after 660ms...
setTimeout(function() {
// ...move the ball
$('.fa-futbol-o').animate({
left: 0
}, 800, 'easeOutQuart');
}, 660);
$('.playspace').append('<i class="em em-first_quarter_moon"></i>');
$('.em-first_quarter_moon').css({
top: 200,
left: 150
});

$('.em-first_quarter_moon').animate({
left: 200
}, 1000, 'easeInOutSine');
}, 2000);

setTimeout(function() {
$('.playspace').append('<i class="em em-waxing_gibbous_moon"></i>');
$('.em-waxing_gibbous_moon').css({
top: 200,
left: 200
});

$('.em-waxing_gibbous_moon').animate({
left: 250
}, 1000, 'easeInOutSine');
}, 3000);

setTimeout(function() {
$('.playspace').append('<i class="em em-full_moon"></i>');
$('.em-full_moon').css({
top: 200,
left: 250
});

$('.em-full_moon').animate({
left: 300
}, 1000, 'easeInOutSine');
}, 4000);

setTimeout(function() {
$('.playspace').append('<i class="em em-waning_gibbous_moon"></i>');
$('.em-waning_gibbous_moon').css({
top: 200,
left: 300
});

$('.em-waning_gibbous_moon').animate({
left: 350
}, 1000, 'easeInOutSine');
}, 5000);

setTimeout(function() {
$('.playspace').append('<i class="em em-last_quarter_moon"></i>');
$('.em-last_quarter_moon').css({
top: 200,
left: 350
});

$('.em-last_quarter_moon').animate({
left: 400
}, 1000, 'easeInOutSine');
}, 6000);

setTimeout(function() {
$('.playspace').append('<i class="em em-waning_crescent_moon"></i>');
$('.em-waning_crescent_moon').css({
top: 200,
left: 400
});

$('.em-waning_crescent_moon').animate({
left: 450
}, 1000, 'easeInOutSine');
}, 7000);

setTimeout(function() {
$('.playspace').append('<i class="em em-new_moon_with_face"></i>');
$('.em-new_moon_with_face').css({
top: 200,
left: 450
});

$('.em-new_moon_with_face').animate({
left: 500
}, 1000, 'easeInOutSine');
}, 8000);