Commit 1b49624d155e7540a29b6b472bff4774cf2deaae
1 parent
950d181d
paper-card-controllet
Showing
1 changed file
with
104 additions
and
0 deletions
controllets/paper-card-controllet/paper-card-controllet.html
0 → 100644
| 1 | +<link rel="import" href="../../bower_components/paper-material/paper-material.html"/> | ||
| 2 | +<link rel="import" href="../../bower_components/paper-fab/paper-fab.html"/> | ||
| 3 | +<link rel="import" href="../../bower_components/iron-icons/iron-icons.html"/> | ||
| 4 | + | ||
| 5 | + | ||
| 6 | +<dom-module id="paper-card-controllet"> | ||
| 7 | + | ||
| 8 | + <style> | ||
| 9 | + :host { | ||
| 10 | + color: #333; | ||
| 11 | + font-family: 'Roboto', 'Helvetica Neue', Helvetica, Arial, sans-serif; | ||
| 12 | + display: inline-block; | ||
| 13 | + margin: 0 8px 8px ; | ||
| 14 | + font-size: 14px; | ||
| 15 | + text-align: justify; | ||
| 16 | + line-height: 10px; | ||
| 17 | + --paper-fab-background: var(--accent-color); | ||
| 18 | + } | ||
| 19 | + | ||
| 20 | + paper-material { | ||
| 21 | + border-radius: 2px; | ||
| 22 | + background-color: white; | ||
| 23 | + } | ||
| 24 | + | ||
| 25 | + .picture { | ||
| 26 | + position: relative; | ||
| 27 | + margin-bottom: 0px; | ||
| 28 | + } | ||
| 29 | + .picture img { | ||
| 30 | + border-top-right-radius: 2px; | ||
| 31 | + border-top-left-radius: 2px; | ||
| 32 | + width: 100%; | ||
| 33 | + } | ||
| 34 | + .legend { | ||
| 35 | + position: absolute; | ||
| 36 | + background: rgba(0,0,0,0.5); | ||
| 37 | + bottom: 0; | ||
| 38 | + color: white; | ||
| 39 | + height: 40px; | ||
| 40 | + padding: 0 16px; | ||
| 41 | + left: 0; right: 0; | ||
| 42 | + } | ||
| 43 | + paper-fab { | ||
| 44 | + position: absolute; | ||
| 45 | + right: 10px; | ||
| 46 | + bottom: -18px; | ||
| 47 | + z-index: 10; | ||
| 48 | + --paper-fab-background:#2196F3; | ||
| 49 | + } | ||
| 50 | + | ||
| 51 | + .content ::content { | ||
| 52 | + padding: 0 16px 8px; | ||
| 53 | + font-weight: 300; | ||
| 54 | + color: var(--secondary-text-color); | ||
| 55 | + line-height: 24px; | ||
| 56 | + } | ||
| 57 | + ::content.buttons { | ||
| 58 | + margin-top: 8px; | ||
| 59 | + } | ||
| 60 | + ::content paper-button, ::content paper-icon-button { | ||
| 61 | + font-weight: 500; | ||
| 62 | + color: var(--accent-color); | ||
| 63 | + } | ||
| 64 | + | ||
| 65 | + </style> | ||
| 66 | + | ||
| 67 | + <template> | ||
| 68 | + <paper-material elevation="{{elevation}}"> | ||
| 69 | + <div class="vertical layout"> | ||
| 70 | + <div class="picture"> | ||
| 71 | + <img src="{{src}}"> | ||
| 72 | + <div class="horizontal layout center legend"> | ||
| 73 | + <span>{{legend}}</span> | ||
| 74 | + <paper-fab mini icon="{{icon}}"></paper-fab> | ||
| 75 | + </div> | ||
| 76 | + </div> | ||
| 77 | + </div> | ||
| 78 | + <div class="content"> | ||
| 79 | + <p>{{text}}</p> | ||
| 80 | + </div> | ||
| 81 | + </div> | ||
| 82 | + </paper-material> | ||
| 83 | + </template> | ||
| 84 | + | ||
| 85 | + <script> | ||
| 86 | + Polymer({ | ||
| 87 | + is:'paper-card-controllet', | ||
| 88 | + | ||
| 89 | + properties: { | ||
| 90 | + width: { | ||
| 91 | + type: Number, | ||
| 92 | + value: 350, | ||
| 93 | + observer: "_changeWidth", | ||
| 94 | + }, | ||
| 95 | + }, | ||
| 96 | + _changeWidth: function(data){ | ||
| 97 | + this.style.width = data + "px"; | ||
| 98 | + this.querySelector(".content").width = data + "px"; | ||
| 99 | + }, | ||
| 100 | + }) | ||
| 101 | + </script> | ||
| 102 | + | ||
| 103 | + | ||
| 104 | +</dom-module> | ||
| 0 | \ No newline at end of file | 105 | \ No newline at end of file |