Skip to content

Gh pages #6

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

Open
wants to merge 8 commits into
base: master
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
9 changes: 7 additions & 2 deletions src/assets/main.css
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,19 @@
body {
font-family: 'Helvetica Neue', serif;
font-size: 18px;
background: #FF1616;
}

#badges {
text-align: center;
}

h1 {
color: #FFFFFF
}

.course {
background: #F5F5F5;
background: #2FBF3B;
border-radius: 5px;
border: 1px solid #ccc;
box-shadow: 1px 1px 5px #EAEAEA;
Expand All @@ -21,7 +26,7 @@ body {
}

.course h3 {
color: #999;
color: #FFFFFF;
font-size: 1.9rem;
font-weight: 200;
min-height: 80px;;
Expand Down
34 changes: 33 additions & 1 deletion src/assets/main.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,37 @@
$(function() {
$.ajax({
url: 'https://www.codeschool.com/users/HelloWorld333.json',
dataType: 'jsonp',
success: function(response) {
console.log("response", response);
addCourses(response.courses.completed);
}
});
function addCourses(courses) {

// your code will go here
var $badges = $('#badges');

courses.forEach(function(course) {
var $course = $('<div />', {
'class': 'course'
}).appendTo($badges);

$('<h3 />', {
text: course.title
}).appendTo($course);

$('<img />', {
src: course.badge
}).appendTo($course);

$('<a />', {
'class': 'btn btn-lg btn-default',
target: '_blank',
href: course.url,
text: 'See Course'
}).appendTo($course);

});

}
});
8 changes: 6 additions & 2 deletions src/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,15 @@
<body>

<div class="container">
<h1>jQuery Badges</h1>
<center><h1>jQuery Badges</h1></center>
<div id="badges"></div>
<div class="course">
<center><h3>Santa is here!!!</h3></center>
<center><img src="https://d1ffx7ull4987f.cloudfront.net/images/achievements/large_badge/536/vanguard-5f3cc8c60bbf2e0dd849004193169964.png" alt="Santa"></center>
<center><button type="button" name="button", class="btn btn-lg btn-default">Ho, ho, ho!</button></center>
</div>
</div>


<script src="https://code.jquery.com/jquery-3.1.0.min.js" integrity="sha256-cCueBR6CsyA4/9szpPfrX3s49M9vUU5BgtiJj06wt/s=" crossorigin="anonymous"></script>
<script src="assets/main.js"></script>

Expand Down