Blame view

controllets/paper-card-controllet/paper-card-controllet.html 5.3 KB
eb240478   Luigi Serra   public room cards...
1
  <link rel="import" href="../../bower_components/polymer/polymer.html"/>

1b49624d   isisadmin   paper-card-contro...
2
3
4
5
  <link rel="import" href="../../bower_components/paper-material/paper-material.html"/>

  <link rel="import" href="../../bower_components/paper-fab/paper-fab.html"/>

  <link rel="import" href="../../bower_components/iron-icons/iron-icons.html"/>

  

1b49624d   isisadmin   paper-card-contro...
6
7
  <dom-module id="paper-card-controllet">

  

1b49624d   isisadmin   paper-card-contro...
8
      <template>

eb240478   Luigi Serra   public room cards...
9
10
11
12
13
14
15
16
17
18
19
20
21
22
          <link rel="stylesheet" href="../shared_js/perfect-scrollbar/css/perfect-scrollbar.min.css">

          <link href='https://fonts.googleapis.com/css?family=Roboto' rel='stylesheet' type='text/css'>

          <style>

              :host {

                  display: inline-block;

                  margin: 0 8px 8px ;

                  font-size: 14px;

                  text-align: justify;

                  line-height: 10px;

                  --paper-fab-background: var(--accent-color);

                  font-family: 'Roboto', sans-serif;

              }

  

              paper-material {

eb240478   Luigi Serra   public room cards...
23
                  background-color: white;

7383b38e   Luigi Serra   paper-card-contro...
24
                  border-width: 1em;

eb240478   Luigi Serra   public room cards...
25
26
              }

  

7383b38e   Luigi Serra   paper-card-contro...
27
              .footer {

eb240478   Luigi Serra   public room cards...
28
                  position: relative;

7383b38e   Luigi Serra   paper-card-contro...
29
                  /*margin-bottom: 24px;*/

eb240478   Luigi Serra   public room cards...
30
              }

7383b38e   Luigi Serra   paper-card-contro...
31
  

eb240478   Luigi Serra   public room cards...
32
              .legend {

7383b38e   Luigi Serra   paper-card-contro...
33
34
35
36
                  position: relative;

                  top: -50px;

                  background: rgba(0,0,0,0.8);

                  bottom: 0;

eb240478   Luigi Serra   public room cards...
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
                  color: white;

                  height: 50px;

                  padding: 0 16px;

                  left: 0; right: 0;

                  z-index: 1;

              }

              paper-fab {

                  position: absolute;

                  right: 10px;

                  bottom: -18px;

                  z-index: 10;

                  --paper-fab-background:#2196F3;

              }

  

              #content ::content {

                  /*padding: 0 16px 8px;*/

7383b38e   Luigi Serra   paper-card-contro...
53
                  padding: 0 16px 8px;

eb240478   Luigi Serra   public room cards...
54
55
56
57
58
                  font-weight: 300;

                  color: var(--secondary-text-color);

                  line-height: 24px;

                  max-height: 400px;

                  position:relative;

7383b38e   Luigi Serra   paper-card-contro...
59
                  overflow: auto;

eb240478   Luigi Serra   public room cards...
60
61
62
63
64
65
66
67
              }

              ::content.buttons {

                  margin-top: 8px;

              }

              ::content paper-button, ::content paper-icon-button {

                  font-weight: 500;

                  color: var(--accent-color);

              }

7383b38e   Luigi Serra   paper-card-contro...
68
69
70
71
72
73
74
75
76
77
  

              #text{

                  position:relative;

                  top: -50px;

                  height: auto;

                  padding: 8px 8px 8px 8px;

                  font-size: 10px;

                  color: rgba(0,0,0,0.4);

                  font-family: 'Roboto', sans-serif;

              }

eb240478   Luigi Serra   public room cards...
78
79
80
81
          </style>

  

  

          <paper-material animated elevation="{{elevation}}" flex>

7383b38e   Luigi Serra   paper-card-contro...
82
  

1b49624d   isisadmin   paper-card-contro...
83
              <div class="vertical layout">

7383b38e   Luigi Serra   paper-card-contro...
84
85
86
                  <div id="content">

                      <content></content>

                  </div>

eb240478   Luigi Serra   public room cards...
87
  

7383b38e   Luigi Serra   paper-card-contro...
88
                  <div class="footer">

eb240478   Luigi Serra   public room cards...
89
90
  

                      <template is="dom-if" if="{{legend}}">

7383b38e   Luigi Serra   paper-card-contro...
91
  

eb240478   Luigi Serra   public room cards...
92
93
                          <div class="legend horizontal layout center">

                              <span>{{legend}}</span>

7383b38e   Luigi Serra   paper-card-contro...
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
                              <!-- Adding icon based on card type -->

  

                              <template is="dom-if" if="{{checkType(type, 'text')}}">

  

                                 <paper-fab mini icon="create"></paper-fab>

  

                               </template>

  

                              <template is="dom-if" if="{{checkType(type, 'image')}}">

  

                                  <paper-fab mini icon="perm-media"></paper-fab>

  

                              </template>

  

                              <template is="dom-if" if="{{checkType(type, 'datalet')}}">

  

                                  <paper-fab mini icon="assessment"></paper-fab>

  

                              </template>

  

                              <template is="dom-if" if="{{checkType(type, 'link')}}">

  

                                  <paper-fab mini icon="link"></paper-fab>

  

eb240478   Luigi Serra   public room cards...
118
                              </template>

7383b38e   Luigi Serra   paper-card-contro...
119
  

eb240478   Luigi Serra   public room cards...
120
                          </div>

7383b38e   Luigi Serra   paper-card-contro...
121
  

eb240478   Luigi Serra   public room cards...
122
                      </template>

eb240478   Luigi Serra   public room cards...
123
  

7383b38e   Luigi Serra   paper-card-contro...
124
                      <div id="text">{{text}}</div>

1b49624d   isisadmin   paper-card-contro...
125
                  </div>

eb240478   Luigi Serra   public room cards...
126
  

1b49624d   isisadmin   paper-card-contro...
127
128
              </div>

          </paper-material>

eb240478   Luigi Serra   public room cards...
129
  

1b49624d   isisadmin   paper-card-contro...
130
131
      </template>

  

eb240478   Luigi Serra   public room cards...
132
133
      <script src="../shared_js/perfect-scrollbar/js/min/perfect-scrollbar.jquery.min.js"></script>

  

1b49624d   isisadmin   paper-card-contro...
134
135
      <script>

          Polymer({

eb240478   Luigi Serra   public room cards...
136
              is: "paper-card-controllet",

1b49624d   isisadmin   paper-card-contro...
137
138
139
              properties: {

                  width: {

                      type: Number,

1b49624d   isisadmin   paper-card-contro...
140
141
                      observer: "_changeWidth",

                  },

eb240478   Luigi Serra   public room cards...
142
143
144
145
146
147
148
149
                  height: {

                      type: Number,

                      observer: "_changeHeight",

                  },

                  type:{

                      type: String,

                      value: "text"

                  }

1b49624d   isisadmin   paper-card-contro...
150
              },

eb240478   Luigi Serra   public room cards...
151
  

1b49624d   isisadmin   paper-card-contro...
152
153
              _changeWidth: function(data){

                  this.style.width = data + "px";

7383b38e   Luigi Serra   paper-card-contro...
154
                  //this.$.content.style.width = data + "px";

eb240478   Luigi Serra   public room cards...
155
156
157
158
                  //$(this.$.content).perfectScrollbar();

              },

  

              _changeHeight: function(data){

7383b38e   Luigi Serra   paper-card-contro...
159
160
161
                  this.style.height = (data + 20) + "px";

                  this.$.content.style.height = data + "px";

                 //$(this.$.content).perfectScrollbar();

1b49624d   isisadmin   paper-card-contro...
162
              },

eb240478   Luigi Serra   public room cards...
163
164
165
166
  

              checkType: function(type, check){

                  return (type == check);

              }

1b49624d   isisadmin   paper-card-contro...
167
168
169
          })

      </script>

  

1b49624d   isisadmin   paper-card-contro...
170
  </dom-module>