[Refactor] Organize logics files. and change import path as well.

This commit is contained in:
Sakamoto Shiina
2024-09-21 00:54:32 +09:00
parent 79e4d28176
commit 7573e99617
17 changed files with 20 additions and 18 deletions

View File

@@ -1,27 +0,0 @@
export const scrollToBottom = (ref, smooth = false) => {
const element = ref.current;
const scroll_height = element.scrollHeight - element.clientHeight;
if (smooth) {
const duration = 300; // スクロールにかける時間(ミリ秒)
const start_time = performance.now();
const scroll_top = element.scrollTop;
const scroll = (current_time) => {
const elapsed = current_time - start_time;
const progress = Math.min(elapsed / duration, 1);
const ease_in_out_quad = (t) => t < 0.5
? 2 * t * t
: -1 + (4 - 2 * t) * t;
element.scrollTop = scroll_top + (scroll_height - scroll_top) * ease_in_out_quad(progress);
if (progress < 1) {
requestAnimationFrame(scroll);
}
};
requestAnimationFrame(scroll);
} else {
element.scrollTop = scroll_height;
}
};

View File

@@ -1,9 +1,9 @@
import { arrayToObject } from "@utils/arrayToObject";
import { useMainFunction } from "./useMainFunction";
import { useMessage } from "./useMessage";
import { useSelectableLanguageList } from "./useSelectableLanguageList";
import { useLanguageSettings } from "./useLanguageSettings";
import { useVolume } from "./useVolume";
import { useMainFunction } from "@logics_main/useMainFunction";
import { useMessage } from "@logics_common/useMessage";
import { useSelectableLanguageList } from "@logics_main/useSelectableLanguageList";
import { useLanguageSettings } from "@logics_main/useLanguageSettings";
import { useVolume } from "@logics_common/useVolume";
import { useSoftwareVersion } from "@logics_configs/useSoftwareVersion";
import { useEnableAutoMicSelect } from "@logics_configs/useEnableAutoMicSelect";