summaryrefslogtreecommitdiff
path: root/chromium/chrome/browser/resources/welcome/welcome.js
blob: 72569810ab42f839e7c268afc7ebaaca9c8f8bfd (plain)
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
// Copyright 2016 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.

cr.define('welcome', function() {
  'use strict';

  function onAccept(e) {
    chrome.send('handleActivateSignIn');
  }

  function onDecline(e) {
    chrome.send('handleUserDecline');
    e.preventDefault();
  }

  function initialize() {
    $('accept-button').addEventListener('click', onAccept);
    $('decline-button').addEventListener('click', onDecline);

    var logo = document.querySelector('.logo-icon');
    logo.onclick = function(e) {
      logo.animate({
        transform: ['none', 'rotate(-10turn)'],
      }, /** @type {!KeyframeEffectOptions} */({
        duration: 500,
        easing: 'cubic-bezier(1, 0, 0, 1)',
      }));
    };
  }

  return {
    initialize: initialize
  };
});

document.addEventListener('DOMContentLoaded', welcome.initialize);