index.sky 1.2 KB
Newer Older
1 2 3 4 5 6 7 8 9 10 11
<!--
// Copyright 2014 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-->
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport"
      content="initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=yes, width=device-width">
12
<import src="city-list.sky" />
13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31
<style>
html, body {
    margin: 0;
    padding: 0;
    font-family: "Roboto", "HelveticaNeue",sans-serif;
    -webkit-font-smoothing: antialiased;
    font-size: 13px;
    color: #222;
    width: 100%;
    height: 100%;
    -webkit-user-select: none;
}
</style>
</head>
<script>
window.startLoad = new Date().getTime();
</script>
<body>
  <city-list></city-list>
32 33
  <script>
    var cityList = document.querySelector('city-list');
34 35 36 37 38
    var scrollBy = 0;
    var toks = location.search.match(/auto=([0-9]+)/);
    if (toks) {
      scrollBy = Number(toks[1]);
    }
39 40 41 42 43 44 45 46 47 48 49 50

    function autoScroll() {
      cityList.scrollBy(scrollBy);
      requestAnimationFrame(autoScroll);
    }

    if (scrollBy) {
      setTimeout(function() {
        requestAnimationFrame(autoScroll);
      }, 200)
    }
  </script>
51 52
</body>
</html>