Coder Social home page Coder Social logo

0909's Introduction

"react/prop-types": "off" @.eslintrc.cjs 2023.12.15/금

18:47

#94

j09.js ,231005

2023.09.12/화 z-index : 10002 ; 2023.09.26/화

Little things make me happy!

Free Mac Apps


emoji rocket : and emoji name 2023.07.11/화

MD - markdown

didn't know contents
~ H2O
^ Script^super^ < sup >
emoji : : 😄
mono `word `

isLoading

https://www.youtube.com/watch?v=_tUdtt6H5CE&t=2s

Design

Font /_ https://fonts.google.com/noto/specimen/Noto+Sans+KR _/

navigation

react-router-dom

https://bit.ly/3EdHVb7

햄버거 hamburger

https://youtu.be/NniT0vKyn-E?t=1755

0909's People

Contributors

letz0703 avatar

Stargazers

 avatar

Watchers

 avatar

0909's Issues

EISDIR error

CleanShot 2023-01-18 at 12 14 15@2x

solution
delete package-lock.json then

npm install

이미지 높이 문제 처리하자...

Sign Up
Settings
Features
Discord
Upgrade

마우스 드래그로 여x
Explain whx
+

Explain what this code does:

Ask Codebase
I'm sorry, I need more context to understand which code you are referring to. Can you please provide more information or context?

import { useState, useEffect, useRef } from "react"
import ImageSlider from "./image-slider"
import { useAuthContext } from "../../context/AuthContext"

export default function Slide() {
// const { user } = useAuthContext()
const slides = [
// {
// url: "/imgs/cart_ori.jpg",
// title: "STORE",
// para: "깡통시장",
// },
{
url: "/imgs/cart_ori.jpg",
title: "Jap",
para: "일본현지 공동구매",
},
// { url: "/imgs/promise.jpg", title: "스페셜(promise)" },
]

const containerStyle = {
objectFit: "cover",
padding: "0.6rem",
aspectRatio: "16/9",
}

return (






)
}

이코드에서 이미지 높이가 자꾸 바뀌는 문제를 해결해줘

이 코드에서 이미지 높이가 자꾸 바뀌는 문제는 이미지의 aspect ratio가 고정되어 있기 때문입니다. aspect ratio를 고정하면 이미지의 크기가 변경되어도 원래의 비율을 유지할 수 있습니다.

해결 방법으로는 이미지의 aspect ratio를 유지하면서도 이미지의 크기를 조절할 수 있는 방법이 있습니다. 이를 위해서는 이미지를 감싸는 div에
position: relative
속성을 추가하고, 이미지에
position: absolute
속성을 추가하여 위치와 크기를 조절합니다.

아래는 수정된 코드입니다.

Copy codeimport { useState, useEffect, useRef } from "react"
import ImageSlider from "./image-slider"
import { useAuthContext } from "../../context/AuthContext"

export default function Slide() {
// const { user } = useAuthContext()
const slides = [
// {
// url: "/imgs/cart_ori.jpg",
// title: "STORE",
// para: "깡통시장",
// },
{
url: "/imgs/cart_ori.jpg",
title: "Jap",
para: "일본현지 공동구매",
},
// { url: "/imgs/promise.jpg", title: "스페셜(promise)" },
]

const containerStyle = {
position: "relative",
objectFit: "cover",
padding: "0.6rem",
aspectRatio: "16/9",
}

const imageStyle = {
position: "absolute",
top: 0,
left: 0,
width: "100%",
height: "100%",
}

return (




{slides[0].title}


)
}
이렇게 수정하면 이미지의 aspect ratio가 유지되면서도 이미지의 크기를 조절할 수 있습니다.

Ask a followup

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.