Skip to content

Commit

Permalink
Remove unnecessary comments
Browse files Browse the repository at this point in the history
  • Loading branch information
IPogorelova committed Jan 13, 2025
1 parent 9acb966 commit c2773a9
Show file tree
Hide file tree
Showing 3 changed files with 1 addition and 39 deletions.
37 changes: 0 additions & 37 deletions ui/src/components/use-glow-hover/glow-hover-effect.ts
Original file line number Diff line number Diff line change
@@ -1,13 +1,6 @@
'use client';

import { linearAnimation } from './linear-animation';
/*import presets, { GlowHoverPreset } from './presets';*/

/*import {
forceLightTheme,
forceDarkTheme,
resetForcedTheme
} from './theme-utils';*/

export type GlowHoverOptions = {
hoverBg?: string;
Expand All @@ -16,10 +9,6 @@ export type GlowHoverOptions = {
lightSizeLeaveAnimationTime?: number;
isElementMovable?: boolean;
customStaticBg?: string;
/* /!**
* Force theme on hover. Use with caution.
*!/
forceTheme?: 'light' | 'dark' | false;*/
enableBurst?: boolean;
} & (
| {
Expand Down Expand Up @@ -57,20 +46,10 @@ export function parseColor(colorToParse: string) {
}
}

// eslint-disable-next-line complexity
export const glowHoverEffect = (el: HTMLElement, { preset, ...options }: GlowHoverOptions) => {
if (!el) {
// eslint-disable-next-line @typescript-eslint/no-empty-function
return () => {};
}
/*let presetCfg: GlowHoverPreset = {};
if (preset) {
const maybePreset = presets[preset] as GlowHoverPreset;
if (!maybePreset) {
throw new Error(`Unknown preset ${preset}`);
}
presetCfg = maybePreset;
}*/

const lightColor = options.lightColor ?? '#CEFF00';
const lightSize = options.lightSize ?? 130;
Expand All @@ -79,8 +58,6 @@ export const glowHoverEffect = (el: HTMLElement, { preset, ...options }: GlowHov
const isElementMovable = options.isElementMovable ?? false;
const customStaticBg = options.customStaticBg ?? null;

/*let forceTheme = options.forceTheme ?? null;*/

const enableBurst = options.enableBurst ?? false;

const getResolvedHoverBg = () => getComputedStyle(el).backgroundColor;
Expand Down Expand Up @@ -136,12 +113,6 @@ export const glowHoverEffect = (el: HTMLElement, { preset, ...options }: GlowHov
window.cancelAnimationFrame(lightSizeEnterAnimationId);
window.cancelAnimationFrame(lightSizeLeaveAnimationId);

/*if (forceTheme === 'light') {
forceLightTheme(el);
} else if (forceTheme === 'dark') {
forceDarkTheme(el);
}*/

// animate currentLightSize from 0 to lightSize
linearAnimation({
onProgress: (progress) => {
Expand Down Expand Up @@ -181,10 +152,6 @@ export const glowHoverEffect = (el: HTMLElement, { preset, ...options }: GlowHov
} else {
el.style.background = customStaticBg ? customStaticBg : '';
}

/*if (forceTheme && progress === 1) {
resetForcedTheme(el);
}*/
},
time: lightSizeLeaveAnimationTime,
initialProgress: 1 - currentLightSize / lightSize,
Expand Down Expand Up @@ -262,10 +229,6 @@ export const glowHoverEffect = (el: HTMLElement, { preset, ...options }: GlowHov
el.removeEventListener('mouseup', onMouseUp);
}

/*if (forceTheme) {
resetForcedTheme(el);
}*/

if (resizeObserver) {
resizeObserver.unobserve(el);
resizeObserver.disconnect();
Expand Down
1 change: 0 additions & 1 deletion ui/src/components/use-glow-hover/linear-animation.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ interface LinearAnimationParams {

export const linearAnimation = ({
onProgress,
// eslint-disable-next-line @typescript-eslint/no-empty-function
onIdUpdate = () => {},
time,
initialProgress = 0,
Expand Down
2 changes: 1 addition & 1 deletion ui/src/components/use-glow-hover/use-glow-hover.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ export const useGlowHover = ({ disabled = false, ...options }: GlowHoverHookOpti
() =>
!disabled && ref.current
? glowHoverEffect(ref.current, options)
: // eslint-disable-next-line @typescript-eslint/no-empty-function
:
() => {},
[disabled, ...Object.values(options)],
);
Expand Down

0 comments on commit c2773a9

Please sign in to comment.