You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 

87 rivejä
2.4 KiB

  1. /*
  2. Copyright (C) 2025 QuantumNous
  3. This program is free software: you can redistribute it and/or modify
  4. it under the terms of the GNU Affero General Public License as
  5. published by the Free Software Foundation, either version 3 of the
  6. License, or (at your option) any later version.
  7. This program is distributed in the hope that it will be useful,
  8. but WITHOUT ANY WARRANTY; without even the implied warranty of
  9. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  10. GNU Affero General Public License for more details.
  11. You should have received a copy of the GNU Affero General Public License
  12. along with this program. If not, see <https://www.gnu.org/licenses/>.
  13. For commercial licensing, please contact support@quantumnous.com
  14. */
  15. import React from 'react';
  16. import { Button } from '@douyinfe/semi-ui';
  17. import { Settings, Eye, EyeOff } from 'lucide-react';
  18. const FloatingButtons = ({
  19. styleState,
  20. showSettings,
  21. showDebugPanel,
  22. onToggleSettings,
  23. onToggleDebugPanel,
  24. }) => {
  25. if (!styleState.isMobile) return null;
  26. return (
  27. <>
  28. {/* 设置按钮 */}
  29. {!showSettings && (
  30. <Button
  31. icon={<Settings size={18} />}
  32. style={{
  33. position: 'fixed',
  34. right: 16,
  35. bottom: 90,
  36. zIndex: 1000,
  37. width: 36,
  38. height: 36,
  39. borderRadius: '50%',
  40. padding: 0,
  41. boxShadow: '0 4px 12px rgba(0, 0, 0, 0.2)',
  42. background: 'linear-gradient(to right, #8b5cf6, #6366f1)',
  43. }}
  44. onClick={onToggleSettings}
  45. theme='solid'
  46. type='primary'
  47. className='lg:hidden'
  48. />
  49. )}
  50. {/* 调试按钮 */}
  51. {!showSettings && (
  52. <Button
  53. icon={showDebugPanel ? <EyeOff size={18} /> : <Eye size={18} />}
  54. onClick={onToggleDebugPanel}
  55. theme='solid'
  56. type={showDebugPanel ? 'danger' : 'primary'}
  57. style={{
  58. position: 'fixed',
  59. right: 16,
  60. bottom: 140,
  61. zIndex: 1000,
  62. width: 36,
  63. height: 36,
  64. borderRadius: '50%',
  65. padding: 0,
  66. boxShadow: '0 4px 12px rgba(0, 0, 0, 0.2)',
  67. background: showDebugPanel
  68. ? 'linear-gradient(to right, #e11d48, #be123c)'
  69. : 'linear-gradient(to right, #4f46e5, #6366f1)',
  70. }}
  71. className='lg:hidden'
  72. />
  73. )}
  74. </>
  75. );
  76. };
  77. export default FloatingButtons;