ExitToLeftFrames.php 4.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117
  1. <?php
  2. namespace League\CLImate\Tests\Animation;
  3. trait ExitToLeftFrames
  4. {
  5. abstract protected function shouldWrite($content, $count = 1);
  6. abstract protected function blankLines($count = 1);
  7. protected function fullArtExitLeft()
  8. {
  9. $this->shouldWrite("\e[m _ _ \e[0m")->ordered();
  10. $this->shouldWrite("\e[m | || | \e[0m")->ordered();
  11. $this->shouldWrite("\e[m | || |_ \e[0m")->ordered();
  12. $this->shouldWrite("\e[m |__ _|\e[0m")->ordered();
  13. $this->shouldWrite("\e[m | | \e[0m")->ordered();
  14. $this->shouldWrite("\e[m |_| \e[0m")->ordered();
  15. }
  16. protected function fullArtExitLeftPlus($times = 1)
  17. {
  18. for ($i = 1; $i <= $times; $i++) {
  19. $this->shouldWrite("\e[m\e[6A\r\e[K _ _ \e[0m")->ordered();
  20. $this->shouldWrite("\e[m\r\e[K | || | \e[0m")->ordered();
  21. $this->shouldWrite("\e[m\r\e[K | || |_ \e[0m")->ordered();
  22. $this->shouldWrite("\e[m\r\e[K |__ _|\e[0m")->ordered();
  23. $this->shouldWrite("\e[m\r\e[K | | \e[0m")->ordered();
  24. $this->shouldWrite("\e[m\r\e[K |_| \e[0m")->ordered();
  25. }
  26. }
  27. protected function exitLeftFrame1()
  28. {
  29. $this->shouldWrite("\e[m\e[6A\r\e[K _ _ \e[0m")->ordered();
  30. $this->shouldWrite("\e[m\r\e[K| || | \e[0m")->ordered();
  31. $this->shouldWrite("\e[m\r\e[K| || |_ \e[0m")->ordered();
  32. $this->shouldWrite("\e[m\r\e[K|__ _|\e[0m")->ordered();
  33. $this->shouldWrite("\e[m\r\e[K | | \e[0m")->ordered();
  34. $this->shouldWrite("\e[m\r\e[K |_| \e[0m")->ordered();
  35. }
  36. protected function exitLeftFrame2()
  37. {
  38. $this->shouldWrite("\e[m\e[6A\r\e[K_ _ \e[0m")->ordered();
  39. $this->shouldWrite("\e[m\r\e[K || | \e[0m")->ordered();
  40. $this->shouldWrite("\e[m\r\e[K || |_ \e[0m")->ordered();
  41. $this->shouldWrite("\e[m\r\e[K__ _|\e[0m")->ordered();
  42. $this->shouldWrite("\e[m\r\e[K | | \e[0m")->ordered();
  43. $this->shouldWrite("\e[m\r\e[K |_| \e[0m")->ordered();
  44. }
  45. protected function exitLeftFrame3()
  46. {
  47. $this->shouldWrite("\e[m\e[6A\r\e[K _ \e[0m")->ordered();
  48. $this->shouldWrite("\e[m\r\e[K|| | \e[0m")->ordered();
  49. $this->shouldWrite("\e[m\r\e[K|| |_ \e[0m")->ordered();
  50. $this->shouldWrite("\e[m\r\e[K_ _|\e[0m")->ordered();
  51. $this->shouldWrite("\e[m\r\e[K | | \e[0m")->ordered();
  52. $this->shouldWrite("\e[m\r\e[K |_| \e[0m")->ordered();
  53. }
  54. protected function exitLeftFrame4()
  55. {
  56. $this->shouldWrite("\e[m\e[6A\r\e[K _ \e[0m")->ordered();
  57. $this->shouldWrite("\e[m\r\e[K| | \e[0m")->ordered();
  58. $this->shouldWrite("\e[m\r\e[K| |_ \e[0m")->ordered();
  59. $this->shouldWrite("\e[m\r\e[K _|\e[0m")->ordered();
  60. $this->shouldWrite("\e[m\r\e[K| | \e[0m")->ordered();
  61. $this->shouldWrite("\e[m\r\e[K|_| \e[0m")->ordered();
  62. }
  63. protected function exitLeftFrame5()
  64. {
  65. $this->shouldWrite("\e[m\e[6A\r\e[K_ \e[0m")->ordered();
  66. $this->shouldWrite("\e[m\r\e[K | \e[0m")->ordered();
  67. $this->shouldWrite("\e[m\r\e[K |_ \e[0m")->ordered();
  68. $this->shouldWrite("\e[m\r\e[K _|\e[0m")->ordered();
  69. $this->shouldWrite("\e[m\r\e[K | \e[0m")->ordered();
  70. $this->shouldWrite("\e[m\r\e[K_| \e[0m")->ordered();
  71. }
  72. protected function exitLeftFrame6()
  73. {
  74. $this->shouldWrite("\e[m\e[6A\r\e[K \e[0m")->ordered();
  75. $this->shouldWrite("\e[m\r\e[K| \e[0m")->ordered();
  76. $this->shouldWrite("\e[m\r\e[K|_ \e[0m")->ordered();
  77. $this->shouldWrite("\e[m\r\e[K _|\e[0m")->ordered();
  78. $this->shouldWrite("\e[m\r\e[K| \e[0m")->ordered();
  79. $this->shouldWrite("\e[m\r\e[K| \e[0m")->ordered();
  80. }
  81. protected function exitLeftFrame7()
  82. {
  83. $this->shouldWrite("\e[m\e[6A\r\e[K \e[0m")->ordered();
  84. $this->shouldWrite("\e[m\r\e[K \e[0m")->ordered();
  85. $this->shouldWrite("\e[m\r\e[K_ \e[0m")->ordered();
  86. $this->shouldWrite("\e[m\r\e[K_|\e[0m")->ordered();
  87. $this->shouldWrite("\e[m\r\e[K \e[0m")->ordered();
  88. $this->shouldWrite("\e[m\r\e[K \e[0m")->ordered();
  89. }
  90. protected function exitLeftFrame8()
  91. {
  92. $this->shouldWrite("\e[m\e[6A\r\e[K \e[0m")->ordered();
  93. $this->shouldWrite("\e[m\r\e[K \e[0m")->ordered();
  94. $this->shouldWrite("\e[m\r\e[K \e[0m")->ordered();
  95. $this->shouldWrite("\e[m\r\e[K|\e[0m")->ordered();
  96. $this->shouldWrite("\e[m\r\e[K \e[0m")->ordered();
  97. $this->shouldWrite("\e[m\r\e[K \e[0m")->ordered();
  98. }
  99. protected function exitLeftFrame9()
  100. {
  101. $this->shouldWrite("\e[m\e[6A\r\e[K\e[0m")->ordered();
  102. $this->blankLines(5);
  103. }
  104. }