forked from montagejs/popcorn
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
7 changed files
with
173 additions
and
127 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
/* @override http://localhost:8082/montage-projects/ui/moviescores.reel/moviescores.css */ | ||
|
||
.moviescores { | ||
position: relative; | ||
text-align: center; | ||
color: hsl(0,0%,60%); | ||
} | ||
|
||
.moviescores .score { | ||
margin: 0 30px 0 2px; | ||
padding: 4px 0px; | ||
color: hsl(0,0%,100%); | ||
} | ||
.moviescores .score:last-child { | ||
margin: 0 0px 0 2px; | ||
} | ||
|
||
.moviescores .rt-icon { | ||
display: inline-block; | ||
margin-left: 2px; | ||
width: 25px; | ||
height: 25px; | ||
vertical-align: bottom; | ||
background-size: 25px auto; | ||
background-image: url(rt_lg.png); | ||
background-repeat: no-repeat; | ||
} | ||
|
||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,73 @@ | ||
<!DOCTYPE html> | ||
<html> | ||
<head> | ||
<link rel="stylesheet" type="text/css" href="moviescores.css"> | ||
|
||
<script type="text/montage-serialization"> | ||
{ | ||
|
||
"dates": { | ||
"prototype": "montage/ui/dynamic-text.reel", | ||
"properties": { | ||
"element": {"#": "dates-content"} | ||
}, | ||
"bindings": { | ||
"value": {"<-": "@owner.data.release_dates.theater" } | ||
} | ||
}, | ||
|
||
"runtime": { | ||
"prototype": "montage/ui/dynamic-text.reel", | ||
"properties": { | ||
"element": {"#": "runtime-content"} | ||
}, | ||
"bindings": { | ||
"value": {"<-": "@owner.data.runtime" } | ||
} | ||
}, | ||
|
||
"audienceScore": { | ||
"prototype": "montage/ui/dynamic-text.reel", | ||
"properties": { | ||
"element": {"#": "audience-score-content"} | ||
}, | ||
"bindings": { | ||
"value": {"<-": "@owner.data.ratings.audience_score" } | ||
} | ||
}, | ||
|
||
"criticsScore": { | ||
"prototype": "montage/ui/dynamic-text.reel", | ||
"properties": { | ||
"element": {"#": "critics-score-content"} | ||
}, | ||
"bindings": { | ||
"value": {"<-": "@owner.data.ratings.critics_score" } | ||
} | ||
}, | ||
|
||
"owner": { | ||
"properties": { | ||
"element": {"#": "moviescores"}, | ||
"cImage": {"#": "c-image"}, | ||
"aImage": {"#": "a-image"} | ||
} | ||
} | ||
} | ||
</script> | ||
</head> | ||
<body> | ||
<div id="moviescores" class="moviescores"> | ||
<div data-montage-id="scores-container" class="scores-container"> | ||
<p> | ||
<time data-montage-id="dates-content" class="score"></time> | ||
Runtime <span data-montage-id="runtime-content" class="score"></span> | ||
Audience <span data-montage-id="a-image" class="rt-icon icon-audience"></span> | ||
<span data-montage-id="audience-score-content" class="score"></span> | ||
Critics <span data-montage-id="c-image" class="rt-icon icon-critics"></span> | ||
<span data-montage-id="critics-score-content" class="score"></span> | ||
</p> | ||
</div> | ||
</div> | ||
</body> | ||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
var Montage = require("montage/core/core").Montage, | ||
Component = require("montage/ui/component").Component; | ||
|
||
exports.Moviescores = Montage.create(Component, { | ||
_data: { | ||
value: null | ||
}, | ||
|
||
data: { | ||
set: function(val){ | ||
this._data = val; | ||
this.needsDraw = true; | ||
}, | ||
get: function(){ | ||
return this._data; | ||
} | ||
}, | ||
|
||
draw: { | ||
value: function(){ | ||
if( this.data ){ | ||
var audience = this.data.ratings.audience_rating, | ||
critics = this.data.ratings.critics_rating; | ||
|
||
if( audience == "Fresh" ){ | ||
this.aImage.style.backgroundPosition = '0px 0px' | ||
}else if( audience == "Rotten" ){ | ||
this.aImage.style.backgroundPosition = '0px -25px' | ||
}else if( audience == "Certified Fresh" ){ | ||
this.aImage.style.backgroundPosition = '0px -50px' | ||
}else if( audience == "Upright" ){ | ||
this.aImage.style.backgroundPosition = '0px -75px' | ||
}else if( audience == "Spilled" ){ | ||
this.aImage.style.backgroundPosition = '0px -125px' | ||
}else{ | ||
this.aImage.style.backgroundPosition = '0px -100px' | ||
} | ||
|
||
if( critics == "Fresh" ){ | ||
this.cImage.style.backgroundPosition = '0px 0px' | ||
}else if( critics == "Rotten" ){ | ||
this.cImage.style.backgroundPosition = '0px -25px' | ||
}else if( critics == "Certified Fresh" ){ | ||
this.cImage.style.backgroundPosition = '0px -50px' | ||
}else if( critics == "Upright" ){ | ||
this.cImage.style.backgroundPosition = '0px -75px' | ||
}else if( critics == "Spilled" ){ | ||
this.cImage.style.backgroundPosition = '0px -125px' | ||
}else{ | ||
this.cImage.style.backgroundPosition = '0px -100px' | ||
} | ||
} | ||
} | ||
} | ||
|
||
}); |
File renamed without changes