使用自定义Scroll布局组件替代浏览器默认滚动条。
This commit is contained in:
		@@ -9,7 +9,6 @@
 | 
			
		||||
    flex-direction: row;
 | 
			
		||||
    align-items: stretch;
 | 
			
		||||
    gap: var(--spacing-m);
 | 
			
		||||
    overflow-y: auto;
 | 
			
		||||
  }
 | 
			
		||||
  .function_side {
 | 
			
		||||
    display: flex;
 | 
			
		||||
 
 | 
			
		||||
@@ -3,6 +3,7 @@ import { useAtom } from 'jotai';
 | 
			
		||||
import { useState } from 'react';
 | 
			
		||||
import { ColorPicker } from '../components/ColorPicker';
 | 
			
		||||
import { LabeledPicker } from '../components/LabeledPicker';
 | 
			
		||||
import { ScrollArea } from '../components/ScrollArea';
 | 
			
		||||
import { VSegmentedControl } from '../components/VSegmentedControl';
 | 
			
		||||
import { ColorWheel } from '../page-components/wheels/ColorWheel';
 | 
			
		||||
import { currentPickedColor } from '../stores/colors';
 | 
			
		||||
@@ -20,58 +21,60 @@ export function Wheels() {
 | 
			
		||||
        <h3>Color Wheels</h3>
 | 
			
		||||
        <p>Choose the required color on the color wheel according to color theory.</p>
 | 
			
		||||
      </header>
 | 
			
		||||
      <section className={styles.explore_section}>
 | 
			
		||||
        <aside className={styles.function_side}>
 | 
			
		||||
          <div>
 | 
			
		||||
            <h5>Basic color</h5>
 | 
			
		||||
            <ColorPicker color={selectedColor} onSelect={(color) => setSelectedColor(color)} />
 | 
			
		||||
          </div>
 | 
			
		||||
          <div>
 | 
			
		||||
            <h5>Series Setting</h5>
 | 
			
		||||
            <LabeledPicker
 | 
			
		||||
              title="Expand Tones"
 | 
			
		||||
              min={1}
 | 
			
		||||
              max={5}
 | 
			
		||||
              step={1}
 | 
			
		||||
              value={tones}
 | 
			
		||||
              onChange={setTones}
 | 
			
		||||
            />
 | 
			
		||||
            <LabeledPicker
 | 
			
		||||
              title="Tone Step"
 | 
			
		||||
              min={5}
 | 
			
		||||
              max={50}
 | 
			
		||||
              step={1}
 | 
			
		||||
              unit="%"
 | 
			
		||||
              value={steps}
 | 
			
		||||
              onChange={setSteps}
 | 
			
		||||
      <ScrollArea enableY>
 | 
			
		||||
        <section className={styles.explore_section}>
 | 
			
		||||
          <aside className={styles.function_side}>
 | 
			
		||||
            <div>
 | 
			
		||||
              <h5>Basic color</h5>
 | 
			
		||||
              <ColorPicker color={selectedColor} onSelect={(color) => setSelectedColor(color)} />
 | 
			
		||||
            </div>
 | 
			
		||||
            <div>
 | 
			
		||||
              <h5>Series Setting</h5>
 | 
			
		||||
              <LabeledPicker
 | 
			
		||||
                title="Expand Tones"
 | 
			
		||||
                min={1}
 | 
			
		||||
                max={5}
 | 
			
		||||
                step={1}
 | 
			
		||||
                value={tones}
 | 
			
		||||
                onChange={setTones}
 | 
			
		||||
              />
 | 
			
		||||
              <LabeledPicker
 | 
			
		||||
                title="Tone Step"
 | 
			
		||||
                min={5}
 | 
			
		||||
                max={50}
 | 
			
		||||
                step={1}
 | 
			
		||||
                unit="%"
 | 
			
		||||
                value={steps}
 | 
			
		||||
                onChange={setSteps}
 | 
			
		||||
              />
 | 
			
		||||
            </div>
 | 
			
		||||
            <div className={styles.mode_navigation}>
 | 
			
		||||
              <h5>Color selection method</h5>
 | 
			
		||||
              <VSegmentedControl
 | 
			
		||||
                onChange={setSelectedMode}
 | 
			
		||||
                options={[
 | 
			
		||||
                  { label: 'Complementary', value: 'complementary' },
 | 
			
		||||
                  { label: 'Analogous', value: 'analogous' },
 | 
			
		||||
                  { label: 'Analogous with Complementary', value: 'analogous_with_complementary' },
 | 
			
		||||
                  { label: 'Triadic', value: 'triadic' },
 | 
			
		||||
                  { label: 'Split Complementary', value: 'split_complementary' },
 | 
			
		||||
                  { label: 'Tetradic', value: 'tetradic' },
 | 
			
		||||
                  { label: 'Flip Tetradic', value: 'flip_tetradic' },
 | 
			
		||||
                  { label: 'Square', value: 'square' },
 | 
			
		||||
                ]}
 | 
			
		||||
              />
 | 
			
		||||
            </div>
 | 
			
		||||
          </aside>
 | 
			
		||||
          <div className={styles.wheel_side}>
 | 
			
		||||
            <ColorWheel
 | 
			
		||||
              originColor={selectedColor}
 | 
			
		||||
              highlightMode={selectedMode}
 | 
			
		||||
              tones={tones}
 | 
			
		||||
              step={steps}
 | 
			
		||||
            />
 | 
			
		||||
          </div>
 | 
			
		||||
          <div className={styles.mode_navigation}>
 | 
			
		||||
            <h5>Color selection method</h5>
 | 
			
		||||
            <VSegmentedControl
 | 
			
		||||
              onChange={setSelectedMode}
 | 
			
		||||
              options={[
 | 
			
		||||
                { label: 'Complementary', value: 'complementary' },
 | 
			
		||||
                { label: 'Analogous', value: 'analogous' },
 | 
			
		||||
                { label: 'Analogous with Complementary', value: 'analogous_with_complementary' },
 | 
			
		||||
                { label: 'Triadic', value: 'triadic' },
 | 
			
		||||
                { label: 'Split Complementary', value: 'split_complementary' },
 | 
			
		||||
                { label: 'Tetradic', value: 'tetradic' },
 | 
			
		||||
                { label: 'Flip Tetradic', value: 'flip_tetradic' },
 | 
			
		||||
                { label: 'Square', value: 'square' },
 | 
			
		||||
              ]}
 | 
			
		||||
            />
 | 
			
		||||
          </div>
 | 
			
		||||
        </aside>
 | 
			
		||||
        <div className={styles.wheel_side}>
 | 
			
		||||
          <ColorWheel
 | 
			
		||||
            originColor={selectedColor}
 | 
			
		||||
            highlightMode={selectedMode}
 | 
			
		||||
            tones={tones}
 | 
			
		||||
            step={steps}
 | 
			
		||||
          />
 | 
			
		||||
        </div>
 | 
			
		||||
      </section>
 | 
			
		||||
        </section>
 | 
			
		||||
      </ScrollArea>
 | 
			
		||||
    </div>
 | 
			
		||||
  );
 | 
			
		||||
}
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user