FloatingButtons.js 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071
  1. import React from 'react';
  2. import { Button } from '@douyinfe/semi-ui';
  3. import {
  4. Settings,
  5. Eye,
  6. EyeOff,
  7. } from 'lucide-react';
  8. const FloatingButtons = ({
  9. styleState,
  10. showSettings,
  11. showDebugPanel,
  12. onToggleSettings,
  13. onToggleDebugPanel,
  14. }) => {
  15. if (!styleState.isMobile) return null;
  16. return (
  17. <>
  18. {/* 设置按钮 */}
  19. {!showSettings && (
  20. <Button
  21. icon={<Settings size={18} />}
  22. style={{
  23. position: 'fixed',
  24. right: 16,
  25. bottom: 90,
  26. zIndex: 1000,
  27. width: 36,
  28. height: 36,
  29. borderRadius: '50%',
  30. padding: 0,
  31. boxShadow: '0 4px 12px rgba(0, 0, 0, 0.2)',
  32. background: 'linear-gradient(to right, #8b5cf6, #6366f1)',
  33. }}
  34. onClick={onToggleSettings}
  35. theme='solid'
  36. type='primary'
  37. className="lg:hidden"
  38. />
  39. )}
  40. {/* 调试按钮 */}
  41. {!showSettings && (
  42. <Button
  43. icon={showDebugPanel ? <EyeOff size={18} /> : <Eye size={18} />}
  44. onClick={onToggleDebugPanel}
  45. theme="solid"
  46. type={showDebugPanel ? "danger" : "primary"}
  47. style={{
  48. position: 'fixed',
  49. right: 16,
  50. bottom: 140,
  51. zIndex: 1000,
  52. width: 36,
  53. height: 36,
  54. borderRadius: '50%',
  55. padding: 0,
  56. boxShadow: '0 4px 12px rgba(0, 0, 0, 0.2)',
  57. background: showDebugPanel
  58. ? 'linear-gradient(to right, #e11d48, #be123c)'
  59. : 'linear-gradient(to right, #4f46e5, #6366f1)',
  60. }}
  61. className="lg:hidden !rounded-full !p-0"
  62. />
  63. )}
  64. </>
  65. );
  66. };
  67. export default FloatingButtons;