v1.php 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. <?php
  2. namespace zin;
  3. class floatPreNextBtn extends wg
  4. {
  5. /**
  6. * @var mixed[]
  7. */
  8. protected static $defineProps = array(
  9. 'preLink?:string',
  10. 'nextLink?:string'
  11. );
  12. public static function getPageCSS()
  13. {
  14. return file_get_contents(__DIR__ . DS . 'css' . DS . 'v1.css');
  15. }
  16. public static function getPageJS()
  17. {
  18. return file_get_contents(__DIR__ . DS . 'js' . DS . 'v1.js');
  19. }
  20. protected function build()
  21. {
  22. global $app;
  23. $preLink = $this->prop('preLink');
  24. $nextLink = $this->prop('nextLink');
  25. return array
  26. (
  27. !empty($preLink) ? btn
  28. (
  29. setID('preButton'),
  30. set::url($preLink),
  31. setClass('float-btn fixed z-10 inverse rounded-full w-12 h-12 center bg-opacity-40 backdrop-blur ring-0'),
  32. set::icon('angle-left icon-2x text-white'),
  33. set('data-app', $app->tab)
  34. ) : null,
  35. !empty($nextLink) ? btn
  36. (
  37. setID('nextButton'),
  38. set::url($nextLink),
  39. setClass('float-btn fixed z-10 inverse rounded-full w-12 h-12 center bg-opacity-40 backdrop-blur ring-0'),
  40. set::icon('angle-right icon-2x text-white'),
  41. set('data-app', $app->tab)
  42. ) : null
  43. );
  44. }
  45. }