묻고 답해요
161만명의 커뮤니티!! 함께 토론해봐요.
인프런 TOP Writers
-
미해결HTML/CSS 베이스캠프
head와 body 질문
<head>여기에 코드 넣어도 되나요? <body></body></head>
-
미해결인터랙티브 웹 개발 제대로 시작하기
왼쪽/오른쪽 동작시 딜레이 문제
소스를 그대로 사용하는것이 아니고 한단계, 한단계 만들어가면서 하고 있는데요.팔, 다리, 몸통, 머리 소스 부분부분씩 진도나갈때마다 복붙하면서 진행하고 있습니다. 다 잘 진행되는데, 키보드 왼쪽/오른쪽 이동시, 잘 이동됩니다.근데 누르자마자 이동하는게 아니라, 1~1.5초 가량 딜레이(아무동작안함)후에 뒤늦게 동작하더라고요.어느 부분을 살펴보면 좋을지요!!
-
미해결GSAP의 ScrollTrigger를 활용한 포트폴리오 제작
섹션8 질문
안녕하세요. 선생님섹션 8 강의: con02영역_인터렉티브 모션 : Gsap ScrollTrigger를 활용한 워크리스트제작에서 'My Work' 텍스트를 스크롤할 때 고정시키고 아래 .workList 영역에게 margin-top을 줘서 자연스럽게 스크롤 되도록 설정해주셨는데,스크롤 밑으로 내릴 때는 자연스러워보여도 스크롤을 위로 다시 올릴 때 'My Work' 애니메이션이 위영역과 겹친다거나, 부자연스러운데... 이부분은 어떻게 해결해야 되나요? 그리고 타이틀영역을 positon: sticky로 적용하는 방법은 없을까요?
-
미해결처음 만난 리액트(React)
안녕하세요 미니블로그 실습 질문드립니다.
실습을 잘 따라하여 코드도 모두 동일합니다.그런데 왜 글 작성하기 버튼 클릭이 안되는지 오류도 없어서 문의드립니다.또한 버튼 간격도 코드가 동일한데 떨어지지 않고 제 것은 붙어있습니다.어떻게 해결해야할 지 모르겠네요 ㅎㅎ
-
해결됨React, Node.js, MongoDB로 만드는 나만의 회사 웹사이트: 완벽 가이드
로그아웃 시 토큰 검증 오류 응답
현재 Ch4-6. 관리자 계정 로그아웃, 삭제 강의를 듣고 있는 학생입니다! 다름이 아니라 로그아웃 코드에서 토큰 검증 오류 시에 res.send()를 안하는 이유가 있나요?!토큰 검증 중 오류가 발생하게 된다면, isLoggedIn 상태는 true이고 토큰은 지워진 상태가 되는건데 그러면 로그인도 못하고 로그아웃도 못하는 상태인거 같아서요!궁금해서 여쭤봅니다!!
-
미해결HTML/CSS 베이스캠프
h1질문
<h1>~<h6> 사용할 때 글자 크기 외에는 다른 게 없는 것 같은데 어째서 순서대로 사용해야 하나요?<html></html>으로 끊고 나면 다시 !엔터 눌러서 작업을 이어가나요? <html>은 무슨 기준으로 새로 만들거나 닫나요? 두번째 <html></html>은 첫번째와 뭔가 다른가요?
-
해결됨아직도 살아 있는 불사의 jQuery - 기초 부터 실무까지
실무에서 탭스 구현 시 어떤 방법을 많이 사용하는지 궁금합니다.
안녕하세요 강사님 탭스를 구현하기 위해 3가지 방법을 알려주셨는데 그러면 실무에서는 JQuery-UI를 사용하여 구현을 하는걸까요??그리고 지금 보니까 해당 강의 섹션 제목에 오타가 있는 것 같습니다. jQuery 가 아닌 Jqeury 로 되어있네요
-
미해결핵심만 골라배우는 CSS3
섹션18 햄버거 애니메이션 영상이 재생되지 않습니다.
안녕하세요 강의 잘 보고 있습니다. 섹션 18 여행 블로그 - 햄버거 애니메이션 영상이 인코딩 중인 영상이에요. 문구가 뜨고 재생이 되질 않습니다. 확인 부탁 드리겠습니다.
-
미해결[2025년 출제기준] 웹디자인기능사 실기시험 완벽 가이드
A2 작업하는데 공지사항 내용이 아래로 내려가지 않습니다.
이렇게 가로로 배치되어집니다. 뭐가 문제인걸까요 ㅠㅠ + 애초에 이렇게 공지사항 내용이 적힌 a 메뉴를 하나만 더 적어도 이렇게 가려집니다... ㅠㅠ심지어 저 상황은 지금 갤러리 css까지 다 지웠는데도 이럽니다.... ㅠㅠㅠ <!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <link rel="stylesheet" href="css/stylesheet.css"> <title>A2</title> </head> <body> <div class="container"> <header> <div class="header-logo"> <a href="#"> <img src="img/headerlogo.png" alt="header-logo"> </a> </div> <div class="navi"> <ul class="menu"> <li> <a href="#">재단소개</a> <div class="sub-menu"> <a href="#">설립취지</a> <a href="#">연혁</a> <a href="#">찾아오시는 길</a> </div> </li> <li> <a href="#">후원하기</a> <div class="sub-menu"> <a href="#">국내후원</a> <a href="#">국외후원</a> <a href="#">맞춤후원</a> </div> </li> <li> <a href="#">자료실</a> <div class="sub-menu"> <a href="#">서식자료실</a> <a href="#">사진자료실</a> <a href="#">후원양식</a> </div> </li> <li> <a href="#">스토리</a> <div class="sub-menu"> <a href="#">웹진</a> <a href="#">보고서</a> <a href="#">나의 후원</a> </div> </li> </ul> <div class="sub-back"> <!-- 슬라이드 부분을 가려야 하므로 따로 생성하기 (어차피 이 내비게이션 어려운거 맞음) 주의사항: ul 밑에 넣어야함!!! 형제 요소로 넣어!! --> </div> </div> </header> <div class="slide"> <div class="slide-items"> <a class="slide-item" href="#"> <img src="img/slide1.png" alt="slide1"> </a> <a class="slide-item" href="#"> <img src="img/slide2.png" alt="slide2"> </a> <a class="slide-item" href="#"> <img src="img/slide3.png" alt="slide3"> </a> </div> </div> <div class="items"> <div class="notice"> <div class="tab-inner"> <div class="btn"> <span>공지사항</span> </div> </div> <div class="tab"> <a href="#">Green 복지재단 공지사항1 2020.11.23</a> <a href="#">Green 복지재단 공지사항1 2020.11.23</a> </div> </div> <div class="gallery"> <a href="#"> <img src="img/gallery1.png" alt="gallery1"> </a> <a href="#"> <img src="img/gallery2.png" alt="gallery2"> </a> <a href="#"> <img src="img/gallery3.png" alt="gallery3"> </a> </div> <div class="banner"> <a href="#"> <img src="img/banner.jpg" alt="banner"><span class="banner-text">Banner</span> </a> </div> </div> <footer> <div class="footer-logo"> <a href="#"> <img src="img/footerLogo.png" alt="footer-logo"> </a> </div> <div class="copyright"> COPYRIGHTⓒ by WEBDESIGN. ALL RIGHTS RESERVED </div> <div class="familysite"> <select> <option>패밀리사이트1</option> <option>패밀리사이트2</option> <option>패밀리사이트3</option> </select> </div> </footer> </div> <script src="js/jquery-1.12.4.js"></script> <script src="js/custom.js"></script> </body> </html>@charset "utf-8"; body{ margin: 0; font-size: 15px; background-color: #fff; color: #333333; } a{ text-decoration: none; color: #333333; } /* .container{} */ .header-inner{ /* border: 1px solid red; */ background-color: #d58c71; } header{ width: 1200px; margin: auto; height: 100px; position: relative; z-index: 10; } header>div{ /* border: 1px solid blue; */ height: 100px; } .header-logo{ width: 200px; float: left; } .navi{ width: 600px; float: right; } /* .content-inner{} */ .slide{ width: 1200px; height: 300px; position: relative; overflow: hidden; margin: auto; } .slide-items{ width: 3600px; font-size: 0; position: absolute; top: 0; left: 0; } .slide>div{ /* border: 1px solid green; */ height: 300px; } .items{ width: 1200px; margin: auto; overflow: hidden; } .items>div{ /* border: 1px solid purple; */ height: 200px; float: left; box-sizing: border-box; } .notice{ width: 500px; } .gallery{ width: 350px; } .banner{ width: 350px; } .footer-inner{ /* border: 1px solid red; */ background-color: #eee; } footer{ width: 1200px; margin: auto; overflow: hidden; } footer>div{ /* border: 1px solid purple; */ height: 100px; float: left; box-sizing: border-box; } .footer-menu{ width: 1000px; } .footer-menu div{ /* border: 1px solid palevioletred; */ height: 50px; box-sizing: border-box; } .familysite{ width: 200px; } /*모듈 이외 부분*/ .header-logo{ line-height: 130px; text-align: center; } .gallery a{ text-align: center; padding: 5px; } .gallery a img{ text-align: center; padding-top: 45px; transition: 0.1s; } .gallery a img:hover{ opacity: 50%; } .banner a img{ width: 350px; height: 200px; } .under-menu{ text-align: center; } .under-menu a{ line-height: 50px; padding: 10px; } .copyright{ text-align: center; line-height: 45px; } .familysite{ text-align: center; line-height: 90px; } .familysite select{ width: 100%; text-align: center; padding: 8px; } /*내비게이션*/ .menu{ margin-top: 59px; list-style: none; padding: 0; } .menu li{ /* border: 1px solid red; */ float: left; box-sizing: border-box; width: 25%; text-align: center; } .menu li>a{ /* border: 1px solid red; */ background-color: #a7634a; color: white; padding: 10px; display: block; transition: 0.5s; } .menu li:hover>a{ background-color: #e8a891; color: #333333; } .sub-menu{ height: 130px; display: none; } .sub-menu a{ background-color: #e8a891; padding: 10px; display: block; transition: 0.5s; } .sub-menu a:hover{ background-color: #a7634a; color: white; } .sub-back{ position: absolute; width: 100%; height: 200px; top: 100%; right: 0; background-color: #e8a891; z-index: -1; display: none; }
-
해결됨UIUX 포트폴리오 Part.3 - 반응형 웹 포트폴리오
슬라이드 문의드립니다.
안녕하세요. 위의 이미지에 질문을 넣었습니다.강의명은 UIUX 포트폴리오 Part.3 - 반응형 웹 포트폴리오 입니다.답변 부탁드립니다. 감사합니다.
-
해결됨UIUX 포트폴리오 Part.3 - 반응형 웹 포트폴리오
일러스트의 "gif 애니메이션"을 문의드립니다.
"UIUX 포트폴리오 Part.3 - 반응형 웹 포트폴리오" 강의에서"섹션2"에 있는 일러스트의 "gif 애니메이션"을 어떻게 만드셨는지 알려주실 수 있을까요?유투브, 구글, 네이버에서 관련 강의를 찾아봤는데, 못 찾았어요.만약 관련 강의를 아신다면, 알려주셔도 될 것 같습니다.답변 주세요. 감사합니다.
-
미해결HTML+CSS+JS 포트폴리오 실전 퍼블리싱(시즌1)
Bracket Pair Colorizer - 비주얼 스튜디오
이제 더 이상 기능이 지원되지 않는 것 같은데 대안이 있을까요?
-
해결됨React, Node.js, MongoDB로 만드는 나만의 회사 웹사이트: 완벽 가이드
import Hero from './Hero' 오류 문의
강의에서 말씀하신대로 자동완성을 이용하여서 './Hero' 가 되었는데, 오류가 납니다.Already included file name ~~ Root file specified for compliation 이라고 뜨는데 왜 그런건가요?Error lens에서 해당 오류를 출력합니다.
-
미해결Tailwind CSS로 만드는 멋진 웹 UI 스타일링
유틸리티 클래스 외부 링크
html안에 style에 정의된 apply 코드들은 cdn으로 링크된 tailwindcss 스크립트가 tailwindcss 스타일로 인식해 실시간으로 빌드하여 적용되지만 외부 스타일로 링크하면 일반 css로 인식해서 빌드하지 못하기 때문에 적용되지 않는다고 하네요그래서 cli로 빌드해서 적용해야 한다고 합니다
-
미해결처음 만난 리액트(React)
에러가 떠요
git에 있는 chapter 03에 있는 거 그대로 copy 하고index.js 수행 해도 아래와 같은 오류가 떠요..버전은 16이구요..어디가 잘 못 된걸까요?Cannot read properties of undefined (reading 'S') TypeError: Cannot read properties of undefined (reading 'S') at http://localhost:3001/static/js/bundle.js:19184:56 at ./node_modules/react-dom/cjs/react-dom-client.development.js (http://localhost:3001/static/js/bundle.js:20831:2) at options.factory (http://localhost:3001/static/js/bundle.js:29391:31) at __webpack_require__ (http://localhost:3001/static/js/bundle.js:28833:32) at fn (http://localhost:3001/static/js/bundle.js:29050:21) at ./node_modules/react-dom/client.js (http://localhost:3001/static/js/bundle.js:21060:20) at options.factory (http://localhost:3001/static/js/bundle.js:29391:31) at __webpack_require__ (http://localhost:3001/static/js/bundle.js:28833:32) at fn (http://localhost:3001/static/js/bundle.js:29050:21) at ./src/index.js (http://localhost:3001/static/js/bundle.js:28617:74)
-
해결됨React, Node.js, MongoDB로 만드는 나만의 회사 웹사이트: 완벽 가이드
tailwind css 설치 관련 문의
App.css 에 있는 내용 지우고, 다음인 App.jsx 수정하는 부분에서 막혔습니다. tailwind css 설치 사이트에 들어가면 다음과 같이 다른 부분이 존재하는데, 5번 부분에 있는 코드를 App.jsx에 넣으면 되는건가요?
-
해결됨React, Node.js, MongoDB로 만드는 나만의 회사 웹사이트: 완벽 가이드
logout 기능에서 req.cookies.token == undefined가 되는 문제
비슷한 질문이 있어서 5-2강까지 강의를 들어서 adminLogin까지 구현을 하였습니다.앞의 4-6강에서 로그아웃을 시도하였을 때, 400 Bad Request : 이미 로그아웃된 상태로 나옵니다. 그래서 console.log(req.cookies.token)을 해보았을 때, undefined가 나옵니다.adminLogin을 진행하여 브라우저에 쿠키가 제대로 저장되었는지 확인해보았는데, localhost:5173에서도 localhost:3000에서도 cookie에 token값이 저장되어있었습니다.index.js에 cookie-parser 또한 존재하는 상태입니다.질문을 올리기 전에 여러가지를 시도해보았는데, router.post() 에서는 req.cookies.token의 값을 undefined로 가져오고, router.get()에서는 정상적인 토큰값을 반환했습니다.어떻게 해야 router.post() 에서도 req.cookies.token값을 가져올 수 있을까요?thunder client로 GET http://localhost:3000/api/auth/getCookie를 했을 때도 token은 undefined 값이 출력되었다가 브라우저에서 주소로 접근하니 token값이 정상적으로 출력되었습니다.아래의 사진은 thunder client로 get 방식과 post 방식으로 보냈을 때의 차이를 담은 사진입니다.브라우저에 cookie가 정상적으로 저장된 사진입니다.// index.js require("dotenv").config(); const express = require("express"); const mongoose = require("mongoose"); const cookieParser = require("cookie-parser"); const cors = require("cors"); const userRoutes = require("./routes/user"); const app = express(); const PORT = 3000; app.use(cors({ origin: "http://localhost:5173", credentials: true, })); app.use(express.json()) app.use(express.urlencoded({extended : true})) app.use(cookieParser()); app.use("/api/auth", userRoutes); app.get("/", (req, res) => { res.send("Hello world"); console.log("token: " + req.cookies.token); }); app.post("/cookie", (req, res) => { console.log(req.cookies.token) res.send("api/auth"); }) mongoose .connect(process.env.MONGO_URL) .then(() => console.log("MongoDB와 연결이 되었습니다.")) .catch((error) => console.log("MongoDB와 연결에 실패했습니다: ", error)); app.listen(PORT, () => { console.log("Server is running"); }); // user.js const express = require("express"); const router = express.Router(); const bcrypt = require("bcrypt"); const User = require("../models/User"); const axios = require("axios"); const jwt = require("jsonwebtoken"); // const cookieParser = require("cookie-parser"); // router.use(express.json()) // router.use(express.urlencoded({extended : true})) // router.use(cookieParser()); router.post("/signup", async (req, res) => { try { const { username, password } = req.body; const existingUser = await User.findOne({ username }); if (existingUser) { return res.status(400).json({ message: "이미 존재하는 사용자입니다." }); } const hashedPassword = await bcrypt.hash(password, 10); const user = new User({ username, password: hashedPassword, }); await user.save(); res.status(201).json({ message: "회원가입이 완료되었습니다." }); } catch (error) { res.status(500).json({ message: "서버 오류가 발생했습니다." }); console.log(error); } }); router.post("/login", async (req, res) => { try { const { username, password } = req.body; const user = await User.findOne({ username }).select("+password"); if (!user) { return res.status("401").json({ message: "사용자를 찾을 수 없습니다." }); } if (!user.isActive) { return res .status(401) .json({ message: "비활성화된 계정입니다. 관리자에게 문의하세요." }); } if (user.isLoggedIn) { return res .status(401) .json({ message: "이미 다른 기기에서 로그인되어 있습니다." }); } const isValidPassword = await bcrypt.compare(password, user.password); if (!isValidPassword) { user.failedLoginAttempts += 1; user.lastLoginAttempt = new Date(); if (user.failedLoginAttempts >= 5) { user.isActive = false; await user.save(); return res.status(401).json({ message: "비밀번호를 5회 이상 틀려 계정이 비활성화되었습니다.", }); } await user.save(); return res.status(401).json({ message: "비밀번호가 일치하지 않습니다.", remainingAttempts: 5 - user.failedLoginAttempts, }); } user.failedLoginAttempts = 0; user.lastLoginAttempt = new Date(); user.isLoggedIn = true; // try { // const response = await axios.get("https://api.ipify.org?format=json"); // const ipAddress = response.data.ip; // user.ipAddress = ipAddress; // } catch (error) { // console.log("IP 주소를 가져오던 중 오류 발생: ", error.message); // } await user.save(); console.log("로그인 성공"); const token = jwt.sign( { userId: user._id, username: user.username }, process.env.JWT_SECRET, { expiresIn: "24h" } ); console.log(token); res.cookie("token", token, { httpOnly: true, secure: "production", sameSite: "strict", maxAge: 24 * 60 * 60 * 1000, }); console.log("쿠키 설정", ); const userWithoutPassword = user.toObject(); delete userWithoutPassword.password; res.json({ user: userWithoutPassword }); console.log("json 전달 후 종료"); } catch (error) { console.log("서버 오류: ", error.message); res.status(500).json({ message: "서버 오류가 발생했습니다." }); } }); router.post("/logout", async (req, res) => { try { const token = req.cookies.token; console.log(token); if (!token) { return res.status(400).json({ message: "이미 로그아웃된 상태입니다." }); } try { const decoded = jwt.verify(token, process.env.JWT_SECRET); const user = await User.findById(decoded.userId); if (user) { user.isLoggedIn = false; await user.save(); } } catch (error) { console.log("토큰 검증 오류: ", error.message); } res.clearCookie("token", { httpOnly: true, secure: "production", sameSite: "strict", }); res.json({ message: "로그아웃되었습니다." }); } catch (error) { console.log("로그아웃 오류: ", error.message); res.status(500).json({ message: "서버 오류가 발생했습니다." }); } }); router.delete("/delete/:userId", async (req, res) => { try { const user = await User.findByIdAndDelete(req.params.userId); if (!user) { return res.status(404).json({ message: "사용자를 찾을 수 없습니다." }); } res.json({ message: "사용자가 성공적으로 삭제되었습니다." }); } catch (error) { res.status(500).json({ message: "서버 오류가 발생했습니다." }); } }); router.post("/verify-token", (req, res) => { const token = req.cookies.token; if (!token) { return res .status(400) .json({ isValid: false, message: "토큰이 없습니다." }); } try { const decoded = jwt.verify(token, process.env.JWT_SECRET); return res.status(200).json({ isValid: true, user: decoded }); } catch (error) { return res .status(401) .json({ isValid: false, message: "유효하지 않은 토큰입니다." }); } }); // router.get("/getCookie", async (req, res) => { // res.send(req.cookies.token) // console.log("getCookie's token : " , req.cookies.token) // }) // router.post("/postCookie", async (req, res) => { // res.send(req.cookies.token) // console.log("postCookie's token : ", req.cookies.token) // }) module.exports = router;
-
해결됨UIUX 포트폴리오 Part.3 - 반응형 웹 포트폴리오
이미지를 문의드립니다.
안녕하세요."UIUX 포트폴리오 Part.3 - 반응형 웹 포트폴리오" 강의를 재밌게 보고 있습니다."완성" 폴더에 "원본"폴더에 있는 "yeskey"에 들어간 움직이는 이미지들을, 이미지 사이트에서 다운로드 받으신걸까요?만약 그렇다면 다운 받으신 사이트의 주소를 알려주실 수 있을까요?제 이메일 주소를 남깁니다. happinessboom@daum.net 입니다.좋은 강의를 만들어 주셔서 감사합니다.
-
미해결프로그래밍 시작하기 : 웹 입문 (Inflearn Original)
sublime text 설치 불가
하라는 데로 다 해도 그냥 안 깔리네요. 응용 프로그램 크롬으로 넘어가는 과정도 전혀 실행이 안되고요. 추측되는 요인 있으신 분 없으실까요?
-
해결됨React, Node.js, MongoDB로 만드는 나만의 회사 웹사이트: 완벽 가이드
맥북을 사용중인데, 터미널이 다릅니다,,,,!
강의에서는 command prompt를 사용하셨는데, 맥북에서는 zsh와 bash 중 어떤 것을 사용해야 할까요?