├── images ├── .gitignore └── splash.svg ├── .bowerrc ├── .gitignore ├── favicon.ico ├── icons ├── Icon-72.png ├── Ipad@2x.png ├── icon-196.png ├── quizapp.png └── iPhone@2x.png ├── deploy.sh ├── polyfills └── fonts │ ├── RobotoDraft-Black.woff │ ├── RobotoDraft-Bold.woff │ ├── RobotoDraft-Bold.woff2 │ ├── RobotoDraft-Light.woff │ ├── RobotoDraft-Thin.woff │ ├── RobotoDraft-Thin.woff2 │ ├── RobotoDraft-Black.woff2 │ ├── RobotoDraft-Italic.woff │ ├── RobotoDraft-Italic.woff2 │ ├── RobotoDraft-Light.woff2 │ ├── RobotoDraft-Medium.woff │ ├── RobotoDraft-Medium.woff2 │ ├── RobotoDraft-Regular.woff │ ├── RobotoDraft-Regular.woff2 │ ├── RobotoDraft-BoldItalic.woff │ ├── RobotoDraft-BoldItalic.woff2 │ ├── roboto.html │ └── fonts.css ├── bower.json ├── package.json ├── README.md ├── app.yaml ├── theme.css ├── leaderboard.html ├── index.html └── sw.js /images/.gitignore: -------------------------------------------------------------------------------- 1 | node_modules 2 | -------------------------------------------------------------------------------- /.bowerrc: -------------------------------------------------------------------------------- 1 | { 2 | "directory": "components" 3 | } -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | .DS_Store 2 | .d8_history 3 | components/* 4 | node_modules 5 | -------------------------------------------------------------------------------- /favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/googlearchive/topeka/HEAD/favicon.ico -------------------------------------------------------------------------------- /icons/Icon-72.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/googlearchive/topeka/HEAD/icons/Icon-72.png -------------------------------------------------------------------------------- /icons/Ipad@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/googlearchive/topeka/HEAD/icons/Ipad@2x.png -------------------------------------------------------------------------------- /icons/icon-196.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/googlearchive/topeka/HEAD/icons/icon-196.png -------------------------------------------------------------------------------- /icons/quizapp.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/googlearchive/topeka/HEAD/icons/quizapp.png -------------------------------------------------------------------------------- /icons/iPhone@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/googlearchive/topeka/HEAD/icons/iPhone@2x.png -------------------------------------------------------------------------------- /deploy.sh: -------------------------------------------------------------------------------- 1 | ./node_modules/vulcanize/bin/vulcanize -o build.html index.html --strip --inline --csp 2 | appcfg.py update . --oauth2 3 | -------------------------------------------------------------------------------- /polyfills/fonts/RobotoDraft-Black.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/googlearchive/topeka/HEAD/polyfills/fonts/RobotoDraft-Black.woff -------------------------------------------------------------------------------- /polyfills/fonts/RobotoDraft-Bold.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/googlearchive/topeka/HEAD/polyfills/fonts/RobotoDraft-Bold.woff -------------------------------------------------------------------------------- /polyfills/fonts/RobotoDraft-Bold.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/googlearchive/topeka/HEAD/polyfills/fonts/RobotoDraft-Bold.woff2 -------------------------------------------------------------------------------- /polyfills/fonts/RobotoDraft-Light.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/googlearchive/topeka/HEAD/polyfills/fonts/RobotoDraft-Light.woff -------------------------------------------------------------------------------- /polyfills/fonts/RobotoDraft-Thin.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/googlearchive/topeka/HEAD/polyfills/fonts/RobotoDraft-Thin.woff -------------------------------------------------------------------------------- /polyfills/fonts/RobotoDraft-Thin.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/googlearchive/topeka/HEAD/polyfills/fonts/RobotoDraft-Thin.woff2 -------------------------------------------------------------------------------- /polyfills/fonts/RobotoDraft-Black.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/googlearchive/topeka/HEAD/polyfills/fonts/RobotoDraft-Black.woff2 -------------------------------------------------------------------------------- /polyfills/fonts/RobotoDraft-Italic.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/googlearchive/topeka/HEAD/polyfills/fonts/RobotoDraft-Italic.woff -------------------------------------------------------------------------------- /polyfills/fonts/RobotoDraft-Italic.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/googlearchive/topeka/HEAD/polyfills/fonts/RobotoDraft-Italic.woff2 -------------------------------------------------------------------------------- /polyfills/fonts/RobotoDraft-Light.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/googlearchive/topeka/HEAD/polyfills/fonts/RobotoDraft-Light.woff2 -------------------------------------------------------------------------------- /polyfills/fonts/RobotoDraft-Medium.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/googlearchive/topeka/HEAD/polyfills/fonts/RobotoDraft-Medium.woff -------------------------------------------------------------------------------- /polyfills/fonts/RobotoDraft-Medium.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/googlearchive/topeka/HEAD/polyfills/fonts/RobotoDraft-Medium.woff2 -------------------------------------------------------------------------------- /polyfills/fonts/RobotoDraft-Regular.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/googlearchive/topeka/HEAD/polyfills/fonts/RobotoDraft-Regular.woff -------------------------------------------------------------------------------- /polyfills/fonts/RobotoDraft-Regular.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/googlearchive/topeka/HEAD/polyfills/fonts/RobotoDraft-Regular.woff2 -------------------------------------------------------------------------------- /polyfills/fonts/RobotoDraft-BoldItalic.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/googlearchive/topeka/HEAD/polyfills/fonts/RobotoDraft-BoldItalic.woff -------------------------------------------------------------------------------- /polyfills/fonts/RobotoDraft-BoldItalic.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/googlearchive/topeka/HEAD/polyfills/fonts/RobotoDraft-BoldItalic.woff2 -------------------------------------------------------------------------------- /bower.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "topeka", 3 | "version": "0.0.0", 4 | "homepage": "https://github.com/Polymer/topeka", 5 | "authors": [], 6 | "description": "", 7 | "license": "BSD", 8 | "ignore": [ 9 | "**/.*", 10 | "node_modules", 11 | "bower_components", 12 | "components", 13 | "test", 14 | "tests" 15 | ], 16 | "dependencies": { 17 | "topeka-elements": "Polymer/topeka-elements#^0.5.0" 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "topeka", 3 | "version": "0.5.0", 4 | "description": "Topeka Quiz app", 5 | "homepage": "https://polymer-topeka.appspot.com/", 6 | "repository": { 7 | "type": "git", 8 | "url": "https://github.com/Polymer/topeka" 9 | }, 10 | "author": "The Polymer Project Authors", 11 | "license": "https://polymer.github.io/LICENSE.txt", 12 | "bugs": { 13 | "url": "https://github.com/Polymer/topeka/issues" 14 | }, 15 | "devDependencies": { 16 | "crisper": "^1.0.4", 17 | "vulcanize": "^0.7.10" 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /polyfills/fonts/roboto.html: -------------------------------------------------------------------------------- 1 | 9 | 10 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | Topeka 2 | ------ 3 | 4 | There are 2 ways to get your dependencies up-and-running: 5 | 6 | ### Direct Git: 7 | 8 | This is the best way to not be broken. The Polymer team doesn't use bower in day-to-day development and so Topeka might be broken more frequently if you use the Bower-based workflow. 9 | 10 | 1. Checkout topeka 11 | 2. Do the following: 12 | 13 | mkdir components 14 | cd components 15 | git clone https://github.com/Polymer/tools.git 16 | cd .. 17 | ./components/tools/bin/pull-all.sh #get a copy of all of Polymer 18 | 19 | ### Bower 20 | 21 | 1. Checkout topeka 22 | 1. Make sure you have `npm` and `bower` [installed](http://bower.io/) installed. 23 | 1. `cd topeka` and `bower install` 24 | 25 | ### Deploying the project 26 | 27 | - `./deploy.sh` 28 | - profit! 29 | -------------------------------------------------------------------------------- /app.yaml: -------------------------------------------------------------------------------- 1 | application: polymer-topeka 2 | version: 1 3 | runtime: python27 4 | api_version: 1 5 | threadsafe: yes 6 | 7 | handlers: 8 | - url: / 9 | static_files: build.html 10 | upload: build.html 11 | 12 | - url: /build.js 13 | static_files: build.js 14 | upload: build.js 15 | 16 | - url: /leaderboard.html 17 | static_files: leaderboard.html 18 | upload: leaderboard.html 19 | 20 | - url: /sw.js 21 | static_files: sw.js 22 | upload: sw.js 23 | 24 | - url: /theme.css 25 | static_files: theme.css 26 | upload: theme.css 27 | 28 | - url: /favicon.ico 29 | static_files: theme.css 30 | upload: theme.css 31 | 32 | - url: /components/(.*) 33 | static_files: components/\1 34 | upload: components/.* 35 | 36 | - url: /images/(.*) 37 | static_files: images/\1 38 | upload: images/.* 39 | 40 | - url: /icons/(.*) 41 | static_files: icons/\1 42 | upload: icons/.* 43 | 44 | - url: /polyfills/(.*) 45 | static_files: polyfills/\1 46 | upload: polyfills/.* 47 | 48 | skip_files: 49 | - ^(.*/)?node_modules/.* 50 | -------------------------------------------------------------------------------- /theme.css: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2014 The Polymer Project Authors. All rights reserved. 3 | This code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt 4 | The complete set of authors may be found at http://polymer.github.io/AUTHORS.txt 5 | The complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt 6 | Code distributed by Google as part of the polymer project is also 7 | subject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt 8 | */ 9 | 10 | html, body { 11 | height: 100%; 12 | -webkit-tap-highlight-color: rgba(0,0,0,0); 13 | } 14 | 15 | body { 16 | margin: 0; 17 | background-color: #eee; 18 | background-repeat: no-repeat; 19 | background-position: 50%; 20 | background-image: url(images/splash.svg); 21 | font-family: "RobotoDraft", sans-serif; 22 | color: #444; 23 | fill: #444; 24 | font-weight: 400; 25 | } 26 | 27 | @media screen and (min-width: 900px) { 28 | body { 29 | background-size: 512px; 30 | } 31 | } 32 | 33 | topeka-app { 34 | min-height: 450px; 35 | overflow: hidden; 36 | } 37 | -------------------------------------------------------------------------------- /leaderboard.html: -------------------------------------------------------------------------------- 1 | 2 | 10 | 11 | 12 | Quiz App 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 33 | 34 | 35 | 36 | -------------------------------------------------------------------------------- /polyfills/fonts/fonts.css: -------------------------------------------------------------------------------- 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://polymer.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/CONTRIBUTORS.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/PATENTS.txt 9 | */ 10 | 11 | @font-face { 12 | font-family: 'RobotoDraft'; 13 | font-style: normal; 14 | font-weight: 100; 15 | src: local('RobotoDraft Thin'), local('RobotoDraft-Thin'), url(RobotoDraft-Thin.woff2) format('woff2'), url(RobotoDraft-Thin.woff) format('woff'); 16 | } 17 | @font-face { 18 | font-family: 'RobotoDraft'; 19 | font-style: normal; 20 | font-weight: 300; 21 | src: local('RobotoDraft Light'), local('RobotoDraft-Light'), url(RobotoDraft-Light.woff2) format('woff2'), url(RobotoDraft-Light.woff) format('woff'); 22 | } 23 | @font-face { 24 | font-family: 'RobotoDraft'; 25 | font-style: normal; 26 | font-weight: 400; 27 | src: local('RobotoDraft'), local('RobotoDraft-Regular'), url(RobotoDraft-Regular.woff2) format('woff2'), url(RobotoDraft-Regular.woff) format('woff'); 28 | } 29 | @font-face { 30 | font-family: 'RobotoDraft'; 31 | font-style: normal; 32 | font-weight: 500; 33 | src: local('RobotoDraft Medium'), local('RobotoDraft-Medium'), url(RobotoDraft-Medium.woff2) format('woff2'), url(RobotoDraft-Medium.woff) format('woff'); 34 | } 35 | @font-face { 36 | font-family: 'RobotoDraft'; 37 | font-style: normal; 38 | font-weight: 700; 39 | src: local('RobotoDraft Bold'), local('RobotoDraft-Bold'), url(RobotoDraft-Bold.woff2) format('woff2'), url(RobotoDraft-Bold.woff) format('woff'); 40 | } 41 | @font-face { 42 | font-family: 'RobotoDraft'; 43 | font-style: normal; 44 | font-weight: 900; 45 | src: local('RobotoDraft Black'), local('RobotoDraft-Black'), url(RobotoDraft-Black.woff2) format('woff2'), url(RobotoDraft-Black.woff) format('woff'); 46 | } 47 | @font-face { 48 | font-family: 'RobotoDraft'; 49 | font-style: italic; 50 | font-weight: 400; 51 | src: local('RobotoDraft Italic'), local('RobotoDraft-Italic'), url(RobotoDraft-Italic.woff2) format('woff2'), url(RobotoDraft-Italic.woff) format('woff'); 52 | } 53 | @font-face { 54 | font-family: 'RobotoDraft'; 55 | font-style: italic; 56 | font-weight: 700; 57 | src: local('RobotoDraft Bold Italic'), local('RobotoDraft-BoldItalic'), url(RobotoDraft-BoldItalic.woff2) format('woff2'), url(RobotoDraft-BoldItalic.woff) format('woff'); 58 | } 59 | -------------------------------------------------------------------------------- /index.html: -------------------------------------------------------------------------------- 1 | 2 | 10 | 11 | 12 | Quiz App 13 | 14 | 15 | 16 | 17 | 18 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 34 | 37 | 38 | 39 | 40 | 41 | 42 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 59 | 60 | 61 | 62 | 63 | 67 | 68 | 78 | 79 | 80 | 81 | -------------------------------------------------------------------------------- /sw.js: -------------------------------------------------------------------------------- 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://polymer.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/CONTRIBUTORS.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/PATENTS.txt 9 | */ 10 | 11 | "use strict"; 12 | 13 | var log = console.log.bind(console); 14 | var err = console.error.bind(console); 15 | this.onerror = err; 16 | 17 | // Moves the contents of one named cached into another. 18 | var cacheCopy = function(source, destination) { 19 | return caches.delete(destination).then(function() { 20 | return Promise.all([ 21 | caches.open(source), 22 | caches.open(destination) 23 | ]).then(function(results) { 24 | var sourceCache = results[0]; 25 | var destCache = results[1]; 26 | 27 | return sourceCache.keys().then(function(requests) { 28 | return Promise.all(requests.map(function(request) { 29 | return sourceCache.match(request).then(function(response) { 30 | return destCache.put(request, response); 31 | }); 32 | })); 33 | }); 34 | }); 35 | }); 36 | } 37 | 38 | var fetchAndCache = function(request, cache) { 39 | if (!(request instanceof Request)) { 40 | request = new Request(request); 41 | } 42 | 43 | return fetch(request.clone()).then(function(response) { 44 | cache.put(request, response.clone()); 45 | return response; 46 | }); 47 | }; 48 | 49 | var baseUrl = (new URL("./", this.location.href) + ""); 50 | // TODO: This is necessary to handle different implementations in the wild 51 | // The spec defines self.registration, but it was not implemented in Chrome 40. 52 | var scope; 53 | if (self.registration) { 54 | scope = self.registration.scope; 55 | } else { 56 | scope = self.scope || baseUrl; 57 | } 58 | 59 | this.addEventListener("install", function(e) { 60 | // Put updated resources in a new cache, so that currently running pages 61 | // get the current versions. 62 | e.waitUntil(caches.delete("core-waiting").then(function() { 63 | return caches.open("core-waiting").then(function(core) { 64 | var resourceUrls = [ 65 | "", 66 | "?offline", 67 | "build.js", 68 | "components/topeka-elements/categories.json", 69 | "components/topeka-elements/images/splash.svg", 70 | "favicon.ico", 71 | "icons/icon-196.png", 72 | "images/splash.svg", 73 | "leaderboard.html", 74 | "polyfills/fonts/fonts.css", 75 | "polyfills/fonts/roboto.html", 76 | "polyfills/fonts/RobotoDraft-Black.woff2", 77 | "polyfills/fonts/RobotoDraft-Bold.woff2", 78 | "polyfills/fonts/RobotoDraft-BoldItalic.woff2", 79 | "polyfills/fonts/RobotoDraft-Light.woff2", 80 | "polyfills/fonts/RobotoDraft-Medium.woff2", 81 | "polyfills/fonts/RobotoDraft-Regular.woff2", 82 | "polyfills/fonts/RobotoDraft-Thin.woff2", 83 | "theme.css", 84 | ]; 85 | 86 | return Promise.all(resourceUrls.map(function(relativeUrl) { 87 | return fetchAndCache(baseUrl + relativeUrl, core); 88 | })); 89 | }); 90 | })); 91 | }); 92 | 93 | 94 | this.addEventListener("activate", function(e) { 95 | // Copy the newly installed cache to the active cache 96 | e.waitUntil(cacheCopy("core-waiting", "core")); 97 | }); 98 | 99 | this.addEventListener("fetch", function(e) { 100 | var request = e.request; 101 | 102 | if (request.url.indexOf(scope) === -1) { 103 | return; 104 | } 105 | 106 | // Basic read-through caching. 107 | e.respondWith( 108 | caches.open("core").then(function(core) { 109 | return core.match(request).then(function(response) { 110 | if (response) { 111 | return response; 112 | } 113 | 114 | // we didn't have it in the cache, so add it to the cache and return it 115 | log("runtime caching:", request.url); 116 | 117 | return fetchAndCache(request, core); 118 | }); 119 | }) 120 | ); 121 | }); 122 | -------------------------------------------------------------------------------- /images/splash.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 6 | 7 | 8 | 9 | 12 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 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 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | 105 | 106 | 107 | 108 | 109 | 110 | 111 | 112 | 113 | 114 | 116 | 117 | 118 | 120 | 121 | 122 | 123 | 124 | 125 | 126 | 127 | 128 | 129 | 130 | 131 | 132 | 133 | 134 | 135 | 136 | 137 | 139 | 140 | 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 | 170 | 172 | 173 | 174 | 175 | 177 | 178 | 180 | 181 | 182 | 183 | 190 | 195 | 196 | 198 | 199 | 201 | 202 | 204 | 206 | 207 | 212 | 213 | 214 | 219 | 220 | 221 | 222 | 223 | 224 | 226 | 228 | 229 | 230 | 231 | 233 | 234 | 235 | 240 | 241 | 242 | 243 | 244 | 245 | 246 | 247 | 248 | 250 | 251 | 252 | 253 | 254 | 255 | 256 | 257 | 258 | 259 | 261 | 262 | 263 | 264 | 265 | 266 | 267 | 269 | 271 | 272 | 273 | 274 | 276 | 277 | 278 | 280 | 281 | 282 | 283 | 284 | 285 | 289 | 293 | 296 | 299 | 303 | 307 | 310 | 313 | 316 | 322 | 325 | 328 | 331 | 332 | 333 | 334 | --------------------------------------------------------------------------------