웹 페이지 프론트엔드 UI 수정

- 모바일에서 봤을 때 UI/UX 이상하고 불편했던 부분 수정
 - 블로그 글 모바일 크기 시 리스트 아래로 글이 내려가는 부분 수정
 - 전체 배경 이어 붙이기가 아닌 고정으로 스크롤 시에도 어색하지 않게 수정
This commit is contained in:
2026-01-22 20:34:28 +09:00
parent d4ec482289
commit d713d2c4a7
11 changed files with 385 additions and 20 deletions

View File

@@ -20,6 +20,12 @@
padding: 40px 20px 80px;
}
@media (max-width: 768px) {
.site-main {
padding: 20px 16px 60px;
}
}
@keyframes fadeUp {
from {
opacity: 0;

View File

@@ -91,3 +91,36 @@
align-items: flex-start;
}
}
@media (max-width: 768px) {
.site-nav__inner {
padding: 14px 16px;
gap: 12px;
}
.site-nav__brand {
gap: 10px;
}
.site-nav__logo-image {
width: 36px;
height: 36px;
}
.site-nav__title {
font-size: 14px;
}
.site-nav__subtitle {
font-size: 11px;
}
.site-nav__links {
gap: 8px;
}
.site-nav__link {
font-size: 13px;
padding: 6px 10px;
}
}

View File

@@ -11,13 +11,21 @@ body {
body {
margin: 0;
background: radial-gradient(1000px 600px at 15% 5%, rgba(247, 168, 165, 0.25), transparent 60%),
radial-gradient(800px 600px at 85% 0%, rgba(253, 212, 177, 0.18), transparent 60%),
background: radial-gradient(2000px 1200px at 15% 5%, rgba(247, 168, 165, 0.25), transparent 70%),
radial-gradient(1600px 1200px at 85% 0%, rgba(253, 212, 177, 0.18), transparent 70%),
radial-gradient(1500px 800px at 50% 50%, rgba(151, 201, 170, 0.1), transparent 80%),
#0f0d12;
background-attachment: fixed;
color: var(--text);
font-family: var(--font-body);
}
@media (max-width: 768px) {
body {
background-attachment: scroll;
}
}
a {
color: inherit;
}

View File

@@ -53,6 +53,29 @@
align-items: start;
}
.blog-toggle-list {
display: none;
position: fixed;
top: 20px;
left: 20px;
z-index: 1000;
width: 40px;
height: 40px;
border-radius: 50%;
border: 1px solid var(--line);
background: rgba(10, 12, 20, 0.8);
color: var(--text);
font-size: 18px;
cursor: pointer;
backdrop-filter: blur(10px);
transition: transform 0.2s ease, opacity 0.2s ease;
}
.blog-toggle-list:hover {
transform: scale(1.1);
opacity: 0.9;
}
.blog-list {
display: grid;
gap: 12px;
@@ -184,7 +207,10 @@
.blog-article__body h1,
.blog-article__body h2,
.blog-article__body h3 {
.blog-article__body h3,
.blog-article__body h4,
.blog-article__body h5,
.blog-article__body h6 {
font-family: var(--font-display);
margin: 22px 0 10px;
}
@@ -201,6 +227,18 @@
font-size: 20px;
}
.blog-article__body h4 {
font-size: 18px;
}
.blog-article__body h5 {
font-size: 16px;
}
.blog-article__body h6 {
font-size: 14px;
}
.md-paragraph {
margin: 0 0 14px;
color: var(--muted);
@@ -220,6 +258,11 @@
font-size: 0.85em;
}
.blog-article__body del {
text-decoration: line-through;
opacity: 0.7;
}
.blog-article__body a {
color: #f7d4c9;
}
@@ -325,4 +368,104 @@
.blog-grid {
grid-template-columns: 1fr;
}
.blog-toggle-list {
display: block;
}
.blog-list {
display: none;
}
.blog-list.is-visible {
display: block;
position: fixed;
top: 0;
left: 0;
width: 100%;
height: 100%;
background: rgba(6, 8, 12, 0.7);
z-index: 999;
padding: 80px 20px 20px;
overflow-y: auto;
backdrop-filter: blur(10px);
display: flex;
flex-direction: column;
gap: 16px;
}
.blog-list.is-visible .blog-category-filter {
margin-bottom: 8px;
}
.blog-list.is-visible .blog-pagination {
margin-top: 8px;
}
.blog-article {
width: 100%;
}
}
@media (max-width: 768px) {
.blog-header h1 {
font-size: clamp(24px, 6vw, 32px);
}
.blog-grid {
gap: 18px;
}
.blog-list {
gap: 10px;
}
.blog-list__item {
padding: 14px;
}
.blog-list__title {
font-size: 15px;
}
.blog-list__excerpt {
font-size: 12px;
}
.blog-article {
padding: 18px;
}
.blog-article__body h1 {
font-size: 24px;
}
.blog-article__body h2 {
font-size: 20px;
}
.blog-article__body h3 {
font-size: 18px;
}
.blog-article__body h4 {
font-size: 16px;
}
.blog-article__body h5 {
font-size: 14px;
}
.blog-article__body h6 {
font-size: 12px;
}
.blog-categories__grid {
grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
gap: 14px;
}
.blog-category-card {
padding: 16px;
}
}

View File

@@ -5,7 +5,7 @@ import './Blog.css';
const renderInline = (text) => {
const normalized = text.replace(/<br\s*\/?>/gi, '\n');
const pattern =
/(!\[[^\]]*\]\([^)]+\)|\[[^\]]+\]\([^)]+\)|\*\*[^*]+\*\*|\*[^*]+\*|`[^`]+`)/g;
/(!\[[^\]]*\]\([^)]+\)|\[[^\]]+\]\([^)]+\)|\*\*[^*]+\*\*|\*[^*]+\*|~~[^~]+~~|`[^`]+`)/g;
const segments = normalized.split('\n');
return segments.flatMap((segment, segmentIndex) => {
@@ -48,6 +48,9 @@ const renderInline = (text) => {
if (part.startsWith('*')) {
return <em key={`${part}-${index}`}>{part.replace(/\*/g, '')}</em>;
}
if (part.startsWith('~~')) {
return <del key={`${part}-${index}`}>{part.replace(/~~/g, '')}</del>;
}
if (part.startsWith('`')) {
return <code key={`${part}-${index}`}>{part.replace(/`/g, '')}</code>;
}
@@ -123,6 +126,18 @@ const renderMarkdown = (body) => {
return;
}
if (line.startsWith('###### ')) {
blocks.push({ type: 'h6', value: line.replace(/^######\s+/, '') });
return;
}
if (line.startsWith('##### ')) {
blocks.push({ type: 'h5', value: line.replace(/^#####\s+/, '') });
return;
}
if (line.startsWith('#### ')) {
blocks.push({ type: 'h4', value: line.replace(/^####\s+/, '') });
return;
}
if (line.startsWith('### ')) {
blocks.push({ type: 'h3', value: line.replace(/^###\s+/, '') });
return;
@@ -146,6 +161,9 @@ const renderMarkdown = (body) => {
if (block.type === 'h1') return <h1 key={index}>{block.value}</h1>;
if (block.type === 'h2') return <h2 key={index}>{block.value}</h2>;
if (block.type === 'h3') return <h3 key={index}>{block.value}</h3>;
if (block.type === 'h4') return <h4 key={index}>{block.value}</h4>;
if (block.type === 'h5') return <h5 key={index}>{block.value}</h5>;
if (block.type === 'h6') return <h6 key={index}>{block.value}</h6>;
if (block.type === 'list')
return (
<ul key={index}>
@@ -202,6 +220,7 @@ const Blog = () => {
const [selectedCategory, setSelectedCategory] = useState('전체');
const [page, setPage] = useState(1);
const [showList, setShowList] = useState(false);
const pageSize = 10;
const filteredPosts = useMemo(() => {
if (selectedCategory === '전체') return posts;
@@ -250,7 +269,15 @@ const Blog = () => {
</header>
<div className="blog-grid">
<aside className="blog-list">
<button
type="button"
className="blog-toggle-list"
onClick={() => setShowList((prev) => !prev)}
aria-label="글 목록 토글"
>
</button>
<aside className={`blog-list ${showList ? 'is-visible' : ''}`}>
<div className="blog-category-filter">
{['전체', ...categoryNames, '기타'].map((name) => (
<button
@@ -272,7 +299,10 @@ const Blog = () => {
className={`blog-list__item${
post.slug === activeSlug ? ' is-active' : ''
}`}
onClick={() => setActiveSlug(post.slug)}
onClick={() => {
setActiveSlug(post.slug);
setShowList(false); // 모바일에서 글 선택 시 리스트 숨김
}}
>
<p className="blog-list__title">{post.title}</p>
<p className="blog-list__excerpt">{post.excerpt}</p>

View File

@@ -308,3 +308,51 @@
grid-template-columns: 1fr;
}
}
@media (max-width: 768px) {
.home-hero h1 {
font-size: clamp(24px, 6vw, 36px);
}
.home-grid {
grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
gap: 12px;
}
.home-card {
padding: 14px;
gap: 12px;
}
.home-card__title {
font-size: 16px;
}
.home-card__desc {
font-size: 13px;
}
.home-posts {
gap: 10px;
}
.home-post {
padding: 14px 16px;
}
.home-post__title {
font-size: 16px;
}
.home-profile__card {
padding: 18px;
}
.home-profile__name {
font-size: 16px;
}
.home-profile__bio {
font-size: 14px;
}
}

View File

@@ -16,8 +16,7 @@ const Home = () => {
<p className="home-hero__kicker">Personal Archive</p>
<h1>기록을 모으고, 이야기를 이어붙이는 작은 .</h1>
<p className="home-hero__lead">
개발 실험, 여행 스냅, 그리고 생각을 모아두는 공간입니다. 블로그 글은
마크다운으로 작성해 계속 추가할 있어요.
개발, 여행 스냅, 그리고 생각을 모아두는 공간입니다.
</p>
<div className="home-hero__actions">
<Link className="button primary" to="/blog">

View File

@@ -337,3 +337,43 @@
grid-template-columns: 1fr;
}
}
@media (max-width: 768px) {
.lotto-header h1 {
font-size: clamp(24px, 6vw, 32px);
}
.lotto-grid {
grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
gap: 14px;
}
.lotto-panel {
padding: 16px;
}
.lotto-panel__head {
flex-direction: column;
align-items: flex-start;
gap: 10px;
}
.lotto-row {
gap: 6px;
}
.lotto-ball {
width: 36px;
height: 36px;
font-size: 14px;
}
.lotto-meta__title {
font-size: 16px;
}
.lotto-history__item {
padding: 14px;
gap: 12px;
}
}

View File

@@ -24,6 +24,12 @@
font-size: clamp(30px, 4vw, 40px);
}
@media (max-width: 768px) {
.travel-header h1 {
font-size: clamp(24px, 6vw, 32px);
}
}
.travel-sub {
margin: 0;
color: var(--muted);
@@ -52,6 +58,13 @@
gap: 18px;
}
@media (max-width: 768px) {
.travel-grid {
grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
gap: 12px;
}
}
.travel-albums {
display: grid;
gap: 24px;
@@ -80,6 +93,12 @@
background: rgba(10, 12, 20, 0.6);
}
@media (max-width: 768px) {
.travel-map__canvas {
min-height: 300px;
}
}
.travel-map__info {
width: 100%;
border: 1px solid rgba(255, 255, 255, 0.2);
@@ -189,6 +208,12 @@
cursor: pointer;
}
@media (max-width: 768px) {
.travel-card {
min-height: 150px;
}
}
.travel-card.is-wide {
grid-column: span 2;
}
@@ -352,6 +377,14 @@
cursor: pointer;
}
@media (max-width: 768px) {
.travel-modal__arrow {
width: 48px;
height: 48px;
font-size: 28px;
}
}
.travel-card__meta {
margin: 0;
font-size: 12px;

View File

@@ -169,6 +169,7 @@ const Travel = () => {
const [regionsGeojson, setRegionsGeojson] = useState(null);
const [selectedPhotoIndex, setSelectedPhotoIndex] = useState(null);
const [modalOffset, setModalOffset] = useState(24);
const [touchStartX, setTouchStartX] = useState(null);
const cacheRef = useRef(new Map());
const cacheTtlMs = 10 * 60 * 1000;
@@ -292,8 +293,42 @@ const Travel = () => {
}
};
const handleTouchStart = (event) => {
if (selectedPhotoIndex === null) return;
const touch = event.touches[0];
setTouchStartX(touch.clientX);
};
const handleTouchEnd = (event) => {
if (selectedPhotoIndex === null || touchStartX === null) return;
const touch = event.changedTouches[0];
const deltaX = touch.clientX - touchStartX;
if (Math.abs(deltaX) > 50) { // 스와이프 거리 임계값
if (deltaX > 0) {
// 왼쪽으로 스와이프: 이전 사진
setSelectedPhotoIndex((prev) =>
prev === null
? prev
: (prev - 1 + photos.length) % photos.length
);
} else {
// 오른쪽으로 스와이프: 다음 사진
setSelectedPhotoIndex((prev) =>
prev === null ? prev : (prev + 1) % photos.length
);
}
}
setTouchStartX(null);
};
window.addEventListener('keydown', handleKeyDown);
return () => window.removeEventListener('keydown', handleKeyDown);
window.addEventListener('touchstart', handleTouchStart);
window.addEventListener('touchend', handleTouchEnd);
return () => {
window.removeEventListener('keydown', handleKeyDown);
window.removeEventListener('touchstart', handleTouchStart);
window.removeEventListener('touchend', handleTouchEnd);
};
}, [photos.length, selectedPhotoIndex]);
useEffect(() => {