npm install dat.gui
또는 CDN 이용
<script src="https://cdnjs.cloudflare.com/ajax/libs/dat-gui/0.7.6/dat.gui.min.js"></script>
- 상대적으로 더 크고 무거운 라이브러리입니다. 다양한 기능과 옵션을 제공하지만, 크기 면에서는 조금 부담이 될 수 있습니다.
- 더 많은 설정과 기능을 제공하지만, 그만큼 약간 더 복잡할 수 있습니다. 개발자가 다양한 사용자 인터페이스 요소를 쉽게 추가하고, 제어할 수 있는 기능을 많이 갖추고 있습니다.
- 오랜 역사를 가지고 있고, 다양한 프로젝트에서 사용되어 왔지만, 최근에는 유지보수와 업데이트가 비교적 느립니다.
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>dat.gui Example</title>
<script src="https://cdnjs.cloudflare.com/ajax/libs/dat-gui/0.7.6/dat.gui.min.js"></script>
</head>
<body>
<script>
// 설정할 객체
const params = {
speed: 0.5,
color: "#ff0000",
};
// dat.gui를 생성하고 GUI 컨트롤 추가
const gui = new dat.GUI();
gui.add(params, 'speed', 0, 1); // 0 ~ 1 사이 슬라이더
gui.addColor(params, 'color'); // 색상 선택기
</script>
</body>
</html>
npm install lil-gui
또는 CDN 이용
<script src="https://cdn.jsdelivr.net/npm/lil-gui@0.16/lil-gui.min.js"></script>
- dat.gui의 경량화 버전이라고 볼 수 있습니다. 불필요한 기능을 제거하고 기본적인 GUI 기능만 제공함으로써 더 가볍습니다. 파일 크기가 작아 성능 최적화가 중요한 프로젝트에 유리합니다.
- dat.gui와 API 구조는 거의 비슷하지만, 덜 사용되는 기능들을 제거하여 더 단순하고 가볍게 만들었습니다. 빠르게 설정하고 사용할 수 있습니다.
- 새로운 경량 대안으로 최근 더 활발하게 사용되고 있으며, 성능 최적화와 간편한 사용을 목표로 개발되었습니다.
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>lil-gui Example</title>
<script src="https://cdn.jsdelivr.net/npm/lil-gui@0.16/lil-gui.min.js"></script>
</head>
<body>
<script>
// 설정할 객체
const params = {
speed: 0.5,
color: "#ff0000",
};
// lil-gui를 생성하고 GUI 컨트롤 추가
const gui = new lil.GUI();
gui.add(params, 'speed', 0, 1); // 0 ~ 1 사이 슬라이더
gui.addColor(params, 'color'); // 색상 선택기
</script>
</body>
</html>
** 여기서 lil 의 의미는 little 입니다.
iterable (이터러블), iterator (0) | 2024.09.30 |
---|---|
객체 리터럴 2가지 표현 방식의 차이점 (8) | 2024.09.30 |
eslint 사용 안하기 (0) | 2024.09.18 |
importmap - type attribute 타입속성 (3) | 2024.09.18 |
properties(속성), attributes(특성) 차이점 (1) | 2024.09.17 |