Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
cfc1a25
Starting Project
birbalds Jun 13, 2017
6a5de0a
Some views/models
birbalds Jun 13, 2017
ebec40f
Add MovieView with initialize and render functions
cecomfort Jun 13, 2017
e4a5db6
Merging
birbalds Jun 13, 2017
42a2003
List all Rental Library
birbalds Jun 13, 2017
3a1e8f3
Search bar
birbalds Jun 13, 2017
74c18b3
Search bar works
birbalds Jun 13, 2017
ad7d6c1
Move search params inside fetch so collection url is unchanged
cecomfort Jun 13, 2017
bf96469
Figuring Out Add button
birbalds Jun 14, 2017
ee31480
Merge
birbalds Jun 14, 2017
14706c4
Add functionality to add a movie to the rental library from backbone
cecomfort Jun 14, 2017
b912b32
Merge
birbalds Jun 14, 2017
177a28d
Merge
birbalds Jun 14, 2017
0173916
Fix loading of images of movies added to lib
cecomfort Jun 14, 2017
00120cd
Add movieListView function to view rental library
cecomfort Jun 14, 2017
b41ee87
Limit rendering of add button to only external db searches
cecomfort Jun 14, 2017
93aad31
Resolve merge conflict
cecomfort Jun 14, 2017
09a9cc2
Merge
birbalds Jun 14, 2017
14efbdd
Merge
birbalds Jun 14, 2017
a1780a0
Prevent duplicates of a movie when it is added to the library
cecomfort Jun 14, 2017
7bd03e6
Can no longer add duplicates to rental library
birbalds Jun 15, 2017
8c8d8aa
Merge
birbalds Jun 15, 2017
1bbc16b
CSS mostly done
birbalds Jun 15, 2017
d2a8d82
Work on showing movie details
cecomfort Jun 16, 2017
d529f4a
Resolve merge conflicts
cecomfort Jun 16, 2017
73e0734
Fix movie details modal
cecomfort Jun 16, 2017
d697910
Minor CSS tweaks
birbalds Jun 16, 2017
883b35f
Merge
birbalds Jun 16, 2017
c2bc35e
Minor modal functionality
birbalds Jun 16, 2017
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
161 changes: 156 additions & 5 deletions build/css/styles.css
Original file line number Diff line number Diff line change
@@ -1,7 +1,73 @@
@include foundation-everything;
@import url('https://fonts.googleapis.com/css?family=Didact+Gothic|Modak');

body{
background-color: #3f51b5;
}

canvas {
background: radial-gradient(white, silver);
position: fixed;
}

main {
background: lightblue;
text-align: center;
font-family: Didact Gothic;
color: #eceff1;
width: 80%;
margin-left: auto;
margin-right: auto;
left: 0;
right: 0;
z-index: 1;
position: relative;
background-color: #3f51b5;
border-radius: 25px;
}

h1{
font-family: Modak;
color: #ff6f00;
font-size: 7rem;
position: relative;
z-index: 1;
text-align: center;
text-shadow: 1px 1px 0 #3f51b5,
-1px 1px 0 #3f51b5,
1px -1px 0 #3f51b5,
-1px -1px 0 #3f51b5,
0px 1px 0 #3f51b5,
0px -1px 0 #3f51b5,
-1px 0px 0 #3f51b5,
1px 0px 0 #3f51b5,
2px 2px 0 #3f51b5,
-2px 2px 0 #3f51b5,
2px -2px 0 #3f51b5,
-2px -2px 0 #3f51b5,
0px 2px 0 #3f51b5,
0px -2px 0 #3f51b5,
-2px 0px 0 #3f51b5,
2px 0px 0 #3f51b5,
1px 2px 0 #3f51b5,
-1px 2px 0 #3f51b5,
1px -2px 0 #3f51b5,
-1px -2px 0 #3f51b5,
2px 1px 0 #3f51b5,
-2px 1px 0 #3f51b5,
2px -1px 0 #3f51b5,
-2px -1px 0 #3f51b5;
padding-top: 30px;
opacity: .7;

}

h1#rental-library:hover{
color: #ffb300;
cursor:pointer;
}

section.main-content{
padding-top: 30px;
}

header {
Expand Down Expand Up @@ -37,8 +103,93 @@ aside label {
div {
display: inline;
}
/*
* {
border-style: solid;

ul#movie-list {
list-style: none;
}

li {
display: inline-block;
width: 20%;
margin: 15px 0px 15px 0px;
}

li:hover{
cursor:pointer;
color: #ff6f00;
}

li:hover img{
box-shadow:rgba(0, 0, 0, 0.3) 0 16px 16px 0;
}

h3 {
display: inline;
}
img {
border-top: 2px solid #ffb300;
display: block;
margin: auto;
}

button.success.btn-add{
background-color: #ffb300;
color: #3f51b5;
padding: 2px;
}

input#search {
width: 80%;
margin: auto;
background-color: #eceff1;
}

button.btn-search{
background-color: #ff6f00;
margin-top: 10px;
}

button.btn-search:hover{
background-color: #ffb300;
color: #3f51b5;
}
button.success.btn-add:hover{
background-color: #ff6f00;
}

img.api-credit{
width: 20%;
border: none;
}

footer{
bottom: 0px;
text-align: center;
width: 100%;
padding: 10px;
margin-top: 30px;
background-color: #ff6f00;
z-index: 1;
position: relative;
opacity: .6;
}

.close-modal {
float: right;
color: #3f51b5;
font-weight: bold;
}

h4.close-modal:hover{
cursor:pointer;
}

#movie-details {
background-color: #ffb300;
color: black;
position: fixed;
z-index: 2;
left: 50%;
margin-left: -37.5%;
width: 75%;
}
*/
47 changes: 42 additions & 5 deletions build/index.html
Original file line number Diff line number Diff line change
@@ -1,15 +1,52 @@
<!DOCTYPE html>
<html lang="en">
<head>

<head>
<meta charset="utf-8">
<link rel="stylesheet" type="text/css" href="css/_settings.css">
<link rel="stylesheet" type="text/css" href="css/foundation.css">
<link rel="stylesheet" type="text/css" href="css/styles.css">
<title>Backbone Baseline</title>
</head>
<body>
</head>

<body>
<canvas></canvas>
<h1 id="rental-library"> Comfort's Comfortable Movies </h1>
<main>
<section class="main-content">

<form id="searchbar">
<input type="text" name="search" id="search">
<button type="submit" class="button btn-search">Search</button>
</form>

<section class="reveal" id='movie-details' data-reveal data-animation-in="fade-in" data-animation-out="fade-out">
</section>
<ul id='movie-list'></ul>

</section>
</main>

<footer>
<img src="https://www.themoviedb.org/assets/static_cache/27b65cb40d26f78354a4ac5abf87b2be/images/v4/logos/powered-by-rectangle-green.svg" class="api-credit">
</footer>

<script id="movie-list-template" type="text/template">
<button class="button success btn-add" id=<%- movie.external_id%>>Add</button>
<h3><%- movie.title %></h3>
<img src=<%=movie.image_url%> />
</script>

<script type="text/template" id="movie-details-template">
<h4 class="close-modal">X</h4>
<h3><%- movie.title %></h3>
<img src=<%=movie.image_url%> />
<h4>Release Date: <%- movie.release_date %></h4>
<h4><%- movie.overview %></h4>
</script>

<script src="/app.bundle.js"></script>

</body>
</html>
</body>

</html>
39 changes: 36 additions & 3 deletions src/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,42 @@
import $ from 'jquery';
import _ from 'underscore';

// ready to go
$(document).ready(function() {
import MovieList from 'collections/movie-list';
import MovieListView from 'views/movie_list_view';

var movieList = new MovieList();

var movielistView = new MovieListView({
model: movieList,
template: _.template($('#movie-list-template').html()),
el: '.main-content'
});

var canvas, context, width, height;

canvas = document.querySelector('canvas');
context = canvas.getContext('2d');

width = canvas.width = innerWidth;
height = canvas.height = innerHeight;

$('section.main-content').append('<p>Hello World!</p>');
var imageData = context.createImageData(width, height);

(function loop() {

for (var i = 0, n = imageData.data.length; i < n; i++) {
imageData.data[i] = Math.floor(Math.random() * 255);
}

context.putImageData(imageData, 0, 0);
requestAnimationFrame(loop);

})();

$(document).ready(function() {

$('#rental-library').click(function(event){
movieList.fetch();
})
movieList.fetch();
});
10 changes: 10 additions & 0 deletions src/collections/movie-list.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
import Backbone from 'backbone';

import Movie from '../models/movie';

var MovieList = Backbone.Collection.extend({
model: Movie,
url: 'http://localhost:3000/movies'
});

export default MovieList;
Loading