Browse Source

fix catalog layout

pull/49/merge
Quique Fernandez 8 years ago
parent
commit
242ec56516
4 changed files with 155 additions and 112 deletions
  1. +7
    -0
      src/Web/WebSPA/eShopOnContainers.WebSPA/Client/globals.scss
  2. +1
    -1
      src/Web/WebSPA/eShopOnContainers.WebSPA/Client/modules/_variables.scss
  3. +36
    -28
      src/Web/WebSPA/eShopOnContainers.WebSPA/Client/modules/catalog/catalog.component.html
  4. +111
    -83
      src/Web/WebSPA/eShopOnContainers.WebSPA/Client/modules/catalog/catalog.component.scss

+ 7
- 0
src/Web/WebSPA/eShopOnContainers.WebSPA/Client/globals.scss View File

@ -20,13 +20,20 @@ body {
font-weight: $font-weight-normal; font-weight: $font-weight-normal;
z-index: 10; z-index: 10;
} }
*,
*::after,
*::before {
box-sizing: border-box;
}
.preloading { .preloading {
color: $color-brand; color: $color-brand;
display: block;
font-size: $font-size-xl; font-size: $font-size-xl;
left: 50%; left: 50%;
position: fixed; position: fixed;
top: 50%; top: 50%;
transform: translate(-50%, -50%);
} }
select::-ms-expand { select::-ms-expand {


+ 1
- 1
src/Web/WebSPA/eShopOnContainers.WebSPA/Client/modules/_variables.scss View File

@ -33,7 +33,7 @@ $font-weight-normal: 400;
$font-weight-semibold: 600; $font-weight-semibold: 600;
$font-weight-bold: 700; $font-weight-bold: 700;
$font-size-xs: .5rem; // 8px
$font-size-xs: .65rem; // 10.4px
$font-size-s: .85rem; // 13.6px $font-size-s: .85rem; // 13.6px
$font-size-m: 1rem; // 16px $font-size-m: 1rem; // 16px
$font-size-l: 1.25rem; // 20px $font-size-l: 1.25rem; // 20px


+ 36
- 28
src/Web/WebSPA/eShopOnContainers.WebSPA/Client/modules/catalog/catalog.component.html View File

@ -1,38 +1,46 @@
<div class="container">
<div class="esh-catalog-hero">
<img class="esh-catalog-title" src="../../images/main_banner_text.png"/>
<section class="esh-catalog-hero">
<div class="container">
<img class="esh-catalog-title" src="../../images/main_banner_text.png" />
</div> </div>
<div class="esh-catalog-filter">
<div class="esh-catalog-filter-container">
<div class="container">
<div data-name="brand" class="esh-catalog-filter-wrapper">
<select class="esh-catalog-filter-select" (change)="onBrandFilterChanged($event, $event.target.value)">
<option *ngFor="let brand of brands" [value]="brand.id">{{brand.brand}}</option>
</select>
</div>
<div data-name="type" class="esh-catalog-filter-wrapper">
<select class="esh-catalog-filter-select" (change)="onTypeFilterChanged($event, $event.target.value)">
<option *ngFor="let type of types" [value]="type.id">{{type.type}}</option>
</select>
</div>
<button class="esh-catalog-filter-button" (click)="onFilterApplied($event)">
<img src="../../images/arrow-right.svg">
</button>
</div>
</div>
</section>
<section class="esh-catalog-filters">
<div class="container">
<label class="esh-catalog-label" data-title="brand">
<select class="esh-catalog-filter" (change)="onBrandFilterChanged($event, $event.target.value)">
<option *ngFor="let brand of brands" [value]="brand.id">{{brand.brand}}</option>
</select>
</label>
<label class="esh-catalog-label" data-title="type">
<select class="esh-catalog-filter" (change)="onTypeFilterChanged($event, $event.target.value)">
<option *ngFor="let type of types" [value]="type.id">{{type.type}}</option>
</select>
</label>
<img class="esh-catalog-send" (click)="onFilterApplied($event)" src="../../images/arrow-right.svg" />
</div> </div>
</section>
<div class="container">
<esh-pager [model]="paginationInfo" (changed)="onPageChanged($event)"></esh-pager> <esh-pager [model]="paginationInfo" (changed)="onPageChanged($event)"></esh-pager>
<div class="esh-catalog-content row">
<div class="col-md-4 esh-catalog-content-item" *ngFor="let item of catalog?.data">
<img src="{{item.pictureUri}}" />
<button (click)="addToCart(item)" class="esh-catalog-content-item-button">[ ADD TO CART ]</button>
<div class="esh-catalog-content-item-title">
<div class="esh-catalog-items row">
<div class="esh-catalog-item col-md-4"
*ngFor="let item of catalog?.data">
<img class="esh-catalog-thumbnail" src="{{item.pictureUri}}" />
<button class="esh-catalog-button" (click)="addToCart(item)">
[ ADD TO CART ]
</button>
<div class="esh-catalog-name">
<span>{{item.name}}</span> <span>{{item.name}}</span>
</div> </div>
<div class="esh-catalog-content-item-price">
<div class="esh-catalog-price">
<span>{{item.price}}</span> <span>{{item.price}}</span>
</div> </div>
</div> </div>
</div> </div>
<esh-pager [model]="paginationInfo" (changed)="onPageChanged($event)"></esh-pager> <esh-pager [model]="paginationInfo" (changed)="onPageChanged($event)"></esh-pager>
</div>
</div>

+ 111
- 83
src/Web/WebSPA/eShopOnContainers.WebSPA/Client/modules/catalog/catalog.component.scss View File

@ -3,6 +3,7 @@
.esh-catalog { .esh-catalog {
$banner-height: 260px; $banner-height: 260px;
&-hero { &-hero {
background-image: url('../../images/main_banner.png'); background-image: url('../../images/main_banner.png');
background-size: cover; background-size: cover;
@ -16,105 +17,132 @@
} }
$filter-height: 65px; $filter-height: 65px;
&-filter {
&-filters {
background-color: $color-brand;
height: $filter-height; height: $filter-height;
}
&-container {
$filter-padding: .5rem;
&-filter {
background-color: transparent;
border-color: $color-brand-bright;
color: $color-foreground-brighter;
cursor: pointer;
margin-right: 1rem;
margin-top: .5rem;
outline-color: $color-secondary;
padding-bottom: 0;
padding-left: $filter-padding;
padding-right: $filter-padding;
padding-top: $filter-padding * 3;
min-width: 140px;
-webkit-appearance: none;
option {
background-color: $color-brand; background-color: $color-brand;
height: $filter-height;
left: 0;
}
}
&-label {
display: inline-block;
position: relative;
z-index: 0;
&::before {
color: rgba($color-foreground-brighter, .5);
content: attr(data-title);
font-size: $font-size-xs;
margin-top: $font-size-xs;
margin-left: $filter-padding;
position: absolute; position: absolute;
width: 100%;
text-transform: uppercase;
z-index: 1;
} }
&-button {
width: 45px;
height: 45px;
padding: 6px 20px 10px 8px;
background-color: $color-secondary;
color: white;
font-size: 16px;
margin: 10px 0;
border: none;
&::after {
background-image: url('../../images/arrow-down.png');
height: 7px; //png height
content: '';
position: absolute; position: absolute;
right: $filter-padding * 3;
top: $filter-padding * 5;
width: 10px; //png width
z-index: 1;
}
}
&-send {
background-color: $color-secondary;
color: $color-foreground-brighter;
cursor: pointer;
font-size: $font-size-m;
margin-top: -$filter-padding * 3;
padding: $filter-padding;
transition: all $animation-speed-default;
&:hover {
background-color: $color-secondary-darker;
transition: all $animation-speed-default;
} }
}
&-items {
margin-top: 1rem;
}
&-select {
background-color: transparent;
padding: 10px;
margin: 10px;
margin-right: 20px;
color: #fff;
padding-top: 20px;
padding-bottom: 3px;
min-width: 140px;
border-color: #37c7ca;
max-height: 43px;
-webkit-appearance: none;
& option {
background-color: #00a69c;
}
&-item {
text-align: center;
margin-bottom: 1.5rem;
width: 33%;
@media screen and (max-width: $media-screen-m) {
width: 50%;
} }
&-wrapper {
z-index: 0;
display: inline-block;
margin-left: -10px;
@media screen and (max-width: $media-screen-s) {
width: 100%;
} }
}
&-wrapper::before {
content: attr(data-name);
opacity: 0.5;
z-index: 1;
text-transform: uppercase;
position: absolute;
font-size: 10px;
margin-top: 15px;
margin-left: 21px;
color: white;
&-thumbnail {
max-width: 370px;
width: 100%;
}
&-button {
background-color: $color-secondary;
border: none;
color: $color-foreground-brighter;
cursor: pointer;
font-size: $font-size-m;
height: 3rem;
margin-top: 1rem;
transition: all $animation-speed-default;
width: 80%;
&:hover {
background-color: $color-secondary-darker;
transition: all $animation-speed-default;
} }
} }
&-content {
margin-top: 10px;
&-item {
text-align: center;
margin-bottom: 20px;
&-image {
}
&-button {
width: 255px;
height: 45px;
padding: 10px 20px 10px 20px;
background-color: $color-secondary;
color: white;
font-size: 16px;
margin: 10px 0;
border: none;
cursor: pointer;
}
&-title {
text-align: center;
text-transform: uppercase;
font-weight: 300;
font-size: 16px;
/*margin-top: 20px;*/
}
&-price {
text-align: center;
font-weight: 900;
font-size: 28px;
}
&-price::before {
content: '$';
}
&-name {
font-size: $font-size-m;
font-weight: $font-weight-semilight;
margin-top: .5rem;
text-align: center;
text-transform: uppercase;
}
&-price {
text-align: center;
font-weight: 900;
font-size: 28px;
&::before {
content: '$';
} }
} }
} }

Loading…
Cancel
Save