Skip to content

Commit

Permalink
[FEATURE] add new list templates for News plugin, (cards, simplelist,…
Browse files Browse the repository at this point in the history
… timeline)
  • Loading branch information
dmh committed Jul 7, 2016
1 parent c7fdcb0 commit c9ac1db
Show file tree
Hide file tree
Showing 21 changed files with 1,558 additions and 49 deletions.
2 changes: 1 addition & 1 deletion dev/js/components.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

// Jquery dot dot dot
//==============================================================================
// @import '../bower_components/jQuery.dotdotdot/src/js/jquery.dotdotdot.js';
@import '../bower_components/jQuery.dotdotdot/src/js/jquery.dotdotdot.js';
//==============================================================================


Expand Down
1 change: 1 addition & 0 deletions dev/js/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@

// plugins
@import 'main/plugins/news/newsCarousel.js';
@import 'main/plugins/news/news.js';

@import 'main/suggest.js';

Expand Down
18 changes: 18 additions & 0 deletions dev/js/main/plugins/news/news.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
// news Timeline
$('.js__news-timeline__item').on('click', function(e) {
if ($(this).hasClass('collapsed')){
e.preventDefault();
$(this).removeClass('collapsed');
$(this).closest('.js__news-timeline__item-wrp').find('.js__news-timeline__date').addClass('open');
}
});

// news Cards
$('.js__news-cards__dotdotdot').dotdotdot({
watch: 'window'
});

// news Simple list
$('.js__news-simple-list__dotdotdot').dotdotdot({
watch: 'window'
});
5 changes: 5 additions & 0 deletions dev/styles/main.less
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,11 @@
// ext News
@import "main/plugins/news/news.less";
@import "main/plugins/news/newsCarousel.less";

@import "main/plugins/news/newsCards.less";
@import "main/plugins/news/newsSimpleList.less";
@import "main/plugins/news/newsTimeline.less";

// ext Search
@import "main/plugins/search/search.less";
@import "main/plugins/search/searchSuggest.less";
Expand Down
2 changes: 1 addition & 1 deletion dev/styles/main/icons/icons.less
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@

// ======== NEWS extension icons ========
.news-menu-view li li:before {content: "\e93d";} // news archive icon
.news-article-footer .news-list-category:before, .news-catecories li:before {
.news-article-footer .news-list-category:before, .news-categories li:before {
content: "\f115"; // news category icon
}
.news-article-footer .news-list-tags:before {content: "\e963";} // news tag icon
Expand Down
8 changes: 4 additions & 4 deletions dev/styles/main/plugins/news/news.less
Original file line number Diff line number Diff line change
Expand Up @@ -309,14 +309,14 @@
padding-right: 8px;
color: #888;
}
.news-catecories ul{
.news-categories ul{
list-style: none;
padding-left: 10px;
}
.news-catecories ul li a.active{
.news-categories ul li a.active{
color: @main-link-hover-color;
}
.news-catecories li:before{
.news-categories li:before{
font-family: 'icons';
speak: none;
position: relative;
Expand All @@ -335,7 +335,7 @@
// content: "\e680";
padding-right: 8px;
}
.news-catecories li li:before{
.news-categories li li:before{
color: #bbb;
}

Expand Down
49 changes: 49 additions & 0 deletions dev/styles/main/plugins/news/newsCards.less
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
// Cards
.news-cards__item {
position: relative;
box-shadow: 0 2px 6px 0 rgba(0,0,0,0.15);
border: 1px solid @border-color;
margin-bottom: 30px;
border-radius: 3px;
}

.news-cards__media-preview{
height: 180px;
background-size: cover;
background-repeat: no-repeat;
background-position: 50% 50%;
margin-bottom: 20px;
}

.news-cards__text{
padding: 0 15px;
color: @main-text-color;
}

.news-cards__author {
padding: 10px 15px;
background-color: darken(@main-body-bg, 10%);
}

.news-cards__more-link{
padding: 12px 15px;
}
.news-cards__header h3{
font-size: 22px;
}


@media (min-width: 768px) {
.news-cards__item {
height: 475px;
}
.news-cards__text{
height: 188px;
overflow: hidden;
}
.news-cards__author {
position: absolute;
bottom: 0;
width: 100%;
}
}
59 changes: 59 additions & 0 deletions dev/styles/main/plugins/news/newsSimpleList.less
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
.news-simple-list__img-wrap {
margin-right: 20px;
overflow: hidden;
height: 200px;
width: 100%;
}
.news-simple-list__text{
overflow: hidden;
position: relative;


padding: 15px;
padding-bottom: 0;
height: auto;
}

.news-simple-list__item{
background-color: darken(@main-body-bg, 5%);
margin-bottom: 30px;
}

.news-simple-list__media-preview{
background-size: cover;
background-position: 50% 50%;
height: 200px;
background-repeat: no-repeat;
}

.news-simple-list__more-link {
padding: 0 15px 15px;
}
.news-simple-list__header h3 {
font-size: 22px;
}

@media (min-width: 768px){
.news-simple-list__img-wrap {
float: left;
width: 225px;
}
.news-simple-list__text{
height: 168px;
padding-left: 0;
padding-top: 20px;
padding-right: 30px;
}
.news-simple-list__more-link{
padding: 0;
}
}

@media (min-width: 768px) and (max-width: 991px) {
.news-simple-list__more-link{
padding-top: 4px;
}
.news-simple-list__header h3 {
font-size: 19px;
}
}
185 changes: 185 additions & 0 deletions dev/styles/main/plugins/news/newsTimeline.less
Original file line number Diff line number Diff line change
@@ -0,0 +1,185 @@
// Timeline

.news-timeline-wrp{
clear: both;
overflow: hidden;
position: relative;
margin-bottom: 30px;
}

.news-timeline-wrp::before {
content: '';
position: absolute;
top: 0;
height: 100%;
width: 2px;
background: darken(@main-body-bg, 7%);
left: 23px;
margin-left: -1px;
margin-top: 80px;
}

.news-timeline__header{
margin: 30px;
text-align: center;
}

.news-timeline__item-wrp{
position: relative;
}

// timeline date
.news-timeline__date{
position: absolute;
text-align: center;
width: 42px;
height: 42px;
font-size: 12px;

border-radius: 50%;
background-color: darken(@main-body-bg, 7%);
display: flex;
align-items: center;
justify-content: center;
top: 20px;
margin-left: -25px;
color: @main-text-color;
box-shadow: 0 2px 6px 0 rgba(0,0,0,0.15);
left: 25px;
}


.news-timeline__date.open{
background-color: @main-color;
color: #fff;
}

.news-timeline__date span{
display: block;
}

.news-timeline-wrp .odd.news-timeline__date.open::after,
.news-timeline-wrp .even.news-timeline__date.open::after{
content: "";
position: absolute;
top: 12px;
width: 0;
height: 0;
border-top: 10px solid transparent;
border-bottom: 10px solid transparent;
right: -14px;
border-left: 20px solid #288fb4;
}

.news-timeline-wrp .even.news-timeline__date.open::after{
border-right: 0;
left: auto;
right: -14px;
border-left: 20px solid @main-color;
}

.news-timeline__date-day{
font-weight: 700;
}


// news item article
.news-timeline__item-article{
width: 100%;
position: relative;
overflow: hidden;
}

.news-timeline__item{
margin-bottom: 30px;
border-radius: 3px;
position: relative;
border: 1px solid darken(@main-body-bg, 15%);
box-shadow: 0 2px 6px 0 rgba(0,0,0,0.15);
width: auto;
margin-left: 70px;
}

.news-timeline__item.last{
margin-bottom: 0;
}

.news-timeline__item.collapsed{
cursor: pointer;
}

.news-timeline__img-wrap{
}

.news-timeline__media-preview{
height: 250px;
background-size: cover;
background-position: 50% 50%;
background-repeat: no-repeat;
}

.news-timeline__item-text{
padding: 15px 20px;
}

.news-timeline__item-header h3{
font-size: 20px;
margin: 5px 0;
}
.news-timeline__item-teaser{
margin-top: 10px;
}

.news-timeline__item-author {
background-color: darken(@main-body-bg, 7%);
padding: 10px 20px 8px;
text-transform: capitalize;
font-size: 12px;
}

.news-timeline__item-wrp .collapsed .news-timeline__item-teaser,
.news-timeline__item-wrp .collapsed .news-timeline__img-wrap{
opacity: 0;
visibility: hidden;
max-height: 0;
}


@media (min-width: 768px) {
.news-timeline__date {
width: 50px;
height: 50px;
font-size: 14px;
}

.news-timeline-wrp .odd.news-timeline__date.open::after,
.news-timeline-wrp .even.news-timeline__date.open::after{
top: 15px;
}

}
@media (min-width: 992px) {
.news-timeline-wrp::before{
left: 50%;
}
.news-timeline__date{
left: 50%;
}

.news-timeline-wrp .odd.news-timeline__date.open::after{
right: auto;
left: -14px;
border-right: 20px solid @main-color;
border-left: 0;
}
.news-timeline__item{
width: 44%;
margin-left: 0;
}
.news-timeline__item.odd{
float: left;
}
.news-timeline__item.even{
float: right;
}
}
Loading

0 comments on commit c9ac1db

Please sign in to comment.