gallery update: gallery-item component, style refactoring

This commit is contained in:
tmshv committed 2016-02-22 00:00:04 +03:00
1 parent 302bf86f0b
commit 477b9916f2
7 files changed
+188 -172

No files matched your search

+2
View File
@@ -4,6 +4,7 @@
import Document from './components/Document';
import Award from './components/Award';
import GalleryItem from './components/GalleryItem';
import api from './api/api';
var deps = [
@@ -101,6 +102,7 @@ app.run(function ($location, $rootScope, $http) {
require("./controllers/CopyrightController"),
Document,
Award,
GalleryItem,
function (app) {
app.controller("SchedulePageController", function ($scope) {
$scope.pageClass = "page-schedule";
+10
View File
@@ -0,0 +1,10 @@
import template from '../../templates/components/gallery-item.html';
export default function (app) {
app.component('galleryItem', {
bindings: {
record: '='
},
template: template
});
};
+147
View File
@@ -0,0 +1,147 @@
@import "variables";
.album-block {
width: 100%;
margin: 1em auto 2em;
h3 {
text-align: center;
margin: 1.5em 0 1em;
}
.fotorama__nav-wrap {
margin: 6em 0 0;
}
.fotorama__stage{
overflow: inherit;
}
.fotorama__stage__frame{
overflow: inherit;
}
.album {
display: flex;
flex-direction: row;
flex-wrap: wrap;
justify-content: center;
}
.album-info {
width: 80%;
margin: 0 0 3em;
}
.album-info p {
margin: 0 0 .5em;
}
.album-item {
width: 80%;
box-sizing: border-box;
margin: 0 0 4em;
position: relative;
background-color: white;
padding: 6em;
box-shadow: 0 4px 14px -10px rgba(0,0,0, .85);
&.vertical {
width: 47%;
min-width: 30em;
max-width: 35em;
}
img{
width: 100%;
box-sizing: border-box;
border: .25em solid #eee;
border-top-color: #bbb;
border-left-color: #ddd;
}
}
.product-info{
text-align: center;
position: absolute;
width: 100%;
left: 0;
bottom: 1em;
& > div {
display: inline-block;
padding: .5em 1em;
background-color: white;
border: 1px solid #f5f5f5;
border-radius: .25em;
box-shadow: 0 5p/x 4px -4px rgba(0,0,0, .5);
}
p {
font-size: 0.75em;
}
.title {
font-weight: bold;
}
}
}
@media screen and (max-width: $mobile-width) {
.album-block {
width: 100%;
margin: 1em auto 2em;
h3 {
text-align: left;
margin: 1em 0 0.5em;
}
.album-info{
width: 100%;
margin: 0 0 2em;
}
.album-item {
width: 100%;
padding: 1em 1em 5em;
margin: 0 0 2em;
img{
border: .1em solid #eee;
border-top-color: #bbb;
border-left-color: #ddd;
}
}
.product-info {
bottom: .5em;
}
}
}
@media screen and (min-width: $mobile-width) and (max-width: $desktop-width){
.album-block {
.album-info{
width: 100%;
margin: 0 0 2em;
font-size: 0.75em;
}
.album-item {
width: 100%;
padding: 2em 2em 5em;
margin: 0 0 2em;
img{
border: .15em solid #eee;
border-top-color: #bbb;
border-left-color: #ddd;
}
}
.product-info {
bottom: .5em;
}
}
}
+19
View File
@@ -0,0 +1,19 @@
@import "variables";
$img-max-width: 500px;
.gallery-item {
width: calc(33% - #{$single-margin});
margin-bottom: $single-margin;
img {
width: 100%;
max-width: $img-max-width;
}
}
@media screen and (max-width: $mobile-width) {
.gallery-item {
margin: 0 0 1em;
}
}
-165
View File
@@ -1,10 +1,5 @@
@import "variables";
//.gallery-block {
// margin: 2em 0 0;
// display: block;
//}
.album-collection{
}
@@ -21,163 +16,3 @@
.album-collection__title{
}
.gallery-album {
width: calc(33% - #{$single-margin});
margin-bottom: $single-margin;
img {
width: 100%;
max-width: 500px;
}
}
.album-block {
width: 100%;
margin: 1em auto 2em;
h3 {
text-align: center;
margin: 1.5em 0 1em;
}
.fotorama__nav-wrap {
margin: 6em 0 0;
}
.fotorama__stage{
overflow: inherit;
}
.fotorama__stage__frame{
overflow: inherit;
}
.album {
display: flex;
flex-direction: row;
flex-wrap: wrap;
justify-content: center;
}
.album-info {
width: 80%;
margin: 0 0 3em;
}
.album-info p {
margin: 0 0 .5em;
}
.album-item {
width: 80%;
box-sizing: border-box;
margin: 0 0 4em;
position: relative;
background-color: white;
padding: 6em;
box-shadow: 0 4px 14px -10px rgba(0,0,0, .85);
&.vertical {
width: 47%;
min-width: 30em;
max-width: 35em;
}
img{
width: 100%;
box-sizing: border-box;
border: .25em solid #eee;
border-top-color: #bbb;
border-left-color: #ddd;
}
}
.product-info{
text-align: center;
position: absolute;
width: 100%;
left: 0;
bottom: 1em;
& > div {
display: inline-block;
padding: .5em 1em;
background-color: white;
border: 1px solid #f5f5f5;
border-radius: .25em;
box-shadow: 0 5p/x 4px -4px rgba(0,0,0, .5);
}
p {
font-size: 0.75em;
}
.title {
font-weight: bold;
}
}
}
@media screen and (max-width: $mobile-width) {
.album-block {
width: 100%;
margin: 1em auto 2em;
h3 {
text-align: left;
margin: 1em 0 0.5em;
}
.album-info{
width: 100%;
margin: 0 0 2em;
}
.album-item {
width: 100%;
padding: 1em 1em 5em;
margin: 0 0 2em;
img{
border: .1em solid #eee;
border-top-color: #bbb;
border-left-color: #ddd;
}
}
.product-info {
bottom: .5em;
}
}
.gallery-album {
margin: 0 0 1em;
}
}
@media screen and (min-width: $mobile-width) and (max-width: $desktop-width){
.album-block {
.album-info{
width: 100%;
margin: 0 0 2em;
font-size: 0.75em;
}
.album-item {
width: 100%;
padding: 2em 2em 5em;
margin: 0 0 2em;
img{
border: .15em solid #eee;
border-top-color: #bbb;
border-left-color: #ddd;
}
}
.product-info {
bottom: .5em;
}
}
}
@@ -0,0 +1,9 @@
<div class="gallery-item">
<h3>
<a href="{{$ctrl.record.url}}">{{$ctrl.record.title}}</a>
</h3>
<a href="{{$ctrl.record.url}}" class="invisible">
<img ng-src="{{$ctrl.record.preview_url}}" alt="{{$ctrl.record.title}}"/>
</a>
<p>{{$ctrl.record.course}}</p>
</div>
+1 -7
View File
@@ -2,13 +2,7 @@
<div class="album-collection" ng-repeat="period in years">
<h2 class="album-collection__title">{{period.year}}</h2>
<div class="album-collection__body">
<div class="gallery-album" ng-repeat="album in period.albums">
<h3><a href="{{album.url}}">{{album.title}}</a></h3>
<a href="{{album.url}}" class="invisible">
<img ng-src="{{album.preview_url}}" alt="{{album.title}}"/>
</a>
<p>{{album.course}}</p>
</div>
<gallery-item ng-repeat="album in period.albums" record="album"></gallery-item>
</div>
</div>
</div>