OLD | NEW |
| (Empty) |
1 <!-- | |
2 @license | |
3 Copyright (c) 2014 The Polymer Project Authors. All rights reserved. | |
4 This code may only be used under the BSD style license found at http://polym
er.github.io/LICENSE.txt | |
5 The complete set of authors may be found at http://polymer.github.io/AUTHORS
.txt | |
6 The complete set of contributors may be found at http://polymer.github.io/CO
NTRIBUTORS.txt | |
7 Code distributed by Google as part of the polymer project is also | |
8 subject to an additional IP rights grant found at http://polymer.github.io/P
ATENTS.txt | |
9 --> | |
10 <polymer-element name="sample-content" attributes="size"> | |
11 <script> | |
12 | |
13 (function() { | |
14 | |
15 var strings = [ | |
16 'Lorem ipsum dolor sit amet, per in nusquam nominavi periculis, sit elit o
portere ea.', | |
17 'Ut labores minimum atomorum pro. Laudem tibique ut has.', | |
18 'Fugit adolescens vis et, ei graeci forensibus sed.', | |
19 'Convenire definiebas scriptorem eu cum. Sit dolor dicunt consectetuer no.
', | |
20 'Ea duis bonorum nec, falli paulo aliquid ei eum.', | |
21 'Usu eu novum principes, vel quodsi aliquip ea.', | |
22 'Has at minim mucius aliquam, est id tempor laoreet.', | |
23 'Pro saepe pertinax ei, ad pri animal labores suscipiantur.', | |
24 'Detracto suavitate repudiandae no eum. Id adhuc minim soluta nam.', | |
25 'Iisque perfecto dissentiet cum et, sit ut quot mandamus, ut vim tibique s
plendide instructior.', | |
26 'Id nam odio natum malorum, tibique copiosae expetenda mel ea.', | |
27 'Cu mei vide viris gloriatur, at populo eripuit sit.', | |
28 'Modus commodo minimum eum te, vero utinam assueverit per eu.', | |
29 'No nam ipsum lorem aliquip, accumsan quaerendum ei usu.' | |
30 ]; | |
31 | |
32 function randomString() { | |
33 return strings[Math.floor(Math.random() * strings.length)]; | |
34 } | |
35 | |
36 function randomLetter() { | |
37 return String.fromCharCode(65 + Math.floor(Math.random() * 26)); | |
38 } | |
39 | |
40 Polymer('sample-content', { | |
41 | |
42 size: 0, | |
43 | |
44 sizeChanged: function() { | |
45 this.innerHTML = ''; | |
46 for (var i = 0; i < this.size; i++) { | |
47 this.innerHTML += | |
48 '<div style="border: 1px solid #bebebe; padding: 16px; margin: 16px;
border-radius: 5px; background-color: #fff; color: #555;">' + | |
49 '<div style="display: inline-block; height: 64px; width: 64px; borde
r-radius: 50%; background: #ddd; line-height: 64px; font-size: 30px; color: #666
; text-align: center;">'+ randomLetter() + '</div>' + | |
50 '<div style="font-size: 22px; padding: 8px 0 16px; color: #888;">' +
randomString() + '</div>' + | |
51 '<div style="font-size: 16px; padding-bottom: 8px;">' + randomString
() + '</div>' + | |
52 '<div style="font-size: 12px;">' + randomString() + '</div>' + | |
53 '<div style="font-size: 12px;">' + randomString() + '</div>' + | |
54 '</div>'; | |
55 } | |
56 } | |
57 | |
58 }); | |
59 })(); | |
60 | |
61 </script> | |
62 </polymer-element> | |
OLD | NEW |