TcaUtility.php 3.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114
  1. <?php
  2. declare(strict_types=1);
  3. namespace CYBOB\EumSitePackage\Utility;
  4. /**
  5. * @package \CYBOB\EumSitePackage\Utility
  6. */
  7. class TcaUtility
  8. {
  9. /**
  10. * Returns a default crop editor configuration.
  11. *
  12. * @return array[]
  13. */
  14. public static function getDefaultCropConfiguration(): array
  15. {
  16. return [
  17. 'desktop' => [
  18. 'title' => 'Desktop (min-width: 1200px)',
  19. 'cropArea' => [
  20. 'x' => 0.0,
  21. 'y' => 0.0,
  22. 'width' => 1.0,
  23. 'height' => 1.0
  24. ],
  25. 'allowedAspectRatios' => [
  26. '1:1' => [
  27. 'title' => '1:1',
  28. 'value' => 1.0
  29. ],
  30. '4:3' => [
  31. 'title' => '4:3',
  32. 'value' => 4 / 3
  33. ],
  34. '6:7' => [
  35. 'title' => '6:7',
  36. 'value' => 6 / 6.9345372460
  37. ],
  38. '16:9' => [
  39. 'title' => '16:9',
  40. 'value' => 16 / 9
  41. ],
  42. 'NaN' => [
  43. 'title' => 'Free',
  44. 'value' => 0.0
  45. ]
  46. ]
  47. ],
  48. 'tablet' => [
  49. 'title' => 'Tablet (max-width: 1200px)',
  50. 'cropArea' => [
  51. 'x' => 0.0,
  52. 'y' => 0.0,
  53. 'width' => 1.0,
  54. 'height' => 1.0
  55. ],
  56. 'allowedAspectRatios' => [
  57. '1:1' => [
  58. 'title' => '1:1',
  59. 'value' => 1.0
  60. ],
  61. '4:3' => [
  62. 'title' => '4:3',
  63. 'value' => 4 / 3
  64. ],
  65. '6:7' => [
  66. 'title' => '6:7',
  67. 'value' => 6 / 6.9345372460
  68. ],
  69. '16:9' => [
  70. 'title' => '16:9',
  71. 'value' => 16 / 9
  72. ],
  73. 'NaN' => [
  74. 'title' => 'Free',
  75. 'value' => 0.0
  76. ]
  77. ]
  78. ],
  79. 'mobile' => [
  80. 'title' => 'Mobile (max-width: 750px)',
  81. 'cropArea' => [
  82. 'x' => 0.0,
  83. 'y' => 0.0,
  84. 'width' => 1.0,
  85. 'height' => 1.0
  86. ],
  87. 'allowedAspectRatios' => [
  88. '1:1' => [
  89. 'title' => '1:1',
  90. 'value' => 1.0
  91. ],
  92. '4:3' => [
  93. 'title' => '4:3',
  94. 'value' => 4 / 3
  95. ],
  96. '6:7' => [
  97. 'title' => '6:7',
  98. 'value' => 6 / 6.9345372460
  99. ],
  100. '16:9' => [
  101. 'title' => '16:9',
  102. 'value' => 16 / 9
  103. ],
  104. 'NaN' => [
  105. 'title' => 'Free',
  106. 'value' => 0.0
  107. ]
  108. ]
  109. ]
  110. ];
  111. }
  112. }