mirror of
https://github.com/atlanticbiomedical/website.git
synced 2025-07-01 18:07:27 -04:00
Added markdown and scoll to top features
This commit is contained in:
@ -3,7 +3,10 @@
|
|||||||
<div class="title"><h1>{{post.title}}</h1></div>
|
<div class="title"><h1>{{post.title}}</h1></div>
|
||||||
<img class="mainimg" ng-show="post.image" ng-src="http://atlanticbiomedical.com:8001/unsafe/fit-in/500x500/smart/{{post.image}}"><hr>
|
<img class="mainimg" ng-show="post.image" ng-src="http://atlanticbiomedical.com:8001/unsafe/fit-in/500x500/smart/{{post.image}}"><hr>
|
||||||
<div ng-hide="post.details" class="preview"><p>{{post.preview}}</p></div>
|
<div ng-hide="post.details" class="preview"><p>{{post.preview}}</p></div>
|
||||||
<div class="details"><p>{{post.details}}</p></div>
|
<div class="details">
|
||||||
|
<p ng-if="!post.detailsHtml" ng-bind="post.details"></p>
|
||||||
|
<div ng-if="post.detailsHtml" ng-bind-html="post.detailsHtml"></div>
|
||||||
|
</div>
|
||||||
<ul class="clearing-thumbs small-block-grid-4" data-clearing>
|
<ul class="clearing-thumbs small-block-grid-4" data-clearing>
|
||||||
<li ng-repeat="image in gallery track by $index">
|
<li ng-repeat="image in gallery track by $index">
|
||||||
<a href="http://atlanticbiomedical.com:8001/unsafe/{{image}}"><img ng-src="http://atlanticbiomedical.com:8001/unsafe/200x200/smart/{{image}}"></a>
|
<a href="http://atlanticbiomedical.com:8001/unsafe/{{image}}"><img ng-src="http://atlanticbiomedical.com:8001/unsafe/200x200/smart/{{image}}"></a>
|
||||||
|
@ -27,12 +27,20 @@ angular.module('biomed-frontend', [
|
|||||||
posts: function(Posts) {
|
posts: function(Posts) {
|
||||||
return Posts.query({
|
return Posts.query({
|
||||||
'status': 'posted',
|
'status': 'posted',
|
||||||
'sort': '-createdOn',
|
'sort': '-postedOn',
|
||||||
});
|
}).$promise;
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
controller: function($scope, posts, $timeout) {
|
controller: function($scope, posts, $timeout, $sce, $location, $anchorScroll) {
|
||||||
$scope.posts = posts;
|
$scope.posts = [];
|
||||||
|
|
||||||
|
angular.forEach(posts, function(post) {
|
||||||
|
if (post.previewHtml) {
|
||||||
|
post.previewHtml = $sce.trustAsHtml(post.previewHtml);
|
||||||
|
}
|
||||||
|
|
||||||
|
$scope.posts.push(post);
|
||||||
|
});
|
||||||
|
|
||||||
$scope.showMore = function(post) {
|
$scope.showMore = function(post) {
|
||||||
return post.details || post.gallery.length > 0;
|
return post.details || post.gallery.length > 0;
|
||||||
@ -46,14 +54,31 @@ angular.module('biomed-frontend', [
|
|||||||
post: function(Posts, $stateParams) {
|
post: function(Posts, $stateParams) {
|
||||||
return Posts.get({
|
return Posts.get({
|
||||||
'_id': $stateParams._id
|
'_id': $stateParams._id
|
||||||
});
|
}).$promise;
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
controller: function($scope, post) {
|
controller: function($scope, post, $sce) {
|
||||||
post.$promise.then(function() {
|
if (post.detailsHtml) {
|
||||||
$scope.post = post;
|
post.detailsHtml = $sce.trustAsHtml(post.detailsHtml);
|
||||||
$scope.gallery = post.gallery;
|
}
|
||||||
});
|
|
||||||
|
$scope.post = post;
|
||||||
|
$scope.gallery = post.gallery;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
$(window).scroll(function() {
|
||||||
|
if ($(this).scrollTop() >= 50) {
|
||||||
|
$('#return-to-top').fadeIn(200);
|
||||||
|
} else {
|
||||||
|
$('#return-to-top').fadeOut(200);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
$('#return-to-top').click(function() {
|
||||||
|
$('body,html').animate({
|
||||||
|
scrollTop : 0
|
||||||
|
}, 500);
|
||||||
|
});
|
||||||
|
@ -5,7 +5,8 @@
|
|||||||
<img class="img-rounded" ng-show="post.image" ng-src="http://atlanticbiomedical.com:8001/unsafe/280x0/{{post.image}}">
|
<img class="img-rounded" ng-show="post.image" ng-src="http://atlanticbiomedical.com:8001/unsafe/280x0/{{post.image}}">
|
||||||
<div class="caption text-center">
|
<div class="caption text-center">
|
||||||
<h3>{{post.title}}</h3>
|
<h3>{{post.title}}</h3>
|
||||||
<p>{{post.preview}}</p>
|
<p ng-if="!post.previewHtml" ng-bind="post.preview"></p>
|
||||||
|
<div ng-if="post.previewHtml" ng-bind-html="post.previewHtml"></div>
|
||||||
<p>
|
<p>
|
||||||
<a ui-sref="site.details(post)" ng-show="showMore(post)" class="btn btn-default" role="button">Read More</a>
|
<a ui-sref="site.details(post)" ng-show="showMore(post)" class="btn btn-default" role="button">Read More</a>
|
||||||
</p>
|
</p>
|
||||||
|
@ -5,9 +5,11 @@
|
|||||||
<meta charset="utf-8">
|
<meta charset="utf-8">
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||||
<title>Atlantic Biomedical</title>
|
<title>Atlantic Biomedical</title>
|
||||||
|
<link href="//netdna.bootstrapcdn.com/font-awesome/3.2.1/css/font-awesome.css" rel="stylesheet">
|
||||||
<link href="/styles.css" rel="stylesheet">
|
<link href="/styles.css" rel="stylesheet">
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
|
<a href="javascript:;" id="return-to-top"><i class="icon-chevron-up"></i></a>
|
||||||
<div ui-view></div>
|
<div ui-view></div>
|
||||||
<script src="/vendor.js"></script>
|
<script src="/vendor.js"></script>
|
||||||
<script src="/app.js"></script>
|
<script src="/app.js"></script>
|
||||||
|
@ -1327,3 +1327,45 @@ h2 {
|
|||||||
.masonry-container {
|
.masonry-container {
|
||||||
margin: 0 auto;
|
margin: 0 auto;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#return-to-top {
|
||||||
|
position: fixed;
|
||||||
|
bottom: 20px;
|
||||||
|
right: 20px;
|
||||||
|
background: rgb(0, 0, 0);
|
||||||
|
background: rgba(0, 0, 0, 0.7);
|
||||||
|
width: 50px;
|
||||||
|
height: 50px;
|
||||||
|
display: block;
|
||||||
|
text-decoration: none;
|
||||||
|
-webkit-border-radius: 35px;
|
||||||
|
-moz-border-radius: 35px;
|
||||||
|
border-radius: 35px;
|
||||||
|
display: none;
|
||||||
|
-webkit-transition: all 0.3s linear;
|
||||||
|
-moz-transition: all 0.3s ease;
|
||||||
|
-ms-transition: all 0.3s ease;
|
||||||
|
-o-transition: all 0.3s ease;
|
||||||
|
transition: all 0.3s ease;
|
||||||
|
z-index: 1000;
|
||||||
|
}
|
||||||
|
#return-to-top i {
|
||||||
|
color: #fff;
|
||||||
|
margin: 0;
|
||||||
|
position: relative;
|
||||||
|
left: 16px;
|
||||||
|
top: 13px;
|
||||||
|
font-size: 19px;
|
||||||
|
-webkit-transition: all 0.3s ease;
|
||||||
|
-moz-transition: all 0.3s ease;
|
||||||
|
-ms-transition: all 0.3s ease;
|
||||||
|
-o-transition: all 0.3s ease;
|
||||||
|
transition: all 0.3s ease;
|
||||||
|
}
|
||||||
|
#return-to-top:hover {
|
||||||
|
background: rgba(0, 0, 0, 0.9);
|
||||||
|
}
|
||||||
|
#return-to-top:hover i {
|
||||||
|
color: #fff;
|
||||||
|
top: 5px;
|
||||||
|
}
|
Reference in New Issue
Block a user