Code Monkey home page Code Monkey logo

selecolor's Introduction

[๋„˜๋ธ” ์ฑŒ๋ฆฐ์ง€]

[React] ์ƒํƒœ๊ด€๋ฆฌ ๋ผ์ด๋ธŒ๋Ÿฌ๋ฆฌ๋ฅผ ์‚ฌ์šฉํ•˜์ง€ ์•Š๊ณ  ๋‹ค๋ฅธ ์ƒ‰๊น” ์ฐพ๊ธฐ ๊ฒŒ์ž„ ์ œ์ž‘

Selecolor

logo

Components

Layout.tsx

_app.tsx ํŽ˜์ด์ง€์—์„œ ํ˜ธ์ถœํ•ด์„œ ์‚ฌ์šฉํ•˜๋ฉฐ ๋ชจ๋“  ํŽ˜์ด์ง€๋ฅผ ๊ฐ์‹ธ๋Š” layout ์ปดํฌ๋„ŒํŠธ์ด๋‹ค. ๋ชจ๋“  ํŽ˜์ด์ง€์— ์ ์šฉํ•˜๊ณ  ์‹ถ์€ PageLink.tsx์™€ ๊ฐ™์€ ์ปดํฌ๋„ŒํŠธ๊ฐ€ ๋“ค์–ด๊ฐ€๊ธฐ ์ ์ ˆํ•œ ์ปดํฌ๋„ŒํŠธ์ด๋‹ค.

PageLink.tsx

๊นƒํ—ˆ๋ธŒ๋กœ ์ด๋™ํ•˜๋Š” Link๊ฐ€ ์žˆ๋Š” ์ปดํฌ๋„ŒํŠธ. ์ถ”ํ›„ ๋‹ค๋ฅธ ํŽ˜์ด์ง€๋„ ์—ฐ๊ฒฐ ๊ฐ€๋Šฅ.

Seo.tsx

SEO ์ตœ์ ํ™”๋ฅผ ์œ„ํ•ด ์‹ค์ œ html์˜ head์— ๋“ค์–ด๊ฐˆ ๋‚ด์šฉ์„ next/Head๋ฅผ ์‚ฌ์šฉํ•ด page ๊ฐ€์žฅ ์ƒ๋‹จ์— ๋“ค์–ด๊ฐˆ ์ปดํฌ๋„ŒํŠธ. title์„ props๋กœ ๋ฐ›์•„ ํŽ˜์ด์ง€๋งˆ๋‹ค ๋‹ค๋ฅธ <title> ์ ์šฉ ๊ฐ€๋Šฅ.

Modal.tsx

modal ์ปดํฌ๋„ŒํŠธ๋ฅผ ์—ฌ๋Ÿฌ๊ฐœ ๋งŒ๋“ค ์ˆ˜ ์žˆ๋Š” ๋ชจ๋‹ฌ ์ปดํฌ๋„ŒํŠธ์ด๋‹ค. ๋ชจ๋‹ฌ์ฐฝ์ด ๋‚˜์˜ค๋Š” ๋ฐฑ๊ทธ๋ผ์šด๋“œ๋ฅผ ์–ด๋‘ก๊ฒŒ ์ฒ˜๋ฆฌํ•ด์ฃผ๋Š” ์šฉ๋„์ด๋‹ค.

AlertModal.tsx

์œ„ ๋ชจ๋‹ฌ ์ปดํฌ๋„ŒํŠธ๋ฅผ ์‚ฌ์šฉํ•ด ๋งŒ๋“  ์•Œ๋ฆผ ์ปดํฌ๋„ŒํŠธ์ด๋‹ค. ์‹œ๊ฐ„์ด ๋‹ค ์ง€๋‚ฌ์„๋•Œ display๋˜์–ด ๋ˆ„์  ์Šค์ฝ”์–ด์™€ ๊ฒŒ์ž„์„ ๋‹ค์‹œํ• ์ง€ ์ข…๋ฃŒํ• ์ง€๋ฅผ ํ‘œ์‹œํ•œ๋‹ค. ๋„˜๋ธ” ์กฐ๊ฑด์—๋Š” ์—†์—ˆ์ง€๋งŒ ๊ณ ๋„ํ™”ํ•ด์„œ ๋žญํฌ ๊ธฐ๋Šฅ(RankModal.tsx) ์ถ”๊ฐ€ ์ค‘์ž„.

ImgButton.tsx

AlertModal ํ˜น์€ ๋‹ค๋ฅธ ๊ณณ์— ์‚ฌ์šฉ๋˜๋Š” ์ด๋ฏธ์ง€์™€ ํ•จ๊ป˜ ์žˆ๋Š” ๋ฒ„ํŠผ ์ปดํฌ๋„ŒํŠธ์ด๋‹ค. ์ด๋ฏธ์ง€์™€ ํ…์ŠคํŠธ ๊ทธ๋ฆฌ๊ณ  ๋ฒ„ํŠผ ํด๋ฆญ ํ•ธ๋“ค๋Ÿฌ๋ฅผ props๋กœ ๋ฐ›๋Š”๋‹ค.

StageTime.tsx

game ํŽ˜์—์ง€์— stage์™€ time์ด ํ‘œ์‹œํ•˜๋Š” ์ปดํฌ๋„ŒํŠธ.

BoxItem.tsx

Game์— ์‚ฌ์šฉ๋˜๋Š” ๋ฐ•์Šค ์ปดํฌ๋„ŒํŠธ์ด๋‹ค. ํ•ด๋‹น ๋ฐ•์Šค๊ฐ€ ๋ชฉํ‘œ๋กœ ํ•˜๋Š” ๋ฐ•์Šค๊ฐ€ ๋งž๋Š”์ง€ ๋‚ด๋ถ€์—์„œ ํŒ๋‹จํ•ด์„œ props๋กœ ๋‚ด๋ ค๋ฐ›์€ ๊ฒƒ๋“ค์ด ์ ์šฉ๋œ๋‹ค.

BoxContainer.tsx

์œ„์—์„œ ๋ณด์•˜๋˜ BoxItem.tsx๋ฅผ ๋ฐ˜๋ณตํ•ด์„œ ๋””์Šคํ”Œ๋ ˆ์ดํ•˜๋Š” ์ปดํฌ๋„ŒํŠธ์ด๋‹ค.

display: grid ๋ฅผ ํ†ตํ•ด ์ปดํฌ๋„ŒํŠธ๋ฅผ ์ œ์ž‘ํ–ˆ๋‹ค.

Containers

getBoxCnt.ts

๋ฐ•์Šค ๊ฐœ์ˆ˜๋ฅผ ๋ฐ˜ํ™˜ํ•˜๋Š” ํ•จ์ˆ˜

getBoxRange.ts

๋ฐ•์Šค ๊ฐœ์ˆ˜์— ๋งž๋Š” ๋ฐฐ์—ด์„ ๋ฐ˜ํ™˜ํ•˜๋Š” ํ•จ์ˆ˜

getGridCnt.ts

BoxContainer์— grid๋กœ ๋ฐ˜๋ณต๋  ์ˆ˜๋ฅผ ๋ฐ˜ํ™˜ํ•˜๋Š” ํ•จ์ˆ˜

getTargetIndex.ts

์ •๋‹ต์ด ๋  ๋ฐ•์Šค์˜ ์ธ๋ฑ์Šค๋ฅผ ๋ฐ˜ํ™˜ํ•˜๋Š” ํ•จ์ˆ˜

getColorPercent.ts

์ •๋‹ต์ด ๋  ๋ฐ•์Šค์˜ ์ƒ‰์„ ์กฐ์ •ํ•˜์—ฌ ๋ฐ˜ํ™˜ํ•˜๋Š” ํ•จ์ˆ˜

stage*0.1 ์”ฉ ๋”ํ•ด์ฃผ๋Š” ์—ฐ์‚ฐ์„ ๊ฑฐ์น˜๊ณ , 0.8 ์ด์ƒ์ด ๋  ๊ฒฝ์šฐ 0.8๋กœ ๊ณ ์ •์„ ์‹œ์ผœ์ฃผ์—ˆ๋‹ค.

getRandomColor.ts

๋žœ๋ค์œผ๋กœ ์ƒ‰์„ ๋ฐ˜ํ™˜ํ•˜๋Š” ํ•จ์ˆ˜

pages

index.tsx

แ„‰แ…ณแ„แ…ณแ„…แ…ตแ†ซแ„‰แ…ฃแ†บ 2022-02-13 แ„‹แ…ฉแ„’แ…ฎ 10 30 46

๊ฐ€์žฅ ๋จผ์ € ์‚ฌ์šฉ์ž๊ฐ€ ๋งˆ์ฃผํ•˜๊ฒŒ ๋  indexํŽ˜์ด์ง€.

Selecolor์˜ ๋กœ๊ณ ์™€ ๊ฒŒ์ž„์„ ์‹œ์ž‘ํ•  ์ˆ˜ ์žˆ๋Š” ํŽ˜์ด์ง€๋กœ์˜ ๋งํฌ ๋ฒ„ํŠผ์ด ์žˆ๋‹ค.

game.tsx

แ„‰แ…ณแ„แ…ณแ„…แ…ตแ†ซแ„‰แ…ฃแ†บ 2022-02-13 แ„‹แ…ฉแ„’แ…ฎ 10 32 07

๊ฒŒ์ž„์ด ์ด๋ฃจ์–ด์ง€๋Š” ํŽ˜์ด์ง€. ์‹œ๊ฐ„์ด ๋‹ค ์ง€๋‚˜๋ฉด AlertModal๋ฅผ ํ‘œ์‹œํ•ด Time out์„ ์•Œ๋ฆฐ๋‹ค.

แ„‰แ…ณแ„แ…ณแ„…แ…ตแ†ซแ„‰แ…ฃแ†บ 2022-02-13 แ„‹แ…ฉแ„’แ…ฎ 10 33 06

selecolor's People

Contributors

yanggak12 avatar

Stargazers

 avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.