๐Ÿ’ป ์‹ค์Šต ํ”„๋กœ์ ํŠธ๋ณ„ ์ฝ”๋“œ ํ…œํ”Œ๋ฆฟ & GitHub ๋ฐฐํฌ ๋ฐฉ๋ฒ•

 

๐Ÿ’ป ์‹ค์Šต ํ”„๋กœ์ ํŠธ๋ณ„ ์ฝ”๋“œ ํ…œํ”Œ๋ฆฟ & GitHub ๋ฐฐํฌ ๋ฐฉ๋ฒ•

1. ๐Ÿ“ ๋ธ”๋กœ๊ทธ ํŽ˜์ด์ง€

๐Ÿ“ฆ ์ฝ”๋“œ ํ…œํ”Œ๋ฆฟ

  • index.html

html
<!DOCTYPE html>
<html lang="ko">
<head>
  <meta charset="UTF-8">
  <title>๋‚˜์˜ ๋ธ”๋กœ๊ทธ</title>
  <link rel="stylesheet" href="style.css">
</head>
<body>
  <h1>Hyun์˜ ๋ธ”๋กœ๊ทธ</h1>
  <div id="posts"></div>
  <textarea id="newPost" placeholder="์ƒˆ ๊ธ€ ์ž‘์„ฑ..."></textarea>
  <button onclick="addPost()">๊ธ€ ์˜ฌ๋ฆฌ๊ธฐ</button>
  <script src="script.js"></script>
</body>
</html>
  • style.css

css
body {
  font-family: sans-serif;
  padding: 20px;
}
textarea {
  width: 100%;
  height: 100px;
}
  • script.js

javascript
function addPost() {
  const text = document.getElementById("newPost").value;
  const post = document.createElement("p");
  post.textContent = text;
  document.getElementById("posts").appendChild(post);
  document.getElementById("newPost").value = "";
}

2. ๐ŸŽจ ํฌํŠธํด๋ฆฌ์˜ค ์›น์‚ฌ์ดํŠธ

๐Ÿ“ฆ ์ฝ”๋“œ ํ…œํ”Œ๋ฆฟ

  • index.html

html
<!DOCTYPE html>
<html lang="ko">
<head>
  <meta charset="UTF-8">
  <title>Hyun์˜ ํฌํŠธํด๋ฆฌ์˜ค</title>
  <link rel="stylesheet" href="style.css">
</head>
<body>
  <header>
    <h1>Hyun</h1>
    <p>ํ”„๋ก ํŠธ์—”๋“œ ๊ฐœ๋ฐœ์ž</p>
  </header>
  <section id="projects">
    <h2>ํ”„๋กœ์ ํŠธ</h2>
    <div class="card">Todo ์•ฑ</div>
    <div class="card">๋‚ ์”จ ์•ฑ</div>
  </section>
</body>
</html>
  • style.css

css
body {
  font-family: sans-serif;
  background: #f0f0f0;
}
.card {
  background: white;
  padding: 10px;
  margin: 10px;
  border-radius: 5px;
}

3. ๐ŸŽฎ ์ˆซ์ž ๋งž์ถ”๊ธฐ ๊ฒŒ์ž„

๐Ÿ“ฆ ์ฝ”๋“œ ํ…œํ”Œ๋ฆฟ

  • index.html

html
<!DOCTYPE html>
<html>
<head>
  <title>์ˆซ์ž ๋งž์ถ”๊ธฐ ๊ฒŒ์ž„</title>
</head>
<body>
  <h1>1~100 ์‚ฌ์ด ์ˆซ์ž๋ฅผ ๋งž์ถฐ๋ณด์„ธ์š”!</h1>
  <input type="number" id="guess">
  <button onclick="checkGuess()">ํ™•์ธ</button>
  <p id="result"></p>
  <script src="script.js"></script>
</body>
</html>
  • script.js

javascript
const answer = Math.floor(Math.random() * 100) + 1;
function checkGuess() {
  const guess = parseInt(document.getElementById("guess").value);
  const result = document.getElementById("result");
  if (guess === answer) result.textContent = "์ •๋‹ต!";
  else if (guess < answer) result.textContent = "๋„ˆ๋ฌด ์ž‘์•„์š”!";
  else result.textContent = "๋„ˆ๋ฌด ์ปค์š”!";
}

4. ๐Ÿ“Š ๋ฐ์ดํ„ฐ ์‹œ๊ฐํ™” ๋Œ€์‹œ๋ณด๋“œ

๐Ÿ“ฆ ์ฝ”๋“œ ํ…œํ”Œ๋ฆฟ

  • index.html

html
<!DOCTYPE html>
<html>
<head>
  <title>๋ฐ์ดํ„ฐ ์‹œ๊ฐํ™”</title>
  <script src="https://cdn.jsdelivr.net/npm/chart.js"></script>
</head>
<body>
  <canvas id="myChart" width="400" height="200"></canvas>
  <script src="script.js"></script>
</body>
</html>
  • script.js

javascript
const ctx = document.getElementById('myChart').getContext('2d');
new Chart(ctx, {
  type: 'bar',
  data: {
    labels: ['A', 'B', 'C'],
    datasets: [{
      label: '์ ์ˆ˜',
      data: [12, 19, 3],
      backgroundColor: ['red', 'blue', 'green']
    }]
  }
});

5. ๐Ÿ’ฌ ์‹ค์‹œ๊ฐ„ ์ฑ„ํŒ…์•ฑ (Firebase)

๐Ÿ“ฆ ์ฝ”๋“œ ํ…œํ”Œ๋ฆฟ

  • index.html

html
<!DOCTYPE html>
<html>
<head>
  <title>์ฑ„ํŒ…์•ฑ</title>
  <script src="https://www.gstatic.com/firebasejs/9.6.1/firebase-app.js"></script>
  <script src="https://www.gstatic.com/firebasejs/9.6.1/firebase-database.js"></script>
</head>
<body>
  <input id="message" placeholder="๋ฉ”์‹œ์ง€ ์ž…๋ ฅ">
  <button onclick="sendMessage()">์ „์†ก</button>
  <ul id="chat"></ul>
  <script src="script.js"></script>
</body>
</html>
  • script.js

javascript
const firebaseConfig = {
  apiKey: "YOUR_API_KEY",
  databaseURL: "YOUR_DATABASE_URL"
};
firebase.initializeApp(firebaseConfig);
const db = firebase.database();

function sendMessage() {
  const msg = document.getElementById("message").value;
  db.ref("chat").push().set({ text: msg });
}

db.ref("chat").on("child_added", snapshot => {
  const li = document.createElement("li");
  li.textContent = snapshot.val().text;
  document.getElementById("chat").appendChild(li);
});

๐Ÿš€ GitHub Pages ๋ฐฐํฌ ๋ฐฉ๋ฒ•

๐Ÿ“ฆ ์‹คํ–‰ ์ ˆ์ฐจ ๋ฐ•์Šค

  1. GitHub์— ์ƒˆ ์ €์žฅ์†Œ ์ƒ์„ฑ (์˜ˆ: my-portfolio)

  2. ๋กœ์ปฌ์—์„œ ํ”„๋กœ์ ํŠธ ํด๋”๋ฅผ Git์œผ๋กœ ์ดˆ๊ธฐํ™”

    bash
    git init
    git remote add origin https://github.com/USERNAME/my-portfolio.git
    git add .
    git commit -m "Initial commit"
    git push -u origin main
    
  3. GitHub ์ €์žฅ์†Œ → Settings → Pages ๋ฉ”๋‰ด ํด๋ฆญ

  4. Source: main branch ์„ ํƒ → /root

  5. ์ €์žฅ ํ›„ ๋ฐฐํฌ ์ฃผ์†Œ ํ™•์ธ (์˜ˆ: https://USERNAME.github.io/my-portfolio/)

๐Ÿ”— ์ฐธ๊ณ : GitHub Pages ๊ณต์‹ ๋ฌธ์„œ

์ด ๋ธ”๋กœ๊ทธ์˜ ์ธ๊ธฐ ๊ฒŒ์‹œ๋ฌผ

[ํŠน๊ฐ•] 1์–ต์œผ๋กœ ์‹œ์ž‘ํ•˜๋Š” ์€ํ‡ด ์„ค๊ณ„: ํ…Œ์Šฌ๋ผ ๋‹ค์Œ์€ '์ด ์ฃผ์‹'์— ๋ฌป์–ด๋‘ฌ๋ผ

[01/02] ์˜ค๋Š˜์˜ ์›”๊ฐ€ ํˆฌ์ž ๋ธŒ๋ฆฌํ•‘ ์š”์•ฝ: [co]

๐Ÿš€ 2026๋…„ ์—ญ๋Œ€๊ธ‰ ๊ฐ•์„ธ์žฅ ์˜จ๋‹ค! ํŠธ๋Ÿผํ”„๊ฐ€ ์„ค๊ณ„ํ•œ '๋ˆ์˜ ๊ธธ' ์„ ์  ์ „๋žต