Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(385)

Unified Diff: sky/framework/elements/sky-ink-splash.sky

Issue 1132063007: Rationalize Dart mojo and sky package structure (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: Created 5 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « sky/framework/elements/sky-icon.sky ('k') | sky/framework/elements/sky-input.sky » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sky/framework/elements/sky-ink-splash.sky
diff --git a/sky/framework/elements/sky-ink-splash.sky b/sky/framework/elements/sky-ink-splash.sky
deleted file mode 100644
index 6a2ab6db87f8267adf775fb27e006814927355db..0000000000000000000000000000000000000000
--- a/sky/framework/elements/sky-ink-splash.sky
+++ /dev/null
@@ -1,98 +0,0 @@
-<!--
-// Copyright 2015 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.
--->
-<import src="sky-element.sky" />
-
-<sky-element>
-<template>
- <style>
- :host {
- position: absolute;
- pointer-events: none;
- overflow: hidden;
- top: 0;
- left: 0;
- bottom: 0;
- right: 0;
- }
-
- #splash {
- position: absolute;
- background-color: rgba(0, 0, 0, 0.4);
- border-radius: 0;
- top: 0;
- left: 0;
- height: 0;
- width: 0;
- }
- </style>
- <div id="splash" />
-</template>
-<script>
-import "../animation/curves.dart";
-import "animation/controller.dart";
-import "animation/timer.dart";
-import "dart:math" as math;
-import "dart:sky";
-import "dart:async";
-
-const double _kSplashSize = 400.0;
-const double _kSplashDuration = 500.0;
-
-@Tagname('sky-ink-splash')
-class SkyInkSplash extends SkyElement implements AnimationDelegate {
- AnimationController _animation;
- Element _splash;
- double _offsetX;
- double _offsetY;
- Completer<SkyInkSplash> _completer = new Completer();
-
- SkyInkSplash() {
- _animation = new AnimationController(this);
- }
-
- void shadowRootReady() {
- _splash = shadowRoot.getElementById('splash');
- }
-
- Future start(double x, double y, ClientRect rect) {
- _offsetX = x - rect.left;
- _offsetY = y - rect.top;
- _animation.start(
- begin: 0.0,
- end: _kSplashSize,
- duration: _kSplashDuration,
- curve: easeOut);
- return _completer.future;
- }
-
- void _done() {
- remove();
- _completer.complete(this);
- }
-
- void cancel() {
- // TODO(eseidel): Should fade away instead of stopping immediately.
- _animation.stop();
- _done();
- }
-
- void updateAnimation(double p) {
- if (p == _kSplashSize) {
- _done();
- return;
- }
- _splash.style['top'] = '${_offsetY - p/2}px';
- _splash.style['left'] = '${_offsetX - p/2}px';
- _splash.style['width'] = '${p}px';
- _splash.style['height'] = '${p}px';
- _splash.style['border-radius'] = '${p}px';
- _splash.style['opacity'] = '${1.0 - (p / _kSplashSize)}';
- }
-}
-
-_init(script) => register(script, SkyInkSplash);
-</script>
-</sky-element>
« no previous file with comments | « sky/framework/elements/sky-icon.sky ('k') | sky/framework/elements/sky-input.sky » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698