FloatingButtons.js 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990
  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 {
  18. Settings,
  19. Eye,
  20. EyeOff,
  21. } from 'lucide-react';
  22. const FloatingButtons = ({
  23. styleState,
  24. showSettings,
  25. showDebugPanel,
  26. onToggleSettings,
  27. onToggleDebugPanel,
  28. }) => {
  29. if (!styleState.isMobile) return null;
  30. return (
  31. <>
  32. {/* 设置按钮 */}
  33. {!showSettings && (
  34. <Button
  35. icon={<Settings size={18} />}
  36. style={{
  37. position: 'fixed',
  38. right: 16,
  39. bottom: 90,
  40. zIndex: 1000,
  41. width: 36,
  42. height: 36,
  43. borderRadius: '50%',
  44. padding: 0,
  45. boxShadow: '0 4px 12px rgba(0, 0, 0, 0.2)',
  46. background: 'linear-gradient(to right, #8b5cf6, #6366f1)',
  47. }}
  48. onClick={onToggleSettings}
  49. theme='solid'
  50. type='primary'
  51. className="lg:hidden"
  52. />
  53. )}
  54. {/* 调试按钮 */}
  55. {!showSettings && (
  56. <Button
  57. icon={showDebugPanel ? <EyeOff size={18} /> : <Eye size={18} />}
  58. onClick={onToggleDebugPanel}
  59. theme="solid"
  60. type={showDebugPanel ? "danger" : "primary"}
  61. style={{
  62. position: 'fixed',
  63. right: 16,
  64. bottom: 140,
  65. zIndex: 1000,
  66. width: 36,
  67. height: 36,
  68. borderRadius: '50%',
  69. padding: 0,
  70. boxShadow: '0 4px 12px rgba(0, 0, 0, 0.2)',
  71. background: showDebugPanel
  72. ? 'linear-gradient(to right, #e11d48, #be123c)'
  73. : 'linear-gradient(to right, #4f46e5, #6366f1)',
  74. }}
  75. className="lg:hidden"
  76. />
  77. )}
  78. </>
  79. );
  80. };
  81. export default FloatingButtons;