<commit_before>package io.youi.component

import io.youi.component.support.{PositionSupport, SizeSupport}
import io.youi.component.types.{Display, PositionType}
import io.youi.easing.Easing
import io.youi.{Color, ui}
import io.youi.task._

import scala.concurrent.Future
import scala.concurrent.duration._
import scribe.Execution.global

class Popup extends Container with SizeSupport with PositionSupport {
  position.x @= 0.0
  position.y @= 0.0
  position.z @= 100
  position.`type` @= PositionType.Absolute
  size.width := math.min(600.0, ui.size.width)
  size.height := math.min(800.0, ui.size.height)
  display @= Display.None
  backgroundColor @= Color.Cyan

  private var future: Future[Unit] = Future.successful(())

  def show(): Future[Unit] = {
    future = future.flatMap { _ =>
      sequential(
        position.center := ui.size.center,
        position.y @= ui.size.height,
        display @= Display.Block,
        position.middle.to(ui.size.middle).in(300.millis).easing(Easing.exponentialOut)
      ).start().future.map(_ => ())
    }
    future
  }

  def hide(): Future[Unit] = {
    future = future.flatMap { _ =>
      sequential(
        position.y.to(ui.size.height).in(300.millis).easing(Easing.exponentialOut),
        display @= Display.None
      ).start().future.map(_ => ())
    }
    future
  }
}<commit_msg>Minor updates to Popup<commit_after>package io.youi.component

import io.youi.component.support.{PositionSupport, SizeSupport}
import io.youi.component.types.{Display, PositionType}
import io.youi.easing.Easing
import io.youi.{Color, ui}
import io.youi.task._
import reactify.Var

import scala.concurrent.Future
import scala.concurrent.duration._
import scribe.Execution.global

class Popup extends Container with SizeSupport with PositionSupport {
  val easing: Var[Easing] = Var(Easing.exponentialOut)
  val speed: Var[FiniteDuration] = Var(300.millis)

  position.x @= 0.0
  position.y @= 0.0
  position.z @= 100
  position.`type` @= PositionType.Absolute
  size.width := math.min(600.0, ui.size.width)
  size.height := math.min(800.0, ui.size.height)
  display @= Display.None
  backgroundColor @= Color.Cyan

  private var future: Future[Unit] = Future.successful(())

  def show(): Future[Unit] = {
    future = future.flatMap { _ =>
      sequential(
        position.center := ui.size.center,
        position.y @= ui.size.height,
        display @= Display.Block,
        position.middle.to(ui.size.middle).in(speed).easing(easing)
      ).start().future.map(_ => ())
    }
    future
  }

  def hide(): Future[Unit] = {
    future = future.flatMap { _ =>
      sequential(
        position.y.to(ui.size.height).in(speed).easing(easing),
        display @= Display.None
      ).start().future.map(_ => ())
    }
    future
  }
}
{'fraction_non_alphanumeric': 0.14290856731461482, 'fraction_numerical': 0.014038876889848811, 'mean_word_length': 3.2492354740061162, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 11, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3427161', 'n_tokens_mistral': 951, 'n_tokens_neox': 920, 'n_words': 169}