first commit 2
This commit is contained in:
@@ -0,0 +1,77 @@
|
||||
<?php
|
||||
if (!defined('_GNUBOARD_')) exit; // 개별 페이지 접근 불가
|
||||
|
||||
add_stylesheet('<link rel="stylesheet" href="'.G5_THEME_URL.'/shop/rb.layout/Trend06/style.css?ver='.G5_SERVER_TIME.'">', 0);
|
||||
?>
|
||||
|
||||
<div class="main-content-wrapper container trend06-layout">
|
||||
<!-- 1. 좌측 사이드바: 상품 카테고리 -->
|
||||
<aside class="layout-sidebar-left">
|
||||
<div class="sidebar-inner">
|
||||
<h2 class="sidebar-title">Products</h2>
|
||||
<nav class="sidebar-category-nav">
|
||||
<ul>
|
||||
<?php
|
||||
$sql = " SELECT ca_id, ca_name FROM {$g5['g5_shop_category_table']} WHERE length(ca_id) = 2 AND ca_use = '1' ORDER BY ca_order, ca_id ";
|
||||
$result = sql_query($sql);
|
||||
while ($row = sql_fetch_array($result)) {
|
||||
$active_class = (isset($_GET['ca_id']) && substr($_GET['ca_id'], 0, 2) == $row['ca_id']) ? 'active' : '';
|
||||
echo '<li class="category-item ' . $active_class . '">';
|
||||
echo '<a href="'.G5_SHOP_URL.'/list.php?ca_id='.$row['ca_id'].'">'.get_text($row['ca_name']).'</a>';
|
||||
|
||||
// 2차 분류 출력
|
||||
$sql2 = " SELECT ca_id, ca_name FROM {$g5['g5_shop_category_table']} WHERE length(ca_id) = 4 AND ca_use = '1' AND ca_id LIKE '{$row['ca_id']}%' ORDER BY ca_order, ca_id ";
|
||||
$result2 = sql_query($sql2);
|
||||
if(sql_num_rows($result2) > 0) {
|
||||
echo '<ul class="sub-category-list">';
|
||||
while ($row2 = sql_fetch_array($result2)) {
|
||||
$active_class2 = (isset($_GET['ca_id']) && $_GET['ca_id'] == $row2['ca_id']) ? 'active' : '';
|
||||
echo '<li class="sub-category-item ' . $active_class2 . '"><a href="'.G5_SHOP_URL.'/list.php?ca_id='.$row2['ca_id'].'">'.get_text($row2['ca_name']).'</a></li>';
|
||||
}
|
||||
echo '</ul>';
|
||||
}
|
||||
echo '</li>';
|
||||
}
|
||||
?>
|
||||
</ul>
|
||||
</nav>
|
||||
</div>
|
||||
</aside>
|
||||
|
||||
<!-- 2. 우측 메인 콘텐츠 -->
|
||||
<main class="layout-main-content">
|
||||
<?php
|
||||
// 현재 페이지가 상품 목록(list.php) 또는 상품 상세(item.php)일 경우, 해당 파일을 include 합니다.
|
||||
// 그렇지 않으면 (메인 페이지 등) 리빌더 모듈 영역을 표시합니다.
|
||||
$current_file = basename($_SERVER['SCRIPT_NAME']);
|
||||
|
||||
if ($current_file == 'list.php') {
|
||||
// 상품 목록 스킨을 직접 include
|
||||
$skin_file = G5_SHOP_SKIN_PATH.'/list.10.skin.php'; // 사용할 스킨 파일 지정
|
||||
if(is_file($skin_file)) {
|
||||
include $skin_file;
|
||||
} else {
|
||||
echo "<div class='guide-box'>상품 목록 스킨 파일이 없습니다.</div>";
|
||||
}
|
||||
} else if ($current_file == 'item.php') {
|
||||
// 상품 상세 스킨을 직접 include
|
||||
$skin_file = G5_SHOP_SKIN_PATH.'/item.form.skin.php'; // 사용할 스킨 파일 지정
|
||||
if(is_file($skin_file)) {
|
||||
include $skin_file;
|
||||
} else {
|
||||
echo "<div class='guide-box'>상품 상세 스킨 파일이 없습니다.</div>";
|
||||
}
|
||||
} else {
|
||||
// 메인 페이지의 경우, 리빌더 모듈 영역을 표시
|
||||
?>
|
||||
<div class="flex_box" data-layout="main-content-top">
|
||||
<?php if($is_admin) { echo "<div class='guide-box'>관리자 안내: [main-content-top] 영역에 모듈을 추가하세요.</div>"; } ?>
|
||||
</div>
|
||||
<div class="flex_box" data-layout="main-content-middle">
|
||||
<?php if($is_admin) { echo "<div class='guide-box'>관리자 안내: [main-content-middle] 영역에 모듈을 추가하세요.</div>"; } ?>
|
||||
</div>
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
</main>
|
||||
</div>
|
||||
@@ -0,0 +1,248 @@
|
||||
/* Trend06 Layout Style - Side-Nav & Catalog */
|
||||
|
||||
/* 💡 [추가] 고정 헤더로 인한 겹침 방지 */
|
||||
body {
|
||||
padding-top: 80px;
|
||||
background-color: #f5f5f5; /* 전체 배경색 */
|
||||
color: #333;
|
||||
}
|
||||
|
||||
.trend06-layout {
|
||||
display: flex;
|
||||
gap: 30px;
|
||||
padding-top: 40px;
|
||||
padding-bottom: 80px;
|
||||
max-width: 1400px;
|
||||
margin: 0 auto;
|
||||
}
|
||||
|
||||
/* 1. 좌측 사이드바 */
|
||||
.layout-sidebar-left {
|
||||
flex: 0 0 250px; /* 너비 고정 */
|
||||
background-color: #fff;
|
||||
border: 1px solid #ddd;
|
||||
border-radius: 5px;
|
||||
padding: 20px;
|
||||
height: fit-content;
|
||||
position: sticky;
|
||||
top: 100px; /* 스크롤 시 상단 고정 */
|
||||
}
|
||||
|
||||
.sidebar-title {
|
||||
font-size: 1.2rem;
|
||||
font-weight: 700;
|
||||
margin-bottom: 20px;
|
||||
padding-bottom: 10px;
|
||||
border-bottom: 2px solid #333;
|
||||
color: #333;
|
||||
}
|
||||
|
||||
.sidebar-category-nav ul {
|
||||
list-style: none;
|
||||
padding: 0;
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
.category-item {
|
||||
margin-bottom: 10px;
|
||||
}
|
||||
|
||||
.category-item > a {
|
||||
display: block;
|
||||
padding: 10px 15px;
|
||||
color: #555;
|
||||
text-decoration: none;
|
||||
font-weight: 500;
|
||||
border-radius: 4px;
|
||||
transition: all 0.2s;
|
||||
}
|
||||
|
||||
.category-item > a:hover,
|
||||
.category-item.active > a {
|
||||
background-color: #f0f4f8;
|
||||
color: #0056b3; /* 포인트 색상 */
|
||||
font-weight: 700;
|
||||
}
|
||||
|
||||
/* 2차 분류 (서브 카테고리) */
|
||||
.sub-category-list {
|
||||
margin-top: 5px;
|
||||
padding-left: 15px !important;
|
||||
display: none; /* 기본 숨김 */
|
||||
}
|
||||
|
||||
.category-item.active .sub-category-list,
|
||||
.category-item:hover .sub-category-list {
|
||||
display: block; /* 활성화되거나 호버 시 표시 */
|
||||
}
|
||||
|
||||
.sub-category-item a {
|
||||
font-size: 0.9rem;
|
||||
padding: 5px 10px;
|
||||
color: #777;
|
||||
}
|
||||
|
||||
.sub-category-item a:hover,
|
||||
.sub-category-item.active a {
|
||||
color: #0056b3;
|
||||
}
|
||||
|
||||
/* 2. 우측 메인 콘텐츠 */
|
||||
.layout-main-content {
|
||||
flex: 1;
|
||||
min-width: 0; /* flex item overflow 방지 */
|
||||
background-color: #fff;
|
||||
border: 1px solid #ddd;
|
||||
border-radius: 5px;
|
||||
padding: 30px;
|
||||
}
|
||||
|
||||
.guide-box {
|
||||
padding: 40px;
|
||||
background-color: #f9f9f9;
|
||||
border: 1px dashed #ddd;
|
||||
color: #888;
|
||||
font-size: 0.9rem;
|
||||
text-align: center;
|
||||
margin-bottom: 20px;
|
||||
}
|
||||
|
||||
/* 💡 [추가] 상품 목록 스타일 (Trend06 전용) */
|
||||
.trend06-layout .rb_shop_list .swiper-wrapper {
|
||||
display: grid !important;
|
||||
grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
|
||||
gap: 20px;
|
||||
height: auto !important;
|
||||
}
|
||||
|
||||
.trend06-layout .rb_shop_list .swiper-slide {
|
||||
width: auto !important;
|
||||
height: auto !important;
|
||||
margin: 0 !important;
|
||||
}
|
||||
|
||||
.trend06-layout .rb_shop_list_item {
|
||||
border: 1px solid #eee;
|
||||
border-radius: 8px;
|
||||
overflow: hidden;
|
||||
transition: transform 0.2s, box-shadow 0.2s;
|
||||
background: #fff;
|
||||
height: 100%;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
}
|
||||
|
||||
.trend06-layout .rb_shop_list_item:hover {
|
||||
transform: translateY(-5px);
|
||||
box-shadow: 0 5px 15px rgba(0,0,0,0.1);
|
||||
border-color: #0056b3;
|
||||
}
|
||||
|
||||
.trend06-layout .rb_shop_list_item_img {
|
||||
position: relative;
|
||||
padding-top: 100%; /* 1:1 비율 */
|
||||
overflow: hidden;
|
||||
background: #f9f9f9;
|
||||
}
|
||||
|
||||
.trend06-layout .rb_shop_list_item_img img {
|
||||
position: absolute;
|
||||
top: 0;
|
||||
left: 0;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
object-fit: cover;
|
||||
border-radius: 0 !important;
|
||||
border: none !important;
|
||||
}
|
||||
|
||||
.trend06-layout .v_ch_list_r {
|
||||
padding: 15px;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
flex-grow: 1;
|
||||
}
|
||||
|
||||
.trend06-layout .rb_shop_list_item_ca {
|
||||
font-size: 12px;
|
||||
color: #999;
|
||||
margin-bottom: 5px;
|
||||
}
|
||||
|
||||
.trend06-layout .rb_shop_list_item_name a {
|
||||
font-size: 16px;
|
||||
font-weight: 700;
|
||||
color: #333;
|
||||
line-height: 1.4;
|
||||
display: -webkit-box;
|
||||
-webkit-line-clamp: 2;
|
||||
-webkit-box-orient: vertical;
|
||||
overflow: hidden;
|
||||
height: 2.8em;
|
||||
}
|
||||
|
||||
.trend06-layout .rb_shop_list_item_basic {
|
||||
font-size: 13px;
|
||||
color: #777;
|
||||
margin-top: 10px;
|
||||
margin-bottom: auto; /* 가격을 하단으로 밀기 */
|
||||
}
|
||||
|
||||
.trend06-layout .rb_shop_list_item_pri {
|
||||
margin-top: 15px;
|
||||
padding-top: 15px;
|
||||
border-top: 1px solid #f0f0f0;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
}
|
||||
|
||||
.trend06-layout .rb_shop_list_item_pri .pri {
|
||||
font-size: 18px;
|
||||
font-weight: 900;
|
||||
color: #0056b3;
|
||||
}
|
||||
|
||||
.trend06-layout .list_wish_int {
|
||||
display: none; /* 찜하기 버튼 숨김 (깔끔하게) */
|
||||
}
|
||||
|
||||
/* 모바일 반응형 */
|
||||
@media (max-width: 1024px) {
|
||||
.trend06-layout {
|
||||
flex-direction: column;
|
||||
padding-top: 20px;
|
||||
}
|
||||
|
||||
.layout-sidebar-left {
|
||||
flex: none;
|
||||
width: 100%;
|
||||
position: static; /* 모바일에서는 고정 해제 */
|
||||
margin-bottom: 20px;
|
||||
}
|
||||
|
||||
.sidebar-category-nav ul {
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
gap: 10px;
|
||||
}
|
||||
|
||||
.category-item {
|
||||
margin-bottom: 0;
|
||||
}
|
||||
|
||||
.category-item > a {
|
||||
padding: 8px 15px;
|
||||
background-color: #f9f9f9;
|
||||
border: 1px solid #eee;
|
||||
}
|
||||
|
||||
.sub-category-list {
|
||||
display: none !important; /* 모바일에서는 2차 분류 숨김 (너무 복잡해짐) */
|
||||
}
|
||||
|
||||
.trend06-layout .rb_shop_list .swiper-wrapper {
|
||||
grid-template-columns: repeat(2, 1fr); /* 모바일 2열 */
|
||||
gap: 10px;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user