Created
March 20, 2016 18:32
-
-
Save iCodeForBananas/1e63bf60fa4e490edc65 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
| class FeaturesSection { | |
| constructor() { | |
| this.features = [ | |
| { | |
| name: 'Feature 1', | |
| description: 'Description 1', | |
| image: '/path/to/img1' | |
| }, | |
| { | |
| name: 'Feature 2', | |
| description: 'Description 2', | |
| image: '/path/to/img2' | |
| } | |
| ] | |
| } | |
| renderFeatureRows() { | |
| return this.features.map(function(feature) { | |
| return ` | |
| ${feature.name} | |
| ${feature.description} | |
| ${feature.image} | |
| ` | |
| }).join('') | |
| } | |
| render() { | |
| return ` | |
| <section class="features-section"> | |
| ${this.renderFeatureRows()} | |
| </section> | |
| ` | |
| } | |
| } |
This file contains hidden or 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
| import { | |
| MainSection, | |
| FeaturesSection, | |
| NewsletterSection | |
| } from '../components/sections' | |
| class HomePageController { | |
| constructor() { | |
| this.count = 'Example variable in class' | |
| } | |
| render() { | |
| return ` | |
| <div>${this.count}<div> | |
| ${MainSection.render()} | |
| ${FeaturesSection.render()} | |
| ${NewsletterSection.render()} | |
| ` | |
| } | |
| } |
This file contains hidden or 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
| class MainSection { | |
| render() { | |
| return ` | |
| <section class="main-section"> | |
| <div class="main-table"> | |
| <div class="main-row"> | |
| <div class="main-cell"> | |
| <div class="row"> | |
| <div class="col-sm-12 text-center"> | |
| <div class="main-header">Ranger Steve: Buffalo Invasion</div> | |
| </div> | |
| </div> | |
| <div class="row"> | |
| <div class="col-sm-12 text-center"><a href="/game" class="btn btn-primary btn-lg">Play Alpha Now</a></div> | |
| </div> | |
| </div> | |
| </div> | |
| </div> | |
| </section> | |
| ` | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment