Skip to content

Instantly share code, notes, and snippets.

@vorcigernix
Created July 22, 2014 09:43
Show Gist options
  • Save vorcigernix/06e988f54332677339bc to your computer and use it in GitHub Desktop.
Save vorcigernix/06e988f54332677339bc to your computer and use it in GitHub Desktop.
designer
<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="../core-icons/core-icons.html">
<link rel="import" href="../core-icons/iconsets/av-icons.html">
<link rel="import" href="../paper-fab/paper-fab.html">
<link rel="import" href="../core-menu/core-submenu.html">
<link rel="import" href="../paper-input/paper-input.html">
<link rel="import" href="../paper-radio-group/paper-radio-group.html">
<link rel="import" href="../paper-radio-button/paper-radio-button.html">
<polymer-element name="sluck-app">
<template>
<style>
:host {
box-sizing: border-box;
-webkit-transform: translateZ(0px);
transform: translateZ(0px);
font-family: RobotoDraft, 'Helvetica Neue', Helvetica, Arial;
font-size: 16px;
color: rgba(0, 0, 0, 0.870588);
}
#core_scaffold {
position: absolute;
top: 0px;
right: 0px;
bottom: 0px;
left: 0px;
background-color: rgb(150, 136, 136);
}
#core_header_panel {
background-color: rgb(255, 255, 255);
}
#core_toolbar {
color: rgb(255, 255, 255);
background-color: rgb(52, 44, 66);
}
#core_menu {
font-size: 16px;
}
#paper_fab {
bottom: -27px;
right: 1em;
z-index: 10;
position: absolute !important;
background-color: rgb(53, 160, 33);
}
paper-dialog {
width: 50%;
min-width: 430px;
}
#core_card {
width: 300px;
height: 300px;
border-top-left-radius: 2px;
border-top-right-radius: 2px;
border-bottom-right-radius: 2px;
border-bottom-left-radius: 2px;
box-shadow: rgba(0, 0, 0, 0.0980392) 0px 2px 4px, rgba(0, 0, 0, 0.0980392) 0px 0px 3px;
background-color: rgb(255, 255, 255);
}
#newmsg_label {
position: relative;
width: 70%;
left: 20%;
top: -20px;
background-color: rgb(255, 255, 255);
}
</style>
<core-scaffold id="core_scaffold">
<core-header-panel mode="seamed" id="core_header_panel" navigation flex>
<core-toolbar id="core_toolbar">
<paper-fab icon="add" id="paper_fab" class="mini" on-click="{{ showNewChannelInput }}"></paper-fab>
</core-toolbar>
<core-menu selected="1" valueattr="label" selectedindex="1" id="core_menu" theme="core-light-theme">
<paper-input label="new channel name" floatinglabel value="{{ newNote }}" id="newChannelInput" on-change="{{ add }}"></paper-input>
<paper-radio-group selectedindex="1" id="paper_radio_group" active nowrap>
<paper-radio-button label="P" toggles id="paper_radio_button"></paper-radio-button>
<paper-radio-button checked label="Work Channel" id="paper_radio_button1"></paper-radio-button>
<paper-radio-button label="Looser Channel" id="paper_radio_button2"></paper-radio-button>
</paper-radio-group>
</core-menu>
</core-header-panel>
<div id="div" tool center-justified>Sluck</div>
<paper-input label="new channel name" value="{{ newNote }}" id="newmsg_label" on-change="{{ add }}"></paper-input>
</core-scaffold>
</template>
<script>
Polymer('sluck-app', {
data: [],
fontSize: 14,
toggleDrawer: function () {
this.$.drawerPanel.togglePanel();
},
ready: function () {
this.$.newChannelInput.style.display = 'none';
},
showNewChannelInput: function () {
this.$.newChannelInput.style.display = 'block';
},
add: function () {
if (this.newNote) {
this.data.unshift({
body: this.newNote,
done: false
});
this.$.newChannelInput.style.display = 'none';
this.$.newChannelInput.value = null;
}
},
dataChanged: function () {
this.$.storage.save();
},
delete: function (e) {
this.data = this.data.filter(function(item) {
return !item.done;
})
},
fontSizeChanged: function () {
var cards = this.shadowRoot.querySelectorAll('.card');
for (var i = 0; i < cards.length; i++) {
cards[i].style.fontSize = this.fontSize + 'px';
}
},
reset: function () {
this.fontSize = 14;
this.fadeSelected = false;
this.$.toast.show();
},
newNote: ''
});
</script>
</polymer-element>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment