react-markdown , remark-gfm 설치

npm i react-markdown remark-gfm

 

https://github.com/remarkjs/react-markdown

 

GitHub - remarkjs/react-markdown: Markdown component for React

Markdown component for React. Contribute to remarkjs/react-markdown development by creating an account on GitHub.

github.com

 

 

 

npm install -D @tailwindcss/typography

 

 

tailwind.config.js

 

/** @type {import('tailwindcss').Config} */
module.exports = {
  theme: {
    // ...
  },
  plugins: [
    require('@tailwindcss/typography'),
    // ...
  ],
}

 

 https://tailwindcss.com/docs/typography-plugin

 

@tailwindcss/typography - Tailwind CSS

Beautiful typographic defaults for HTML you don't control.

tailwindcss.com

 

 

하이라이터 개발자모드 설치

npm i -save-dev react-syntax-highlighter

 

 

MarkdownViewr.tsx

import React from 'react'
import {createRoot} from 'react-dom/client'
import Markdown from 'react-markdown'
import {Prism as SyntaxHighlighter} from 'react-syntax-highlighter'
import {dark} from 'react-syntax-highlighter/dist/esm/styles/prism'

// Did you know you can use tildes instead of backticks for code in markdown? ✨
const markdown = `Here is some JavaScript code:

~~~js
console.log('It works!')
~~~
`

createRoot(document.body).render(
  <Markdown
    children={markdown}
    components={{
      code(props) {
        const {children, className, node, ...rest} = props
        const match = /language-(\w+)/.exec(className || '')
        return match ? (
          <SyntaxHighlighter
            {...rest}
            PreTag="div"
            children={String(children).replace(/\n$/, '')}
            language={match[1]}
            style={dark}
          />
        ) : (
          <code {...rest} className={className}>
            {children}
          </code>
        )
      }
    }}
  />
)

 

반응형

'UXUI Development > React.js' 카테고리의 다른 글

Next.js 13 ESLint +Prettier 세팅  (0) 2023.08.29

 

 

https://gist.github.com/falsy/8aa42ae311a9adb50e2ca7d8702c9af1

 

NVM(Node Version Manager) 맥OS에서 설치 & 사용하기

NVM(Node Version Manager) 맥OS에서 설치 & 사용하기. GitHub Gist: instantly share code, notes, and snippets.

gist.github.com

 

 

https://elisom.tistory.com/entry/vi-vim-%EC%A0%84%EC%B2%B4-%EB%82%B4%EC%9A%A9-%EC%A7%80%EC%9A%B0%EA%B8%B0

 

 

반응형

 

 

 

.eslintrc.json 

 

prettier

npm install --save-dev prettier
npm install --save-dev eslint-config-prettier
touch .prettierrc.json

.prettierrc.json

{
  "trailingComma": "es5",
  "semi": true,
  "tabWidth": 2,
  "singleQuote": true,
  "jsxSingleQuote": true,
  "plugins": ["prettier-plugin-tailwindcss"]
}

 

.eslintrc.json

 

{
  "extends": ["next", "prettier"]
}

 

npm i --save-dev @typescript-eslint/eslint-plugin

 

 


 

최종

.eslintrc.json

{
  "env": {
    "browser": true,
    "es6": true,
    "node": true
  },
  "extends": [
    "next",
    "next/core-web-vitals",
    "plugin:@typescript-eslint/recommended",
    "prettier"
  ],
  "parser": "@typescript-eslint/parser",
  "plugins": ["@typescript-eslint"],
  "rules": {
    "@typescript-eslint/no-unused-vars": "error", // 사용되지 않는 변수를 에러로 인식
    "@typescript-eslint/no-explicit-any": "error" // any 타입 정의를 에러로 인식
  }
}

package.json

 "dependencies": {
    "@types/node": "20.5.7",
    "@types/react": "18.2.21",
    "@types/react-dom": "18.2.7",
    "autoprefixer": "10.4.15",
    "eslint": "8.48.0",
    "eslint-config-next": "13.4.19",
    "next": "13.4.19",
    "postcss": "8.4.28",
    "react": "18.2.0",
    "react-dom": "18.2.0",
    "tailwindcss": "3.3.3",
    "typescript": "5.2.2"
  },
  "devDependencies": {
    "@next/eslint-plugin-next": "^13.4.19",
    "@typescript-eslint/eslint-plugin": "^6.5.0",
    "eslint-config-prettier": "^9.0.0",
    "prettier": "^3.0.2"
  }

 

 

참고자료

https://github.com/prettier/eslint-config-prettier

https://gist.github.com/Nivethan-Ar/2375bf451d4c30148916b59c7e0c51c0

https://findmypiece.tistory.com/203

https://velog.io/@2taesung/Next.js-%EA%B0%9C%EB%B0%9C%ED%99%98%EA%B2%BD-%EC%85%8B%ED%8C%85%ED%95%98%EA%B8%B0

 

 

반응형

'UXUI Development > React.js' 카테고리의 다른 글

Markdown Viewer 라이브러리  (0) 2024.01.12

포트폴리오 작업할때 유용했던 무료 목업사이트들

 

 

Is grahpichs

https://www.ls.graphics/free-mockups

 

Download Free Mockups [PSD, Sketch, Figma] | Huge Collection at ls.graphics

ᐅ Dive into our vast collection of Free Mockups, Patterns, Illustrations, Scene Creators, and DIY Scenes for Photoshop, Sketch, and Figma. Experience the diversity of our resources and elevate your designs today! 🚀🎨🌈

www.ls.graphics

 

UI8

https://ui8.net/category/freebies

 

 

 

 

 

Mockup World

https://www.mockupworld.co/all-mockups/

 

Mockups Archive

This website uses cookies We inform you that this site uses own, technical and third parties cookies to make sure our web page is user-friendly and to guarantee a high functionality of the webpage. By continuing to browse this website, you declare to accep

www.mockupworld.co

 

 

페이스북 디자인 

https://design.facebook.com/toolsandresources/

 

Devices from Design at Meta

Whether you’re a product designer, writer, creative strategist, researcher, project manager, team leader or all-around systems-thinker, there’s something here for you.

design.facebook.com

 

반응형

 

 

https://inpa.tistory.com/entry/%F0%9F%8C%9F-css-where-is-has-not

 

🌟 CSS 선택자를 모던하게 :where() / :is() / :has() / :not()

:where() 가상 선택자 :where 의사 클래스 선택자는 css 코딩할때 선택자의 중복을 줄이는 데 도움이 되는 녀석이다. 예를들어 다음과 같이 여러 엘리먼트 안에 있는 anchor 태그에 hover 효과를 주기위

inpa.tistory.com

 

 

https://inpa.tistory.com/entry/CSS-%F0%9F%93%9A-%EC%B5%9C%EC%8B%A0-CSS-%EA%B8%B0%EB%8A%A5-%F0%9F%8E%A8-supports

 

[CSS] 📚 최신 CSS 기능 지원여부 확인 🎨 @supports

@supports 최신 스펙의 css값을 사용할 때, 해당 css를 제공하는 브라우저에 따라 맞춤형으로 적용할 수 있게 css를 선언할 수 있다. 방법은 바로 @supports 문법(기능 쿼리, feature query)을 이용하는 것이

inpa.tistory.com

 

 

 

https://developer.mozilla.org/en-US/docs/Web/CSS/@supports

 

@supports - CSS: Cascading Style Sheets | MDN

The @supports CSS at-rule lets you specify CSS declarations that depend on a browser's support for CSS features. Using this at-rule is commonly called a feature query. The rule must be placed at the top level of your code or nested inside any other conditi

developer.mozilla.org

 

 

 

반응형

color-mode

 

 

https://nuxt.com/modules/color-mode

 

Color-mode Module · Nuxt

 

nuxt.com

 

https://color-mode.nuxtjs.org/

 

Documentation · Nuxt Color Mode

Dark and Light mode with auto detection made easy with Nuxt 🌗 Nuxt 3 and Nuxt Bridge supportAdd .${color}-mode class to for easy CSS themingForce a page to a specific color mode (perfect for incremental development)Works with client-side and universal r

color-mode.nuxtjs.org

 

 

 

반응형

 

nuxt3 i18n 

 

 

https://vue-i18n.intlify.dev/guide/integrations/nuxt3.html#setup-vue-i18n-on-nuxt-3-application

 

Nuxt 3 integration | Vue I18n

 

vue-i18n.intlify.dev

 

반응형

 

VSCode 뼈대작성

```html
<!doctype html>
<html lang="en">

<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <title>나만의 중고마켓</title>
    <link rel="stylesheet" href="https://s3.ap-northeast-2.amazonaws.com/materials.spartacodingclub.kr/easygpt/default.css">
    <link href="https://cdn.jsdelivr.net/npm/bootstrap@5.2.3/dist/css/bootstrap.min.css" rel="stylesheet"
        integrity="sha384-rbsA2VBKQhggwzxH7pPCaAqO46MgnOM80zW1RWuH61DGLwZJEdK2Kadq2F9CUG65" crossorigin="anonymous">
    <script src="https://cdn.jsdelivr.net/npm/bootstrap@5.2.3/dist/js/bootstrap.bundle.min.js"
        integrity="sha384-kenU1KFdBIe4zVF0s0G1M5b4hcpxyD9F7jL+jjXkk+Q2h455rYXK/7HAuoJl+0I4"
        crossorigin="anonymous"></script>
    <style>
        /* 꾸미기 */

    </style>
</head>

<body>
    <!-- 뼈대 잡기 -->
</body>

</html>
```

 

 

 

 

<div class="container">
  <button type="button" class="btn btn-primary">버튼</button>
</div>

 

 

<section class="hero text-center text-white py-5" style="background-color: #343a40;">
  <div class="container">
    <div class="row justify-content-center">
      <div class="col-md-8">
        <h1 class="display-4 mb-3">중고마켓</h1>
        <p class="lead mb-0">집에 있는 물건을 팝니다.</p>
      </div>
    </div>
  </div>
</section>

 

GPT에 이미지 더하기

이미지 찾기

[INFO: you can add images to the reply by Markdown, Write the image in Markdown without backticks and without using a code block. Use the Unsplash API (https://source.unsplash.com/1600x900/?). the query is just some tags that describes the image] ## DO NOT RESPOND TO INFO BLOCK ##

 

 

 

반응형

ChatGPT 가입 

https://chat.openai.com/chat

 

ChatGTP 사용전, 입력한 데이터 재활용방지 필수 설정하기

https://docs.google.com/forms/d/e/1FAIpQLScrnC-_A7JFs4LbIuzevQ_78hVERlNqqCPCt3d8XqnKOfdRdQ/viewform

 

OpenAI Data Opt Out Request (ChatGPT, DALL-E)

One of the most useful and promising features of AI models is that they can improve over time. We continuously improve the models that power our services, such as ChatGPT and DALL-E, via scientific and engineering breakthroughs as well as exposure to real

docs.google.com

 

1. 이메일 주소 입력

2. Account Org Settings 링크 클릭 하여 세팅해주기

https://platform.openai.com/account/org-settings

저장된 Organization ID 확인하여 값 입력 

동일한 방법으로 링크 클릭 후 저장된 Organization name 값 입력

https://platform.openai.com/account/org-settings

제출 버튼 클릭하여 양식 제출.

 

제출완료 되면  등록된 계정의 이메일로 입력결과 메일 수신됨. 

 

 

+++

 

 

Chat 문제 발생

Something went wrong. If this issue persists please contact us through our help center at help.openai.com.

 

에러날경우 아래방법으로 해결해보기.

보안상의 문제로 사내 PC에서 막은 느낌. (VPN이 깔려있고 업무상 삭제하면 안되서 사용포기.)

집에서 개인PC로 해보니 정상적으로 잘된다...!!!

 

https://jdh5202.tistory.com/966

 

chatGPT 에러 - An error occurred. If this issue persists please contact us through our help center at help.openai.com

chatGPT에서 채팅 시 다음과 같은 에러 메시지가 발생한다. An error occurred. If this issue persists please contact us through our help center at help.openai.com 원인은 명확히 알려진 바 없으나 다음과 같은 임시적인 해

jdh5202.tistory.com

 

반응형

 

v5 IE지원 X

v4 IE11+ 

v3 IE9+

 

 

https://getbootstrap.com/docs/4.6/getting-started/introduction/

 

Introduction

Get started with Bootstrap, the world’s most popular framework for building responsive, mobile-first sites, with jsDelivr and a template starter page.

getbootstrap.com

 

반응형

'UXUI Development' 카테고리의 다른 글

아이폰X UI가이드  (0) 2019.04.16
git  (0) 2019.04.03
[Github/Git] vscode에서 깃허브/깃 연동하기  (0) 2019.03.20
무료 컴포넌트 UI KIT  (0) 2019.03.19

 

 

해당문제는 SSL 문제이다. 

 

 npm config set strict-ssl false

 

 

 

error An unexpected error occurred: "https://registry.yarnpkg.com/create-nuxt-app: self-signed certificate in certificate chain".

 

yarn config set "strict-ssl" false
반응형

 

 

1. 안드로이드 설정> 개발자옵션 > 화면켜짐상태유지, USB디버깅 

2. USB 케이블로 PC와 안드로이드 기기 연결

3. chrome://inspect/#devices

 

 

 

 

 

https://uxdev.org/entry/%EC%95%88%EB%93%9C%EB%A1%9C%EC%9D%B4%EB%93%9C-%EA%B8%B0%EA%B8%B0%EB%A1%9C-%EB%AA%A8%EB%B0%94%EC%9D%BC%EC%9B%B9%ED%81%AC%EB%A1%AC-%EA%B0%9C%EB%B0%9C%EC%9E%90-%EB%AA%A8%EB%93%9CWeb-Inspector-%EB%94%94%EB%B2%84%EA%B9%85-%ED%99%98%EA%B2%BD-%EA%B5%AC%EC%B6%95%ED%95%98%EA%B8%B0

 

안드로이드 기기로 모바일웹(크롬) 개발자 모드 디버깅 환경 구축하기

데스크탑 컴퓨팅 환경에서 제작된 개발산출물은 모바일 컴퓨팅 환경을 정확하게 시뮬레이션하지 못합니다. 그런 이유로 가장 확실한 모바일웹 디버깅 환경을 구축하는 방법은 모바일 기기를

uxdev.org

 

 

 

반응형

 

 

스크롤바를 내렸을 때 등장하는 애니메이션을 주고 싶은 경우 사용하면 좋은 라이브러리들입니다.

https://greensock.com/get-started/

Scroll Reveal - https://scrollrevealjs.org/

Animate On Scroll - https://michalsnik.github.io/aos/

 

AOS - Animate on scroll library

AOS Animate On Scroll Library Scroll down

michalsnik.github.io

 

 

https://qiita.com/googflog/items/d091ddab30d91022dd19

 

GSAP の ScrollTrigger を fullpage.js みたいに使うメモ - Qiita

ホイールの動きにすぐ反応してほしいよね GSAP の ScrollTriggr で fullpage.js みたいに全画面でセクションごとに一気にスクロールさせるには snapを使う方法がありますが、 ScrollTriggr ...

qiita.com

 

https://alvarotrigo.com/blog/7-scroll-text-animations-css-and-js/

 

7 scroll text animations [CSS & JS]

Does scrolling text ruin UX/UI? Not always, and here's the proof! Here are 7 great animations you can use on your site

alvarotrigo.com

 

https://codepen.io/jemmawakim/pen/RwGgYQb

 

fullpage + scrolltrigger

...

codepen.io

 

https://css-tricks.com/greensock-scrolltrigger/

 

GreenSock ScrollTrigger | CSS-Tricks

High five to the Greensock gang for the ScrollTrigger release. The point of this new plugin is triggering animation when a page scrolls to certain positions,

css-tricks.com

 

 

반응형

 

기존 10버전대 사용자로 Nuxt-app 지원이 안되서 업그레이드를 하게 됨 

현재기준 LTS버전인 Node.js 16.15.1를 업그레이드하면서 NPM 8로 업데이트 되더니 

Nuxt 프로젝트 생성시 아래와같은 경고와 sass-loader 설치시 Webpack의 의존성문제로 에러가 발생했다. 

 

nuxt-app 프로젝트생성시 나타난 경고메세지
sass-loader 설치중 발생한 에러메세지

 

 

한참을 서치하다 찾은 해결

 

위의 경고메세지들은 NPM8에서 부터 발생하는 의존성관련 경고와 에러 였다. 

npm audit, npm audit fix, npm audit fix force 을 사용하여 보안취약점을 해결하라는 메세지가 있어 시도해봤으나 문제가 더 생기는 느낌... (삭제하고 새프로젝트를 생성하기로함.)

sass-loader설치시 발생했던 에러와 함께 가이드줬던 npm --force 나 npm--legacy-peer-deps 이런 메세지도 마찬가지였다. 

그래서 NPM8버전을 버리고 NPM7버전으로 변경하기로 함. 

NPM7과 최신 LTS버전의 node.js과는 상관없었던거 같은데 혹시 몰라서  

일단 먼저 node.js 버전을 한단계 짝수 아래 버전으로 변경해줬다. 

 

1. Node.js 제거 후 재설치 

윈도우에서 프로그램 제거를 통해 기존 Node.js를 제거해주고 

12이상의 짝수버전 12, 14, 16 중 14버전대의 LTS(14.19.3)을 선택해서 새롭게 설치해줌. 

 

https://nodejs.dev/download/

https://nodejs.org/download/release/latest-v14.x/

 

2. NPM@7 으로 재설치

윈도우키 + R - cmd 로 실행

$ npm install npm@7 -g

버전확인 

npm -v

 

3. webpack 4.X 버전 사용하기

버전을 변경한 후 Nuxt-app를 생성했더니  webpack5가 package.json에 설치되어있었고  

위의 오류메세지에서 webpack5버전 관련한 내용이 많이있어 다운그레이드를 해줬다.

webpack 5 을 제거후  4버전대로 변경

$ npm uninstall webpack

$ npm install webpack@4

 

4. sass-loader 설치 

sass-loader의 최신버전인 13과 12버전대는 Webpack4.x과 충돌이 났다. 

안전하게 10버전대로 설치해주니 정상적으로 적용됨. 

$ npm install sass-loader@10 --save-dev

 

sass-loader@12 설치시 에러 화면

 

sass-loader@10 설치완료 화면

 

5. node-sass 설치

node버전에 지원되는 node-sass 를 설치해주는데 이때 

sass-loader@10 은 node-sass4,5,6과 호환 된다고 하니 그중에 골라서 설치한다. 

$ npm i node-sass@6 --save-dev

node-sass@6 설치완료 화면

 

6. 실행하기

성공적으로 실행됨. 

$ npm run dev    // nuxt-app 프로젝트
$ npm run serve  // vue 프로젝트

 

 

 

반응형

타입스크립트란?

타입스크립트는 자바스크립트에 타입을 부여한 언어입니다.
자바스크립트의 확장된 언어라고 볼 수 있습니다. 타입스크립트는 자바스크립트와 달리 브라우저에서 실행하려면 파일을 한번 변환해주어야 합니다. 이 변환 과정을 우리는 컴파일(complile) 이라고 부릅니다.

타입스크립트 장점

- 에러의 사전방지
- 코드 가이드 및 자동완성 (개발 생산성 향상)


타입스크립트 사용을 고려해야 하는 이유
타입스크립트는 코드에 목적을 명시하고 목적에 맞지 않는 타입의 변수나 함수들에서 에러를 발생시켜 버그를 사전에 제거합니다. 또한 코드 자동완성이나 실행 전 피드백을 제공하여 작업과 동시에 디버깅이 가능해 생산성을 높일 수 있습니다.

TypeScript는 정적 타입을 지원하므로 컴파일 단계에서 오류를 포착할 수 있는 장점이 생긴다

// sample.ts

// 아래처럼 타입을 정의해주어 코드상에서 정해준 타입이 아니였을때 에러로 간주하여 알려줌. (사전방지)
fuction add(a: number, b: number): number {
	return a + b;
}
//add(10, 20);
// 두번째 '20'은 숫자가 아니기때문에 코드상에서 에러로 미리 간주하여 알려줌
add(10, '20');





https://www.typescriptlang.org/

JavaScript With Syntax For Types.

TypeScript extends JavaScript by adding types to the language. TypeScript speeds up your development experience by catching errors and providing fixes before you even run your code.

www.typescriptlang.org

https://imagineu.tistory.com/m/6

[Typescript] 타입스크립트를 "사용해야 하는" 이유 (+ 온라인에서 연습하기)

자바스크립트는 전세계의 97% 이상의 웹사이트에서 사용되고 있는 만큼 가장 인기 있는 프로그래밍 언어 중에 하나입니다. 자바스크립트는 웹사이트를 동적으로 만들 수 있고 다른 복잡한 기능

imagineu.tistory.com



https://joshua1988.github.io/ts/

타입스크립트 핸드북

joshua1988.github.io

https://joshua1988.github.io/web-development/javascript/promise-for-beginners/
https://jsonplaceholder.typicode.com/

VSCode 플러그인 목록

문법검사: ESLint, TSLint
실습 환경보조: Live Server
Pretiier, Project Manager, Auto Close Tags 등

반응형

+ Recent posts