Skip to content

Instantly share code, notes, and snippets.

@hinogi
Created July 10, 2014 11:45
Show Gist options
  • Save hinogi/fd09562f34fad1a84be1 to your computer and use it in GitHub Desktop.
Save hinogi/fd09562f34fad1a84be1 to your computer and use it in GitHub Desktop.
designer
<link rel="import" href="../core-animated-pages/core-animated-pages.html">
<link rel="import" href="../core-animated-pages/transitions/hero-transition.html">
<link rel="import" href="../core-animated-pages/transitions/cross-fade.html">
<link rel="import" href="../core-animated-pages/transitions/slide-down.html">
<link rel="import" href="../core-animated-pages/transitions/slide-up.html">
<link rel="import" href="../core-animated-pages/transitions/tile-cascade.html">
<polymer-element name="my-element">
<template>
<style>
#hero1 {
position: absolute;
top: 0px;
left: 0px;
width: 300px;
height: 300px;
background-color: orange;
}
#hero2 {
position: absolute;
top: 200px;
left: 300px;
width: 300px;
height: 300px;
background-color: orange;
}
#bottom1, #bottom2 {
position: absolute;
bottom: 0px;
top: 0px;
left: 0px;
height: 50px;
}
#bottom1 {
background-color: blue;
}
#bottom2 {
background-color: green;
}
</style>
<core-animated-pages transitions="hero-transition cross-fade" selectedindex="0" notap on-click="{{ stuff }}">
<section id="page1" active>
<div id="hero1" hero-id="hero" hero></div>
<div id="bottom1" cross-fade></div>
</section>
<section id="page2">
<div id="hero2" hero-id="hero" hero></div>
<div id="bottom2" cross-fade></div>
</section>
</core-animated-pages>
</template>
<script>
Polymer('my-element', {
page: 0,
up: true,
max: 2,
stuff: function () {
debugger;
var p = document.querySelector('core-animated-pages');
if (up && p.selected === max || !up && p.selected === 0) {
up = !up;
}
if (up) {
p.selected += 1;
} else {
p.selected -= 1;
}
}
});
</script>
</polymer-element>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment