6 <meta http-equiv=
"X-UA-Compatible" content=
"IE=edge,chrome=1">
8 <title>core-pages
</title>
10 <script src=
"../platform/platform.js"></script>
12 <link rel=
"import" href=
"core-pages.html">
22 justify-content: center;
24 font-family: sans-serif;
30 border:
1px solid black;
31 -webkit-user-select: none;
37 justify-content: center;
39 border-radius: inherit;
47 core-pages.fancy
> div {
49 -webkit-transform: translate3d(-
100px,
0,
0) scale(
0.9);
50 transform: translate3d(-
100px,
0,
0) scale(
0.9);
51 transition: all
1s cubic-bezier(
.03,
.56,
.7,
.98);
55 core-pages.fancy
> div:nth-child(
1) {
56 background-color: red;
59 core-pages.fancy
> div:nth-child(
2) {
60 background-color: green;
63 core-pages.fancy
> div:nth-child(
3) {
64 background-color: blue;
67 core-pages.fancy
> div:nth-child(
4) {
68 background-color: purple;
71 core-pages.fancy
> div:nth-child(
5) {
72 background-color: black;
75 core-pages.fancy .core-selected + div {
76 -webkit-transform: translate3d(
100px,
0,
0) scale(
0.9);
77 transform: translate3d(
100px,
0,
0) scale(
1);
80 core-pages.fancy .core-selected {
82 -webkit-transform: translateX(
0);
83 transform: translateX(
0);
86 core-pages.fancy div.begin {
87 -webkit-transform: translate3d(
100px,
0,
0) scale(
0.9);
88 transform: translate3d(
100px,
0,
0) scale(
0.9);
96 <core-pages id=
"first" selected=
"0">
104 <core-pages class=
"fancy" selected=
"0">
113 document
.querySelector('#first').onclick = function(e
) {
114 this.selected
= (this.selected
+ 1) % this.items
.length
;
117 document
.querySelector('core-pages.fancy').onclick = function(e
) {
118 this.selected
= (this.selected
+ 1) % this.items
.length
;
119 this.async(function() {
120 if (this.selectedIndex
== 0) {
121 this.selectedItem
.classList
.remove('begin');
122 } else if (this.selectedIndex
== this.items
.length
- 1) {
123 this.items
[0].classList
.add('begin');