Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(921)

Side by Side Diff: third_party/polymer/components-chromium/core-animated-pages/demos/simple.html

Issue 592593002: Inline scripts were extracted from Polymer elements. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: s/echo ""/echo/ Created 6 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
(Empty)
1 <!doctype html>
2 <html>
3 <head>
4
5 <script src="../../platform/platform.js"></script>
6 <link href="../core-animated-pages.html" rel="import">
7 <link href="../transitions/cross-fade.html" rel="import">
8 <link href="../transitions/slide-from-right.html" rel="import">
9
10 <style>
11 body {
12 font-family: Roboto, 'Helvetica Neue', Helvetica, Arial, sans-serif;
13 margin: 0;
14 }
15
16 core-animated-pages {
17 position: absolute;
18 top: 50px;
19 right: 0;
20 bottom: 0;
21 left: 0;
22 font-size: 72px;
23 overflow: hidden;
24 }
25
26 section > div {
27 height: 100%;
28 color: white;
29 }
30
31 </style>
32
33 </head>
34 <body unresolved>
35 <select onchange="change();">
36 <option value="cross-fade-all" selected>cross-fade-all</option>
37 <option value="slide-from-right">slide-from-right</option>
38 </select>
39
40 <core-animated-pages onclick="stuff();" transitions="cross-fade-all">
41 <section>
42 <div layout vertical center center-justified style="background:red;">
43 <div>1</div>
44 </div>
45 </section>
46 <section>
47 <div layout vertical center center-justified style="background:blue;">
48 <div>2</div>
49 </div>
50 </section>
51 <section>
52 <div layout vertical center center-justified style="background:purple;">
53 <div>3</div>
54 </div>
55 </section>
56 <section>
57 <div layout vertical center center-justified style="background:orange;">
58 <div>4</div>
59 </div>
60 </section>
61 <section>
62 <div layout vertical center center-justified style="background:green;">
63 <div>5</div>
64 </div>
65 </section>
66 </core-animated-pages>
67
68 <script>
69 function change() {
70 var s = document.querySelector('select');
71 document.querySelector('core-animated-pages').transitions = document.query Selector('select').options[s.selectedIndex].value;
72 }
73
74 var up = true;
75 var max = 4;
76 function stuff() {
77 var p = document.querySelector('core-animated-pages');
78 if (up && p.selected === max || !up && p.selected === 0) {
79 up = !up;
80 }
81 if (up) {
82 p.selected += 1;
83 } else {
84 p.selected -= 1;
85 }
86 }
87 </script>
88 </body>
89 </html>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698