Compact the native shop collections and load their product artwork
This commit is contained in:
parent
855e7fd924
commit
b540ed7b69
4 changed files with 19 additions and 4 deletions
|
|
@ -33,7 +33,7 @@ final class DuneShopController extends Sceleton {
|
|||
$url=$category?\yii\helpers\Url::to(['catalog/index','cPath'=>$category]):\yii\helpers\Url::to([$route]);
|
||||
$out.='<a class="'.($title==='Sale'?'dune-store-category--sale':'').'" href="'.Html::encode($url).'"><img src="https://www.dunerealms.com/assets/'.$icon.'" alt=""><div><h2>'.Html::encode($title).'</h2><p>'.Html::encode($text).'</p></div><span aria-hidden="true">'.($title==='Sale'?'SALE':'↗').'</span></a>';
|
||||
}
|
||||
$out.='</nav>';
|
||||
$out.='</nav><div class="dune-store-collections">';
|
||||
foreach([['Sale','Current offers from the emporium',array_values(array_filter($rows,fn($r)=>in_array($r['products_id'],$saleIds))),'catalog/sales'],['Featured','Selected pieces from the realms',array_values(array_filter($rows,fn($r)=>in_array($r['products_id'],$featuredIds))),'catalog/featured-products'],['New arrivals','Recently added to the collection',array_slice($rows,0,6),'catalog/products-new']] as [$title,$sub,$items,$route]){
|
||||
$sectionClass=$title==='Sale'?' dune-store-section--sale':($title==='Featured'?' dune-store-section--featured':'');
|
||||
$out.='<section class="dune-store-section'.$sectionClass.'"><header><div><h2>'.($title==='Sale'?'<span class="dune-store-sale-label">SALE</span> ':'').$title.'</h2><p>'.$sub.'</p></div><a href="'.$base($route).'">View all ↗</a></header>';
|
||||
|
|
@ -51,13 +51,13 @@ final class DuneShopController extends Sceleton {
|
|||
$saving=(int)round((1-(float)$special/(float)$normal)*100);
|
||||
$price='<del>'.$price.'</del><strong>'.$currencies->display_price($special,$tax).'</strong><span class="dune-store-saving">Save '.$saving.'%</span>';
|
||||
}
|
||||
$out.='<article><a class="dune-store-product-art" href="'.$url.'"><img loading="lazy" src="'.$image.'" alt="'.Html::encode($p['products_name']).'"></a><small>'.($p['kind']==='sash'?'MADE TO ORDER':'CATALOGUE PREVIEW').'</small><h3><a href="'.$url.'">'.Html::encode($p['products_name']).'</a></h3><div class="dune-store-price">'.$price.'</div><a class="dune-store-button" href="'.$url.'">View details</a></article>';
|
||||
$out.='<article><a class="dune-store-product-art" href="'.$url.'"><img loading="eager" decoding="async" src="'.$image.'" alt="'.Html::encode($p['products_name']).'"></a><small>'.($p['kind']==='sash'?'MADE TO ORDER':'CATALOGUE PREVIEW').'</small><h3><a href="'.$url.'">'.Html::encode($p['products_name']).'</a></h3><div class="dune-store-price">'.$price.'</div><a class="dune-store-button" href="'.$url.'">View details</a></article>';
|
||||
}
|
||||
$out.='</div>';
|
||||
}
|
||||
$out.='</section>';
|
||||
}
|
||||
$out.='<aside class="dune-store-preview"><strong>Test ordering</strong><p>The Season sash is available as a test order by bank transfer; do not transfer money for the test. Other products remain collection previews. Sashes are made to order, with a required preferred name. Standard side edging is included; silver side edging is +€50 and gold side edging is +€75. The bottom fringe is unchanged.</p></aside>';
|
||||
$out.='</div><aside class="dune-store-preview"><strong>Test ordering</strong><p>The Season sash is available as a test order by bank transfer; do not transfer money for the test. Other products remain collection previews. Sashes are made to order, with a required preferred name. Standard side edging is included; silver side edging is +€50 and gold side edging is +€75. The bottom fringe is unchanged.</p></aside>';
|
||||
return $this->renderContent($out);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -36,3 +36,17 @@ html,body{height:auto!important;min-height:0!important}.main-content{min-height:
|
|||
.dune-store-section--featured{border:1px solid #baa15d!important;border-top:3px solid #dfc575!important;background:radial-gradient(ellipse at 35% 0,#7b6b3038,transparent 65%),linear-gradient(125deg,#263d27,#142b1e)!important;box-shadow:0 8px 28px #cfa74612!important}.dune-store-section--featured>header{border-bottom-color:#8d7b47!important}.dune-store-section--featured h2{color:#f3da92!important}.dune-store-section--featured header>a{color:#edd18b!important}.dune-store-section--featured article{border-color:#9a854c!important;background:linear-gradient(145deg,#31462b,#112a1e)!important}.dune-store-section--featured .dune-store-product-art{background:radial-gradient(ellipse,#8b7a394d,transparent 70%)}.dune-store-section--featured .dune-store-button{background:linear-gradient(#655d2e,#3a4829)!important;border-color:#c4a65c!important;color:#fff0c3!important}.dune-store-section--featured .dune-store-empty{border-color:#99844a!important;background:#37492a!important;color:#decf9c!important}
|
||||
|
||||
.dune-store-welcome>img[src*="imperial-heralds-logo"]{width:min(440px,46%);height:auto;object-fit:contain;filter:drop-shadow(0 8px 12px #0008)}@media(max-width:700px){.dune-store-welcome>img[src*="imperial-heralds-logo"]{width:min(100%,360px)}}
|
||||
/* One compact introduction, then real collections with their artwork loaded. */
|
||||
.dune-store-welcome{padding:24px!important;min-height:0!important;gap:22px!important;margin-bottom:20px!important}
|
||||
.dune-store-welcome>img{width:min(34%,300px)!important;height:auto!important;max-height:150px!important;object-fit:contain}
|
||||
.dune-store-welcome h1{font-size:clamp(25px,3vw,36px)!important;margin:10px 0!important}
|
||||
.dune-store-categories{gap:12px;margin-bottom:20px}.dune-store-categories>a{padding:16px;gap:12px}.dune-store-categories img{width:42px;height:42px}
|
||||
.dune-store-collections{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:20px;align-items:start}
|
||||
.dune-store-collections>.dune-store-section{margin:0;padding:18px;min-width:0}
|
||||
.dune-store-collections>.dune-store-section:not(.dune-store-section--sale):not(.dune-store-section--featured){grid-column:1/-1}
|
||||
.dune-store-collections .dune-store-products{grid-template-columns:repeat(auto-fit,minmax(min(100%,210px),1fr));gap:14px}
|
||||
.dune-store-collections :is(.dune-store-section--sale,.dune-store-section--featured) .dune-store-products{grid-template-columns:repeat(auto-fit,minmax(min(100%,220px),1fr))}
|
||||
.dune-store-collections .dune-store-products article{padding:14px}.dune-store-collections .dune-store-product-art{height:170px;margin-bottom:10px}.dune-store-collections .dune-store-product-art img{height:160px!important;max-height:160px!important}
|
||||
.dune-store-collections .dune-store-products h3{font-size:16px!important;line-height:1.4;margin:8px 0!important}.dune-store-collections .dune-store-products small{font-size:11px}.dune-store-collections .dune-store-price{font-size:21px;margin-bottom:12px}
|
||||
.dune-store-preview{margin-top:20px}
|
||||
@media(max-width:700px){.dune-store-collections{grid-template-columns:1fr}.dune-store-welcome>img{width:150px!important;max-height:100px!important}.dune-store-collections .dune-store-products{grid-template-columns:repeat(auto-fit,minmax(min(100%,180px),1fr))}}
|
||||
|
|
|
|||
|
|
@ -5,7 +5,7 @@ parser=argparse.ArgumentParser();parser.add_argument('--apply',action='store_tru
|
|||
if os.geteuid()!=0: raise SystemExit('Root operator required')
|
||||
app=pathlib.Path('/home/dunerealms/apps/oscommerce').resolve(strict=True)
|
||||
source=pathlib.Path(__file__).resolve().parent
|
||||
specs=[('DuneShopController.php','lib/frontend/controllers/DuneShopController.php','98a5c5d536cbf8badf5c567eb95e759726f27ffe215609596c72e8a151a58917','c977e5d9383d99c1a75caa15c2e769b1f54966114baa91ab54de45bcc05b752f'),('dune-shop-cards.css','dune-shop-cards.css','6206f3ff2695d73318dd05c92727062d82dff99423d49d37d3a93ba87b20b854','03f8f72ead3b514bd5c426d43ae87757b3c7460d94dd4e78a6bc99f555dd69eb')]
|
||||
specs=[('DuneShopController.php','lib/frontend/controllers/DuneShopController.php','c977e5d9383d99c1a75caa15c2e769b1f54966114baa91ab54de45bcc05b752f','e7280af87f7dbd4043f405bd64e991944a8842db6aa12ef1c0ff391f91c78b23'),('dune-shop-cards.css','dune-shop-cards.css','03f8f72ead3b514bd5c426d43ae87757b3c7460d94dd4e78a6bc99f555dd69eb','370bc3649f012df5917249ee550d1a751ff9234e468ec803d1f5217fed69f593')]
|
||||
def canonical(path):return path.read_bytes().replace(bytes([13,10]),bytes([10]))
|
||||
def digest(data):return hashlib.sha256(data).hexdigest()
|
||||
plan=[]
|
||||
|
|
|
|||
|
|
@ -37,3 +37,4 @@ body:has(main>header,main>.hero,main>.page-hero,#content) .dune-page-marker{disp
|
|||
body header.dune-site-header .dune-menu-group:has([aria-current="page"])>summary{color:#ffdc7b!important;box-shadow:inset 0 -2px #d5b762!important}
|
||||
body>a.skip-link,body>a[href="#staff-content"]{position:absolute;left:-10000px;top:0;z-index:1000;background:#17382d;color:#ffe0a0;padding:12px 18px}
|
||||
body>a.skip-link:focus,body>a[href="#staff-content"]:focus{left:12px}
|
||||
body:has(.dune-shop-landing) .dune-page-marker{display:none!important}
|
||||
|
|
|
|||
Loading…
Reference in a new issue

Staff