Created
June 29, 2014 20:53
-
-
Save rohenaz/cb9323d47ae300e49500 to your computer and use it in GitHub Desktop.
designer
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
<link rel="import" href="../core-scaffold/core-scaffold.html"> | |
<link rel="import" href="../core-header-panel/core-header-panel.html"> | |
<link rel="import" href="../core-menu/core-menu.html"> | |
<link rel="import" href="../core-item/core-item.html"> | |
<link rel="import" href="../core-icon-button/core-icon-button.html"> | |
<link rel="import" href="../core-toolbar/core-toolbar.html"> | |
<link rel="import" href="../paper-input/paper-input.html"> | |
<link rel="import" href="../core-icons/core-icons.html"> | |
<link rel="import" href="../core-icon/core-icon.html"> | |
<link rel="import" href="../core-menu/core-submenu.html"> | |
<link rel="import" href="../paper-item/paper-item.html"> | |
<link rel="import" href="../core-pages/core-pages.html"> | |
<link rel="import" href="../polymer-ui-card/polymer-ui-card.html"> | |
<link rel="import" href="../polymer-ajax/polymer-ajax.html"> | |
<link rel="import" href="../core-icons/iconsets/av-icons.html"> | |
<link rel="import" href="../polymer-ui-ratings/polymer-ui-ratings.html"> | |
<polymer-element name="my-element"> | |
<template> | |
<style> | |
polymer-ui-card { | |
display: block; | |
width:100%; | |
margin: 20px auto; | |
padding: 30px; | |
} | |
#polymer_ui_tabs { | |
position: absolute; | |
top: 0px; | |
left: 0px; | |
width: 100%; | |
height: 100%; | |
} | |
#paper_ripple { | |
width: 100%; | |
height: 100%; | |
position: absolute; | |
top: 0px; | |
left: 0px; | |
} | |
#core_scaffold { | |
position: absolute; | |
top: 0px; | |
right: 0px; | |
bottom: 0px; | |
left: 0px; | |
width: 100%; | |
height: 100%; | |
} | |
#core_header_panel { | |
background-color: rgb(255, 255, 255); | |
} | |
#core_toolbar { | |
color: rgb(255, 255, 255); | |
background-color: rgb(79, 125, 201); | |
} | |
#core_menu { | |
font-size: 16px; | |
} | |
#paper_item4 { | |
padding: 5px; | |
} | |
#paper_item1 { | |
padding: 5px; | |
} | |
#paper_item { | |
padding: 5px; | |
} | |
#paper_item2 { | |
padding: 5px; | |
} | |
#paper_item3 { | |
padding: 5px; | |
} | |
#polymer_ui_pages { | |
width: 100%; | |
height: 100%; | |
display: block; | |
position: absolute; | |
top: 0px; | |
left: 0px; | |
} | |
#core_pages { | |
width: 100%; | |
border: 1px solid silver; | |
position: absolute; | |
top: 0px; | |
left: 0px; | |
} | |
#section { | |
position: absolute; | |
top: 0px; | |
left: 0px; | |
width: 100%; | |
height: 100%; | |
} | |
#paper_input { | |
} | |
#search { | |
position: absolute; | |
top: 0px; | |
left: 0px; | |
width: 100%; | |
height: 100%; | |
} | |
</style> | |
<core-scaffold id="core_scaffold"> | |
<core-header-panel mode="seamed" id="core_header_panel" navigation flex> | |
<core-toolbar id="core_toolbar"> | |
<paper-input label="Search" id="paper_input" inputvalue="" flex></paper-input> | |
<core-icon icon="search"></core-icon> | |
</core-toolbar> | |
<core-menu selected="PLAYLIST" valueattr="label" selectedindex="0" id="core_menu" theme="core-dark-theme"> | |
<paper-item label="PLAYLIST" icon="list" id="0" on-click="{{ menuClick }}" selected center-justified horizontal layout center active></paper-item> | |
<paper-item label="EXPLORE" icon="explore" id="1" on-click="{{ menuClick }}" center horizontal layout center-justified></paper-item> | |
<paper-item label="HISTORY" icon="history" id="2" on-click="{{ menuClick }}" center horizontal layout center-justified></paper-item> | |
<paper-item label="FAVORITES" icon="favorite" id="3" on-click="{{ menuClick }}" center horizontal layout center-justified></paper-item> | |
<paper-item label="CHATROOM" icon="account-circle" id="4" on-click="{{ menuClick }}" center horizontal layout center-justified></paper-item> | |
<paper-item label="SETTINGS" icon="settings" id="5" on-click="{{ menuClick }}" center horizontal layout center-justified></paper-item> | |
</core-menu> | |
</core-header-panel> | |
<div id="div" tool>{{ $.core_menu.selectedItem.label }}</div> | |
<core-pages selected="{{ $.core_menu.selectedItem.id }}" selectedindex="0" notap id="core_pages"> | |
<section id="playlist_page" active> | |
<h1>PLAYLIST</h1> | |
<polymer-ajax id="polymer_ajax" auto url="http://gdata.youtube.com/feeds/api/videos/" params='{"alt":"json", "q":"{{$.paper_input.inputValue}}"}' handleas="json" on-polymer-response="{{ handleResponse }}"> | |
</polymer-ajax> | |
<template id="template" repeat="{{video in videos}}"> | |
<style type="text/css"> | |
.crop { | |
width: 250px; | |
overflow: hidden; | |
margin-right:0px; | |
} | |
.crop img { | |
margin: -20px; | |
} | |
</style> | |
<polymer-ui-card vertical layout> | |
<div horizontal layout> | |
<div> | |
<div class="crop"><img class="ty_img" width="250" src="{{video.media$group.media$thumbnail[0].url}}" /></div> | |
</div> | |
<div style="padding-right:10px;" flex> | |
<h3>{{video.title.$t}}</h3> | |
<span>{{video.published.$t}}</span><br /> | |
<span>{{video.content.$t}}</span> | |
</div> | |
</div> | |
<div horizontal layout start> | |
<div style="height:100%:" vertical layout> | |
<polymer-ui-ratings value="{{video.gd$rating.average}}"></polymer-ui-ratings> | |
</div> | |
<div horizontal end-justified layout flex> | |
<div horizontal center-justified layout> | |
<core-icon-button icon="theaters"></core-icon-button><core-icon-button icon="favorite-outline"></core-icon-button><core-icon-button icon="av:play-arrow"></core-icon-button> | |
</div> | |
</div> | |
</polymer-ui-card> | |
</template> | |
</section> | |
<section id="explore_page"> | |
<h1>EXPLORE</h1> | |
</section> | |
<section id="history_page"> | |
<h1>HISTORY</h1> | |
</section> | |
<section id="favorites_page"> | |
<h1>FAVORITES</h1> | |
</section> | |
<section id="chat_page"> | |
<h1>CHAT</h1> | |
</section> | |
<section id="settings_page"> | |
<h1>SETTINGS</h1> | |
</section> | |
<section id="search_page"> | |
<h1>SEARCH</h1> | |
</section> | |
</core-pages> | |
</core-scaffold> | |
</template> | |
<script> | |
Polymer('my-element', { | |
ready: function () { | |
}, | |
handleResponse: function (e,rs) { | |
console.log(e.detail); | |
this.videos=e.detail.response.feed.entry; | |
} | |
}); | |
</script> | |
</polymer-element> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment