Skip to content

Instantly share code, notes, and snippets.

@ViliamKopecky
Last active August 29, 2015 14:07
Show Gist options
  • Save ViliamKopecky/43c94ea1e8ea41c5f3da to your computer and use it in GitHub Desktop.
Save ViliamKopecky/43c94ea1e8ea41c5f3da to your computer and use it in GitHub Desktop.
designer
<link rel="import" href="../paper-slider/paper-slider.html">
<link rel="import" href="../paper-checkbox/paper-checkbox.html">
<link rel="import" href="../notification-elements/notification-alert.html">
<link rel="import" href="../paper-button/paper-button.html">
<polymer-element name="my-element">
<template>
<style>
:host {
position: absolute;
width: 100%;
height: 100%;
box-sizing: border-box;
}
#paper_slider {
left: 60px;
top: 60px;
position: absolute;
}
#paper_button {
left: 420px;
top: 60px;
position: absolute;
opacity: 1;
background-color: rgb(202, 241, 112);
}
#paper_checkbox {
left: 300px;
top: 70px;
position: absolute;
}
#notification_alert {
left: 630px;
top: 50px;
position: absolute;
}
#core_card {
position: absolute;
width: 300px;
height: 300px;
border-radius: 2px;
box-shadow: rgba(0, 0, 0, 0.0980392) 0px 2px 4px, rgba(0, 0, 0, 0.0980392) 0px 0px 3px;
left: 550px;
top: 60px;
background-color: rgb(255, 255, 255);
}
</style>
<paper-slider value="100" id="paper_slider"></paper-slider>
<paper-checkbox label="větší než 50?" id="paper_checkbox"></paper-checkbox>
<notification-alert message="Hi there!" icon="icon.png" name="notification" id="notification_alert"></notification-alert>
<core-card id="core_card" layout vertical>nevím?</core-card>
<paper-button id="paper_button" on-click="{{ buttonClicked }}">Check</paper-button>
</template>
<script>
Polymer({
buttonClicked: function (){
var val = this.$.paper_slider.value;
var checked = this.$.paper_checkbox.checked;
var greater = val > 50;
if( (greater && checked) || (!greater && !checked) ) {
this.$.core_card.innerText = 'ano';
} else {
this.$.core_card.innerText = 'ne';
}
}
});
</script>
</polymer-element>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment