Skip to content

🌎 Window 98을 μ°Έκ³ ν•΄μ„œ μžλ°”μŠ€ν¬λ¦½νŠΈλ‘œ μ›Ή 앱을 λ§Œλ“œλŠ” ν”„λ‘œμ νŠΈ

Notifications You must be signed in to change notification settings

YounglanHong/win98-chrome-app

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

73 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

🌍Window 98 Chrome App

ν”„λ‘œμ νŠΈ 정보

0. μ†Œκ°œ

🌎 Window 98을 μ°Έκ³ ν•΄μ„œ HTML, CSS, μžλ°”μŠ€ν¬λ¦½νŠΈλ‘œ μ›Ή μ–΄ν”Œλ¦¬μΌ€μ΄μ…˜μ„ λ§Œλ“œλŠ” ν”„λ‘œμ νŠΈμž…λ‹ˆλ‹€.

πŸ”— 배포 링크: win98 chrome app

Win 98

1. μ‹€ν–‰ 방법

  • CORS μ—λŸ¬λ₯Ό λ°©μ§€ν•˜κΈ° μœ„ν•΄ live-serverλ₯Ό ν™œμš©ν•˜μ—¬ μ‹€ν–‰ν•©λ‹ˆλ‹€.

Open index.html with Live Server

2. 파일 ꡬ쑰

β”œβ”€β”€ src/
	 β”œβ”€β”€ components/          - μ»΄ν¬λ„ŒνŠΈ 파일
			β”œβ”€β”€ Startup.js
			β”œβ”€β”€ Todo.js
			β”œβ”€β”€ TextEditor.js
	 β”œβ”€β”€ App.js               - μ»΄ν¬λ„ŒνŠΈ μ •μ˜
	 β”œβ”€β”€ Component.js         - μ»΄ν¬λ„ŒνŠΈ κ΅¬ν˜„
   β”œβ”€β”€ index.js             - entry point
β”œβ”€β”€ style/                  - css 파일
β”œβ”€β”€ index.html

* eslint, prettier μ„€μ • 파일

3. μ£Όμš” κΈ°λŠ₯

Todo App

Win 98 Todo

  • 할일 μΆ”κ°€/ μ‚­μ œ

Text Editor

Win 98 TextEditor

  • ν…μŠ€νŠΈ μž…λ ₯/ μ‚­μ œ
  • ν…μŠ€νŠΈ 크기, μŠ€νƒ€μΌ, 폰트, μœ„μΉ˜ μ‘°μ •

Painting App(μ§„ν–‰ 쀑)

  • μΊ”λ²„μŠ€ μ„ , λ„ν˜• 그리기/ μ§€μš°κΈ°
  • μ„  색깔 λ³€κ²½

κΈ°μ‘΄ μ½”λ“œμ˜ 문제점 κ°œμ„ 

1. HTML μ½”λ“œκ°€ 반볡되고 및 λ¬΄κ±°μ›Œμ§€λŠ” 문제

  • 반볡 μž‘μ—…μ„ map을 톡해 λ Œλ”λ§ν•©λ‹ˆλ‹€.

    <!-- 같은 ꡬ쑰 반볡 -->
    <div class="icon-group">
      <!-- ... -->
      <div id="todo" class="icon todo" tabindex="0">
        <strong>ToDo List</strong>
      </div>
      <div id="editor" class="icon editor" tabindex="0">
        <strong>Text Editor</strong>
      </div>
      <div id="paint" class="icon paint" tabindex="0">
        <strong>Paint</strong>
      </div>
    </div>
    
    <!-- λ¦¬νŒ©ν† λ§  -->
    <!-- App.js -->
    const { data } = this.state; return `
    <div class="icon-group">
      ${data.map((list, key) => `
      <div class="icon">
        <strong class="icon-name">${list.icon}</strong>
      </div>
      ` ).join("")}
    </div>
    `

2. <script> 둜 κ°€μ Έμ˜€λŠ” μ™ΈλΆ€ μžλ°”μŠ€ν¬λ¦½νŠΈ 파일 증가

  • script νƒ€μž…μ„ module둜 μ„€μ •ν•΄μ„œ λͺ¨λ“ˆλ ˆλ²¨ μŠ€μ½”ν”„λ₯Ό λ§Œλ“­λ‹ˆλ‹€.

    <body>
      <!-- ... -->
      <script src="./index.js"></script>
      <script src="./script/clock.js"></script>
      <script src="./script/modal.js"></script>
      <script src="./script/todo.js"></script>
      <script src="./script/texteditor.js"></script>
      <script src="./script/paint.js"></script>
      <script src="./script/paint-tools.js"></script>
    </body>
    
    <!-- λ¦¬νŒ©ν† λ§  -->
    <!-- index.html -->
    
    <body>
      <div id="root"></div>
      <script src="./src/index.js" type="module"></script>
    </body>
  • μžλ°”μŠ€ν¬λ¦½νŠΈ νŒŒμΌμ„ μ»΄ν¬λ„ŒνŠΈ ꡬ쑰둜 λ¦¬νŒ©ν† λ§ ν–ˆμŠ΅λ‹ˆλ‹€.

    // Component.js
    export default class Component {
      constructor(target) {
        this.target = target; // event target
        this.initailize();
        this.setEvent();
        this.render();
      }
    
      // μ΄ˆκΈ°ν™”
      initailize() {}
    
      // λ·°(λ§ˆν¬μ—…)
      template() {
        return "";
      }
    
      // λ Œλ”λ§
      render() {
        this.target.innerHTML += this.template();
        this.setEvent();
      }
    
      // 이벀트 ν•¨μˆ˜
      setEvent() {}
    
      // μƒνƒœ μ—…λ°μ΄νŠΈ
      setState(newState) {
        this.state = { ...this.state, ...newState };
        this.render();
      }
    }
  • ES6의 class λ¬Έλ²•μœΌλ‘œ μž‘μ„±ν•΄μ„œ μ»΄ν¬λ„ŒνŠΈ μ½”λ“œμ˜ μ‚¬μš©λ²•μ„ νŒ¨ν„΄ν™”ν•©λ‹ˆλ‹€.

    // App.js μ˜ˆμ‹œ
    import Todo from "./components/Todo.js";
    import TextEditor from "./components/TextEditor.js";
    
    class App {
      constructor() {
        const app = document.querySelector("#root");
    
        new Todo(app);
        new TextEditor(app);
      }
    }
    
    new App();

레퍼런슀

98.css

About

🌎 Window 98을 μ°Έκ³ ν•΄μ„œ μžλ°”μŠ€ν¬λ¦½νŠΈλ‘œ μ›Ή 앱을 λ§Œλ“œλŠ” ν”„λ‘œμ νŠΈ

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published