This repository has been archived by the owner on Dec 29, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 660
/
psk-app.html
205 lines (170 loc) · 6.52 KB
/
psk-app.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
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
<!--
@license
Copyright (c) 2016 The Polymer Project Authors. All rights reserved.
This code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt
The complete set of authors may be found at http://polymer.github.io/AUTHORS.txt
The complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt
Code distributed by Google as part of the polymer project is also
subject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt
-->
<link rel="import" href="../../bower_components/polymer/polymer.html">
<link rel="import" href="../../bower_components/carbon-route/carbon-location.html">
<link rel="import" href="../../bower_components/carbon-route/carbon-route.html">
<link rel="import" href="../../bower_components/iron-flex-layout/iron-flex-layout.html">
<link rel="import" href="../../bower_components/iron-pages/iron-pages.html">
<link rel="import" href="../../bower_components/iron-selector/iron-selector.html">
<link rel="import" href="../../bower_components/font-roboto/roboto.html">
<link rel="import" href="../../bower_components/paper-icon-button/paper-icon-button.html">
<link rel="import" href="../../bower_components/paper-styles/color.html">
<link rel="import" href="../../bower_components/app-layout/app-drawer-layout/app-drawer-layout.html">
<link rel="import" href="../../bower_components/app-layout/app-drawer/app-drawer.html">
<link rel="import" href="../../bower_components/app-layout/app-header/app-header.html">
<link rel="import" href="../../bower_components/app-layout/app-header-layout/app-header-layout.html">
<link rel="import" href="../../bower_components/app-layout/app-scroll-effects/app-scroll-effects.html">
<link rel="import" href="../../bower_components/app-layout/app-scrollpos-control/app-scrollpos-control.html">
<link rel="import" href="../../bower_components/app-layout/app-toolbar/app-toolbar.html">
<link rel="import" href="../app-icons/app-icons.html">
<link rel="import" href="../psk-page-home/psk-page-home.html">
<link rel="import" href="../psk-page-404/psk-page-404.html">
<link rel="import" href="../psk-page-art/psk-page-art.html">
<link rel="import" href="../psk-page-design/psk-page-design.html">
<link rel="import" href="../psk-page-film/psk-page-film.html">
<dom-module id="psk-app">
<template>
<style>
:host {
--app-primary-color: var(--paper-grey-800);
-webkit-tap-highlight-color: rgba(0, 0, 0, 0);
display: block;
font-family: 'Roboto', sans-serif;
background-color: var(--paper-grey-50);
}
app-drawer {
--app-drawer-content-container: {
background-color: var(--app-primary-color);
overflow-x: hidden;
};
}
app-drawer app-header {
background-color: var(--app-primary-color);
}
.nav-menu {
background-color: var(--app-primary-color);
color: #fff;
}
a {
text-decoration: none;
color: inherit;
font-size: inherit;
}
.nav-menu > a {
display: block;
padding: 12px 16px;
font-size: 20px;
font-weight: 500;
}
.nav-menu > a.iron-selected {
background-color: var(--paper-grey-600);
}
iron-pages a {
color: var(--app-primary-color);
}
iron-pages > * {
min-height: 100vh;
}
.main-header {
border-bottom: 1px solid #ddd;
background-color: #fff;
color: #444;
}
.title-toolbar {
@apply(--layout-center-center);
width: 100vw;
box-sizing: border-box;
}
.title {
padding-bottom: 40px;
font-size: 50px;
font-weight: 800;
}
.nav-title-toolbar {
color: #fff;
}
app-drawer-layout:not([narrow]) .nav-title-toolbar {
visibility: hidden;
}
app-drawer-layout:not([narrow]) .main-title-toolbar {
width: 100%;
}
@media (max-width: 580px) {
/* make title smaller to fit on screen */
.title {
font-size: 30px;
padding-bottom: 16px;
}
}
</style>
<!-- setup routes -->
<carbon-location route="{{route}}"></carbon-location>
<carbon-route route="{{route}}" pattern="/:page" data="{{pageData}}"></carbon-route>
<app-scrollpos-control selected="{{pageData.page}}"></app-scrollpos-control>
<app-drawer-layout drawer-width="288px" responsive-width="1280px">
<!-- nav panel -->
<app-drawer id="drawer">
<app-header-layout has-scrolling-region>
<app-header fixed>
<!-- top toolbar -->
<app-toolbar></app-toolbar>
<!-- bottom toolbar -->
<app-toolbar class="title-toolbar nav-title-toolbar"></app-toolbar>
</app-header>
<!-- nav menu -->
<iron-selector
class="nav-menu"
selected="[[pageData.page]]"
attr-for-selected="data-page"
on-iron-activate="_drawerSelected">
<a data-page="" href="/">Home</a>
<a data-page="art" href="/art">Art</a>
<a data-page="film" href="/film">Film</a>
<a data-page="design" href="/design">Design</a>
</iron-selector>
</app-header-layout>
</app-drawer>
<!-- main panel -->
<app-header-layout>
<app-header fixed effects="waterfall" class="main-header">
<!-- top toolbar -->
<app-toolbar>
<!-- menu button -->
<paper-icon-button icon="app:menu" drawer-toggle></paper-icon-button>
</app-toolbar>
<!-- bottom toolbar -->
<app-toolbar class="title-toolbar main-title-toolbar">
<h1 class="title">Polymer Starter Kit</h1>
</app-toolbar>
</app-header>
</app-header-layout>
<iron-pages selected="[[pageData.page]]" attr-for-selected="data-page" fallback-selection="404">
<psk-page-home data-page=""></psk-page-home>
<psk-page-art data-page="art"></psk-page-art>
<psk-page-film data-page="film"></psk-page-film>
<psk-page-design data-page="design"></psk-page-design>
<psk-page-404 data-page="404"></psk-page-404>
</iron-pages>
</app-drawer-layout>
</template>
<script>
Polymer({
is: 'psk-app',
attached: function() {
if (!this.route.path) {
this.set('route.path', '/');
}
},
_drawerSelected: function() {
if (!this.$.drawer.persistent) this.$.drawer.close();
}
});
</script>
</dom-module>