Style rating and genres
This commit is contained in:
@@ -223,14 +223,15 @@ Block.Search.Item = new Class({
|
|||||||
'text': info.year
|
'text': info.year
|
||||||
}) : null
|
}) : null
|
||||||
)
|
)
|
||||||
).adopt(
|
).grab(
|
||||||
self.rating = info.rating && info.rating.imdb.length > 0 && info.rating.imdb[0] != '0' ? new Element('span.rating', {
|
self.rating = info.rating && info.rating.imdb.length == 2 && parseFloat(info.rating.imdb[0]) > 0 ? new Element('span.rating', {
|
||||||
'text': info.rating.imdb[0] + '/10'
|
'text': parseFloat(info.rating.imdb[0]),
|
||||||
}) : null
|
'title': parseInt(info.rating.imdb[1]) + ' votes'
|
||||||
).adopt(
|
}) : null
|
||||||
self.genre = info.genres && info.genres.length > 0 ? new Element('span.genres', {
|
).grab(
|
||||||
'text': self.getGenres(info.genres)
|
self.genre = info.genres && info.genres.length > 0 ? new Element('span.genres', {
|
||||||
}) : null
|
'text': info.genres.slice(0, 3).join(', ')
|
||||||
|
}) : null
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
@@ -249,17 +250,6 @@ Block.Search.Item = new Class({
|
|||||||
self.alternative_titles.include(alternative);
|
self.alternative_titles.include(alternative);
|
||||||
},
|
},
|
||||||
|
|
||||||
getGenres: function(data){
|
|
||||||
var self = this;
|
|
||||||
var genres = [];
|
|
||||||
|
|
||||||
for (var i=0;i<data.length && i<3;i++) {
|
|
||||||
genres[i] = data[i];
|
|
||||||
}
|
|
||||||
|
|
||||||
return genres.join(' | ');
|
|
||||||
},
|
|
||||||
|
|
||||||
getTitle: function(){
|
getTitle: function(){
|
||||||
var self = this;
|
var self = this;
|
||||||
try {
|
try {
|
||||||
|
|||||||
@@ -16,59 +16,78 @@
|
|||||||
width: 50%;
|
width: 50%;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@media all and (max-width: 600px) {
|
@media all and (max-width: 600px) {
|
||||||
.suggestions .movie_result {
|
.suggestions .movie_result {
|
||||||
width: 100%;
|
width: 100%;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.suggestions .movie_result .data {
|
.suggestions .movie_result .data {
|
||||||
left: 100px;
|
left: 100px;
|
||||||
background: #4e5969;
|
background: #4e5969;
|
||||||
border: none;
|
border: none;
|
||||||
}
|
}
|
||||||
|
|
||||||
.suggestions .movie_result .data .info {
|
.suggestions .movie_result .data .info {
|
||||||
top: 15px;
|
top: 15px;
|
||||||
left: 15px;
|
left: 15px;
|
||||||
right: 15px;
|
right: 15px;
|
||||||
|
bottom: 15px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.suggestions .movie_result .data .info h2 {
|
.suggestions .movie_result .data .info h2 {
|
||||||
white-space: normal;
|
white-space: normal;
|
||||||
max-height: 120px;
|
max-height: 120px;
|
||||||
font-size: 18px;
|
font-size: 18px;
|
||||||
line-height: 18px;
|
line-height: 18px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.suggestions .movie_result .data .info .rating,
|
.suggestions .movie_result .data .info .rating,
|
||||||
.suggestions .movie_result .data .info .genres,
|
.suggestions .movie_result .data .info .genres,
|
||||||
.suggestions .movie_result .data .info .year {
|
.suggestions .movie_result .data .info .year {
|
||||||
position: static;
|
position: static;
|
||||||
display: block;
|
display: block;
|
||||||
margin: 5px 0 0;
|
|
||||||
padding: 0;
|
padding: 0;
|
||||||
opacity: .6;
|
opacity: .6;
|
||||||
}
|
}
|
||||||
|
|
||||||
.suggestions .movie_result .data .info .rating,
|
.suggestions .movie_result .data .info .year {
|
||||||
.suggestions .movie_result .data .info .genres {
|
margin: 10px 0 0;
|
||||||
font-size: 10px;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.suggestions .movie_result .data .info .rating {
|
||||||
|
font-size: 20px;
|
||||||
|
float: right;
|
||||||
|
margin-top: -20px;
|
||||||
|
}
|
||||||
|
.suggestions .movie_result .data .info .rating:before {
|
||||||
|
content: "\e031";
|
||||||
|
font-family: 'Elusive-Icons';
|
||||||
|
font-size: 14px;
|
||||||
|
margin: 0 5px 0 0;
|
||||||
|
vertical-align: bottom;
|
||||||
|
}
|
||||||
|
|
||||||
|
.suggestions .movie_result .data .info .genres {
|
||||||
|
font-size: 11px;
|
||||||
|
font-style: italic;
|
||||||
|
text-align: right;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
.suggestions .movie_result .data {
|
.suggestions .movie_result .data {
|
||||||
cursor: default;
|
cursor: default;
|
||||||
}
|
}
|
||||||
|
|
||||||
.suggestions .movie_result .options {
|
.suggestions .movie_result .options {
|
||||||
left: 100px;
|
left: 100px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.suggestions .movie_result .thumbnail {
|
.suggestions .movie_result .thumbnail {
|
||||||
width: 100px;
|
width: 100px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.suggestions .movie_result .actions {
|
.suggestions .movie_result .actions {
|
||||||
position: absolute;
|
position: absolute;
|
||||||
bottom: 10px;
|
bottom: 10px;
|
||||||
@@ -82,10 +101,9 @@
|
|||||||
.suggestions .movie_result .data.open .actions {
|
.suggestions .movie_result .data.open .actions {
|
||||||
display: none;
|
display: none;
|
||||||
}
|
}
|
||||||
|
|
||||||
.suggestions .movie_result .actions a {
|
.suggestions .movie_result .actions a {
|
||||||
margin-left: 10px;
|
margin-left: 10px;
|
||||||
vertical-align: middle;
|
vertical-align: middle;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user