본문 바로가기
AI 실생활 웹앱 개발기/For 육아

[영단어 어플 만들기 3편] AI 안티그래비티로 모바일 학습 화면(프론트엔드) 만들기

by 전자동 2026. 9. 21.

구글 앱스 스크립트(GAS)에서 발급받은 웹앱 API URL을 자바스크립트 fetch()로 호출하여, 모바일 플래시카드 UI·발음 듣기(Web Speech API)·정답 폭죽 효과를 갖춘 영단어 학습 웹 프론트엔드를 구현하고 데이터 로딩 오류를 해결한 과정을 다룹니다.

1. 프론트엔드(Frontend)? 그냥 예쁜 '포장지'입니다

우리가 구글 스프레드시트에 적어둔 단어들은 지금 '날것' 그대로의 데이터입니다.

이것을 사용자가 보기 좋게 화면에 띄워주고, 버튼을 누르면 다음 단어로 넘어가게 해주는 껍데기가 바로 '프론트엔드'입니다.

전문 개발자들은 복잡한 언어를 배워서 이 포장지를 만듭니다.

하지만 우리는 AI(챗GPT, 제미나이)에게 "이런 모양으로 포장지 좀 만들어줘!"라고 명령만 내릴 것입니다.

2. 복붙해서 쓰세요! 프론트엔드 바이브코딩 프롬프트

아래 박스에 있는 글을 그대로 복사해서 AI 채팅창에 입력해 보세요.

단, 중간에 있는 [나의 API 주소] 부분은 지난 시간에 발급받은 본인의 주소로 꼭 바꿔서 넣으셔야 합니다!

[초보자용 프론트엔드 바이브코딩 프롬프트]

너는 지금부터 20년 차 최고 수준의 '앱 프론트엔드 UI/UX 디자이너 겸 개발자'야. 나는 코딩을 모르는 초보자야.

내가 구글 스프레드시트로 만든 API 주소를 줄 테니, 이 데이터를 가져와서 모바일 화면에 딱 맞는 세련된 '영단어 퀴즈 앱' 화면을 만들어줘.

[나의 API 주소]
여기에 지난번 발급받은 주소를 붙여넣으세요!

[앱 디자인 및 기능 요구사항]
1. 디자인은 화사하고 입체감 있는 그라데이션 버튼들로 꾸며줘. (상단 이미지와 비슷한 느낌으로!)
2. 홈 화면에는 듣기 평가, 랜덤 단어 시험, 사지선다 퀴즈 등 다양한 메뉴 버튼을 큼직하게 배치해 줘.
3. 하단에는 홈, 단어장, 통계로 이동할 수 있는 네비게이션 탭 메뉴를 깔끔하게 넣어줘.

[★가장 중요한 요청★]
내가 코드를 복사해서 메모장에 붙여넣고 확장자를 바꾸는 귀찮은 작업을 하지 않게 해줘. 네가 코드를 완벽하게 작성한 뒤, 내가 클릭 한 번에 다운로드할 수 있도록 `voca_app.html` 파일 자체를 만들어서 다운로드 링크로 제공해 줘!

더보기
<!DOCTYPE html>
<html lang="ko">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>영단어 플래시카드</title>
  <script src="https://cdn.jsdelivr.net/npm/canvas-confetti@1.9.3/dist/confetti.browser.min.js"></script>
  <style>
    * { box-sizing: border-box; margin: 0; padding: 0; font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif; }
    body { background: #f0f4f8; min-height: 100vh; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 20px; }
    .container { width: 100%; max-width: 420px; text-align: center; }
    .header { margin-bottom: 20px; }
    .header h1 { font-size: 1.5rem; color: #1e293b; margin-bottom: 8px; }
    .loading { font-size: 1rem; color: #64748b; padding: 40px 0; }
    .error-box { background: #fee2e2; color: #dc2626; border: 1px solid #f87171; border-radius: 12px; padding: 16px; margin: 20px 0; font-size: 0.95rem; text-align: left; }
    .card { background: #ffffff; border-radius: 16px; box-shadow: 0 8px 24px rgba(0,0,0,0.08); padding: 40px 24px; min-height: 240px; display: flex; flex-direction: column; justify-content: center; align-items: center; cursor: pointer; transition: transform 0.2s, box-shadow 0.2s; position: relative; }
    .card:active { transform: scale(0.98); }
    .day-badge { background: #e0f2fe; color: #0284c7; padding: 4px 12px; border-radius: 20px; font-size: 0.85rem; font-weight: bold; margin-bottom: 12px; }
    .word { font-size: 2.2rem; font-weight: bold; color: #0f172a; margin-bottom: 8px; }
    .meaning { font-size: 1.4rem; color: #059669; font-weight: 600; }
    .hint { font-size: 0.85rem; color: #94a3b8; margin-top: 16px; }
    .btn-group { display: flex; gap: 10px; margin-top: 24px; }
    .btn { flex: 1; padding: 14px 16px; border: none; border-radius: 12px; font-size: 1rem; font-weight: bold; cursor: pointer; transition: transform 0.1s, filter 0.2s; }
    .btn:active { transform: scale(0.96); }
    .btn-speaker { background: #e2e8f0; color: #334155; }
    .btn-correct { background: linear-gradient(135deg, #22c55e, #16a34a); color: #ffffff; box-shadow: 0 4px 12px rgba(22, 163, 74, 0.3); }
    .btn-next { background: linear-gradient(135deg, #3b82f6, #2563eb); color: #ffffff; box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3); }
  </style>
</head>
<body>
  <div class="container">
    <div class="header">
      <h1>오늘의 영단어 퀴즈</h1>
    </div>
•
    <div id="loading" class="loading">단어장을 불러오는 중입니다...</div>
    <div id="error" class="error-box" style="display: none;"></div>
•
    <div id="app" style="display: none;">
      <div class="card" id="flashcard" onclick="flipCard()">
        <span class="day-badge" id="cardDay">Day 1</span>
        <div class="word" id="cardWord">apple</div>
        <div class="meaning" id="cardMeaning" style="display: none;">사과</div>
        <div class="hint" id="cardHint">👆 터치하여 뜻 확인하기</div>
      </div>
•
      <div class="btn-group">
        <button class="btn btn-speaker" onclick="speakWord()">🔊 발음 듣기</button>
        <button class="btn btn-correct" onclick="onCorrect()">🎉 정답 맞힘!</button>
        <button class="btn btn-next" onclick="nextWord()">다음 단어 ➔</button>
      </div>
    </div>
  </div>
•
  <script>
    const API_URL = "YOUR_GAS_WEB_APP_URL"; // 2편에서 발급받은 웹앱 배포 URL 입력
    let words = [];
    let currentIndex = 0;
    let isFlipped = false;
•
    async function loadWords() {
      const loadingEl = document.getElementById("loading");
      const errorEl = document.getElementById("error");
      const appEl = document.getElementById("app");
•
      loadingEl.style.display = "block";
      errorEl.style.display = "none";
      appEl.style.display = "none";
•
      try {
        const res = await fetch(API_URL);
        if (!res.ok) {
          throw new Error("서버 응답 오류 (HTTP " + res.status + ")");
        }
        const data = await res.json();
        if (data.error) {
          throw new Error(data.error);
        }
        if (!data.words || data.words.length === 0) {
          throw new Error("불러올 단어 데이터가 시트에 없습니다.");
        }
        words = data.words;
        loadingEl.style.display = "none";
        appEl.style.display = "block";
        currentIndex = 0;
        showWord();
      } catch (err) {
        console.error("데이터 로딩 실패:", err);
        loadingEl.style.display = "none";
        errorEl.style.display = "block";
        errorEl.innerHTML = "<strong>단어를 불러오지 못했습니다.</strong><br>" +
          "구글 앱스 스크립트 배포 시 '액세스 권한'이 '모든 사용자(Anyone)'로 설정되었는지 확인해 주세요.<br>" +
          "<small style='color:#7f1d1d;'>상세 오류: " + err.message + "</small>";
      }
    }
•
    function showWord() {
      if (!words || words.length === 0) return;
      const current = words[currentIndex];
      isFlipped = false;
      document.getElementById("cardDay").innerText = current.day || "Day 1";
      document.getElementById("cardWord").innerText = current.word;
      document.getElementById("cardWord").style.display = "block";
      document.getElementById("cardMeaning").innerText = current.meaning;
      document.getElementById("cardMeaning").style.display = "none";
      document.getElementById("cardHint").innerText = "👆 터치하여 뜻 확인하기";
    }
•
    function flipCard() {
      isFlipped = !isFlipped;
      const wordEl = document.getElementById("cardWord");
      const meaningEl = document.getElementById("cardMeaning");
      const hintEl = document.getElementById("cardHint");
      if (isFlipped) {
        wordEl.style.display = "none";
        meaningEl.style.display = "block";
        hintEl.innerText = "👆 터치하여 영어 단어 보기";
      } else {
        wordEl.style.display = "block";
        meaningEl.style.display = "none";
        hintEl.innerText = "👆 터치하여 뜻 확인하기";
      }
    }
•
    function speakWord() {
      if (!words || words.length === 0) return;
      const current = words[currentIndex];
      if (!("speechSynthesis" in window)) {
        alert("현재 브라우저는 음성 합성을 지원하지 않습니다.");
        return;
      }
      window.speechSynthesis.cancel();
      const utterance = new SpeechSynthesisUtterance(current.word);
      utterance.lang = "en-US";
      utterance.rate = 0.9;
      window.speechSynthesis.speak(utterance);
    }
•
    function onCorrect() {
      confetti({
        particleCount: 80,
        spread: 70,
        origin: { y: 0.6 }
      });
      setTimeout(() => {
        nextWord();
      }, 600);
    }
•
    function nextWord() {
      if (!words || words.length === 0) return;
      currentIndex = (currentIndex + 1) % words.length;
      showWord();
    }
•
    window.addEventListener("DOMContentLoaded", loadWords);
  </script>
</body>
</html>

3. 클릭 한 번에 앱 실행하기 (진정한 바이브코딩!)

예전 같았으면 AI가 짜준 복잡한 코드를 복사해서, 메모장을 열고, 확장자를 바꾸느라 초보자들은 멘붕에 빠졌습니다.

하지만 우리는 프롬프트에 "파일로 만들어서 줘!"라고 스마트하게 지시했습니다.

AI는 코드를 완성한 뒤 채팅창에 [voca_app.html 다운로드]라는 파일 버튼을 만들어 줄 것입니다.

💡 세상에서 가장 쉬운 앱 실행 방법

  1. AI가 만들어준 voca_app.html 파일을 다운로드합니다.
  2. 다운로드된 파일을 더블클릭합니다! (인터넷 창이 열리며 화려한 앱이 바로 실행됩니다.)

맞춤형 영어학습 웹앱 실행 후 메인 학습 메뉴 화면 (전체단어 660개 및 5가지 학습 모드)
전자동이 구현한 기능들과 html 구현 화면 (원하는 기능을 추가해도 좋습니다!)


4. 안티그래비티 바이브코딩 실전 꿀팁: UI 완성도 올리기

AI에게 단순히 "예쁘게 만들어줘"라고만 하면 스마트폰 기종마다 화면이 깨지거나 글씨가 겹치는 현상이 발생할 수 있습니다. 코딩 지식이 없어도 아래의 3가지 핵심 키워드만 프롬프트에 덧붙여주면 상용 앱 부럽지 않은 고퀄리티 화면이 완성됩니다.

  • "모바일 퍼스트(Mobile-First) 반응형 디자인으로 짜줘"
    PC 모니터뿐만 아니라 아이폰, 갤럭시 등 화면 크기가 작은 스마트폰에서도 버튼과 텍스트 크기가 자동으로 최적화되도록 지시하는 마법의 키워드입니다.
  • "버튼 클릭 시 살짝 눌리는 애니메이션(Hover & Active 효과)을 넣어줘"
    사용자가 화면을 터치했을 때 버튼이 쫀득하게 반응하면, 단순한 웹페이지가 아니라 마치 앱스토어에서 다운로드한 진짜 앱을 쓰는 듯한 부드러운 사용자 경험(UX)을 주게 됩니다.
  • "데이터 로딩 중에는 안내 스피너(Loading Indicator)를 띄워줘"
    지난 2편에서 연결한 구글 스프레드시트 API에서 단어 데이터를 불러오는 동안, 빈 화면 대신 '단어장을 불러오는 중입니다...'라는 로딩 안내를 띄워주면 앱이 멈춘 것처럼 보이는 현상을 방지할 수 있습니다.

5. 초보자가 100% 겪는 3대 화면 에러 & 해결법

직접 따라 하시면서 "어? 왜 화면이 안 뜨지?" 하고 당황하셨던 분들을 위해, 가장 빈번하게 발생하는 3가지 오류와 AI에게 질문해서 1초 만에 고치는 해결법을 정리해 드립니다.

Q1. "화면은 나오는데 단어 목록이 하나도 안 떠요!"

원인: 구글 앱스 스크립트(GAS) 배포 주소의 접근 권한이 '모든 사용자(Anyone)'로 열려있지 않거나, 주소 입력 시 따옴표 오류가 난 경우입니다.

해결 프롬프트: "voca_app.html 파일에서 구글 API 데이터를 fetch로 불러오는 부분에 에러 로그를 추가해 주고, 통신 실패 시 화면에 친절한 오류 안내 문구가 뜨도록 수정해줘."

Q2. "스마트폰으로 열었더니 글자가 너무 작아서 안 보여요!"

원인: 모바일 화면 배율을 맞춰주는 뷰포트(viewport) 메타 태그가 누락되었을 때 발생합니다.

해결 프롬프트: "스마트폰 세로 모드에 딱 맞도록 viewport 메타 태그를 추가하고, 본문 글씨와 버튼 폰트 크기를 모바일 터치에 편하게 키워줘."

Q3. "버튼 색상이나 배경을 다른 분위기로 바꾸고 싶어요."

해결 프롬프트: "현재 테마를 아이들이 좋아하는 따뜻한 파스텔톤(민트 & 옐로우 조합)으로 변경하고, 카드 모서리를 둥글둥글하게(border-radius: 16px) 다듬어줘."


짠! 화면에 여러분이 상상했던 멋진 앱 화면이 나타났나요? 축하합니다.

여러분은 방금 코딩 한 줄 없이, 메모장 한 번 열지 않고 상용 앱 수준의 어플을 완성하셨습니다!

다음 시간에는 우리가 만든 이 멋진 웹 앱을, 진짜 스마트폰 바탕화면에 '앱 아이콘'으로 깔아보는 마지막 단계를 알아보겠습니다.

기대해 주세요!

◀ 이전 2편 먼저 보기: 구글 시트 DB와 앱스 스크립트(GAS) 무료 API 구축하기

▶ 다음 4편(완결) 바로가기: 깃허브(GitHub Pages)로 평생 무료 앱 배포 & 자동 업데이트 세팅