본문으로 건너뛰기
Skillpedia
웹사이트 및 UI (프런트엔드)7.2k · #13413

cobejs

하는 일

이 스킬은 cobe 라이브러리로 웹사이트에 작은 3D 지구본을 추가하도록 AI 에이전트를 안내합니다. 무거운 3D 도구 없이 위치 표시가 있는 장식용 지구본을 원하는 히어로나 소개 페이지를 위한 스킬입니다.

사용하는 경우

  • ✓히어로나 소개 페이지에 위치 표시가 있는 회전 지구본이 필요할 때.
  • ✓전체 3D 도구 대신 작은 지구본이 필요할 때.
  • ✓지구본은 장식이지만 상호작용에는 반응해야 하는 경우.

스킬 링크

https://github.com/MengTo/Skills/blob/main/agent-skills/web-design/cobejs/SKILL.md

복사해서 AI(Claude, ChatGPT, Cursor)에 붙여넣고 지침을 따르도록 요청하세요.

사용 방법

가장 쉬운 방법입니다. 메시지를 복사해 AI에 붙여넣으세요. AI가 스킬을 읽고 지침을 따릅니다.

바로 붙여넣을 수 있는 메시지

Use this skill to help me: https://github.com/MengTo/Skills/blob/main/agent-skills/web-design/cobejs/SKILL.md Read the SKILL.md file at that link and follow its instructions for my task.
AI가 이런 스킬을 알아서 찾아 쓰길 원하시나요?무료 Skillpedia MCP를 설치하세요. 한 줄이면 작업마다 스킬 15,000+개 중에서 검색합니다.1분 만에 설치 →

AI에게 요청하는 예시

“소개 페이지에 세 도시의 사무실 위치를 표시한 작은 회전 지구본을 추가해 주세요.”

매주 새 스킬 5개. 읽는 데 1분.

작동 방식

에이전트는 캔버스를 설정하고 화면 크기에 맞추며, 위치 좌표와 색이 있는 지구본을 만듭니다. 크기 변경을 처리하고, 휴대폰에서는 픽셀 밀도를 제한하며, 지구본을 멈추거나 제거할 수 있게 합니다.

기술 내용 (원본 SKILL.md)

작성자의 영어 원문을 GitHub에서 그대로 가져왔습니다.

cobe.js — Lightweight WebGL Globe Skill

When to use

  • A “spinning globe” / location markers in hero or about pages
  • You want a small, focused globe lib (not full three.js)
  • Decorative + interactive (markers, rotation) with minimal setup

Key APIs/patterns

  • Core:
    • import createGlobe from "cobe"
    • const globe = createGlobe(canvas, { ...options, onRender(state) { ... } })
  • Important options (common):
    • devicePixelRatio, width, height
    • phi, theta (rotation angles)
    • scale, dark, diffuse
    • baseColor, markerColor, glowColor
    • markers: [{ location: [lat, lon], size, color? }]
  • Lifecycle:
    • globe.toggle() pauses RAF
    • globe.destroy() removes instance

Common pitfalls

  • Canvas sizing mismatch
    • Set CSS size AND set canvas width/height scaled for DPR.
  • Not updating on resize
    • Recompute width/height and recreate or update params.
  • Too high DPR on mobile
    • Clamp DPR to 1–2.

Quick recipe: responsive globe with markers

import createGlobe from "cobe";

const canvas = document.getElementById("cobe");
let phi = 0;

function setup() {
  const rect = canvas.getBoundingClientRect();
  const dpr = Math.min(window.devicePixelRatio, 2);
  canvas.width = Math.round(rect.width * dpr);
  canvas.height = Math.round(rect.height * dpr);

  const globe = createGlobe(canvas, {
    devicePixelRatio: dpr,
    width: canvas.width,
    height: canvas.height,
    phi: 0,
    theta: 0.2,
    dark: 0,
    diffuse: 1.2,
    scale: 1,
    mapSamples: 16000,
    mapBrightness: 6,
    baseColor: [0.2, 0.2, 0.25],
    glowColor: [1, 1, 1],
    markerColor: [0.8, 0.5, 1],
    markers: [{ location: [1.3521, 103.8198], size: 0.08 }],
    onRender: (state) => {
      state.phi = phi;
      phi += 0.01;
    },
  });

  return globe;
}

let globe = setup();
window.addEventListener("resize", () => {
  globe.destroy();
  globe = setup();
});

What to ask the user

  • Globe size and placement (hero, section, card)?
  • Marker locations + colors (brand-aligned)?
  • Interaction needs (drag to rotate vs. ambient spin)?
자주 묻는 질문

React가 필요한가요?

아닙니다. 다만 이 스킬에는 React와 Next.js에서 쓰는 방법에 대한 안내가 포함되어 있습니다.

위치 표시는 무엇인가요?

위도와 경도로 놓인 점이며, 각각 크기와 선택적인 색을 정할 수 있습니다.

캔버스 크기가 왜 중요한가요?

캔버스 크기는 화면의 픽셀 비율과 맞아야 합니다. 그래서 화면에서 보이는 크기와 그리는 크기를 모두 설정해야 한다고 경고합니다.

상세 정보

작성자의 원본 설명

Use when adding a lightweight interactive globe with cobe (canvas setup, markers, interaction, performance, integration with React/Next.js).

repo: MengTo/Skills

인기도

GitHub 스타
7.2k
순위
#13413
라이선스
MIT
업데이트
2026. 11. 1.

이 스킬이 유용한가요?

0

로그인 투표하려면 로그인하세요.

댓글

  • …

이 저장소의 다른 스킬

비슷한 스킬