-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathropi-template.html
174 lines (161 loc) · 3.92 KB
/
ropi-template.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
<link rel="import" href="../polymer/polymer-element.html">
<link rel="import" href="../iron-flex-layout/iron-flex-layout-classes.html">
<link rel="import" href="../paper-button/paper-button.html">
<link rel="import" href="../iron-selector/iron-selector.html">
<link rel="import" href="../paper-styles/color.html">
<link rel="stylesheet" href="https://use.fontawesome.com/releases/v5.0.13/css/all.css" integrity="sha384-DNOHZ68U8hZfKXOrtjWvjxusGo9WQnrNx2sqG0tfsghAvtVlRW3tvkXWZh58N9jp" crossorigin="anonymous">
<dom-module id="ropi-template">
<template>
<style include="iron-flex iron-flex-alignment">
<style>
:host {
}
.container {
@apply(--layout-horizontal);
height: 100%;
flex: 1 0 auto;
}
.header {
@apply(--layout-horizontal);
@apply(--layout-center);
@apply(--layout-end-justified);
flex: 0 0 100px;
background-color: var(--google-blue-500);
padding: 15px;
box-sizing: border-box;
}
.body {
@apply(--layout-vertical);
flex: 1 0 auto;
background-color: #e9e9e9;
padding: 15px;
}
.sidebar {
flex: 0 0 330px;
background-color: #f9f9f9;
box-sizing: border-box;
border-style: none solid none none;
border-color: #ccc;
border-width: 1px;
}
.container .sub-container {
@apply(--layout-vertical);
flex: 1 0 auto;
background-color: #bbb;
overflow-y: auto;
overflow-wrap: break-word;
}
.header > * {
background-color: #f9f9f9;
margin: 5px;
padding: 10px;
box-sizing: border-box;
height: 50px;
width: 50px;
border-radius: 25px;
border-style: solid;
border-color: #bbb;
border-width: 1px;
}
.sidebar-button {
width: 100%;
margin: 0;
border-style: solid none;
border-color: #ccc;
border-width: 1px;
background-color: #ddd;
}
.placeholder {
height: 140px;
}
iron-selector > * {
padding: 20px 25px;
cursor: pointer;
border-left: solid 4px rgb(0,0,0,0);
}
iron-selector > .iron-selected {
border-left: solid 4px var(--google-blue-500);
background-color: #fafafa;
color: var(--google-blue-500);
}
.header > div.title-bar {
@apply(--layout-flex);
background: none;
border: none;
text-align: center;
color: #f9f9f9;
font-size: 22pt;
font-weight: bold;
}
.header > paper-button {
font-size: 20px;
text-align: center;
padding-top: 12px;
}
</style>
<div class="container" >
<div class="sidebar">
<img src="http://via.placeholder.com/330x100">
<div class="placeholder"></div>
<iron-selector selected="1">
<template is="dom-repeat" items="{{menuItems}}">
<div>[[item]]</div>
</template>
</iron-selector>
</div>
<div class="sub-container">
<div class="header">
<div class="title-bar">[[title]]</div>
<template is="dom-if" if="[[loggedIn]]" restamp="true">
<paper-button>
<i class="fas fa-user"></i>
</paper-button>
<paper-button>
<i class="fas fa-sign-out-alt" ></i>
</paper-button>
</template>
<template is="dom-if" if="[[!loggedIn]]" restamp="true">
<paper-button>
<i class="fas fa-sign-in-alt" ></i>
</paper-button>
</template>
</div>
<div class="body">
<slot></slot>
</div>
</div>
</div>
</template>
<script>
/**
* `ropi-template`
* layout of site
*
* @customElement
* @polymer
* @demo demo/index.html
*/
class RopiTemplate extends Polymer.Element {
static get is() { return 'ropi-template'; }
static get properties() {
return {
title: {
type: String,
value: 'Main page'
},
loggedIn: {
type: Boolean,
value: false
},
menuItems: {
type: Array,
value() {
return ["Item 1", "Item 2", "Item 3"];
}
}
};
}
}
window.customElements.define(RopiTemplate.is, RopiTemplate);
</script>
</dom-module>