<!DOCTYPE html>
<html>
<link rel="stylesheet" type="text/css" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css">
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js" type="text/javascript"></script>
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/font-awesome/4.5.0/css/font-awesome.min.css">
<link rel="stylesheet" type="text/css" href="style.css">
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.2.23/angular.min.js"></script>
<script src="http://cdnjs.cloudflare.com/ajax/libs/angular-filter/0.5.4/angular-filter.min.js"></script>
<body>
<div ng-app="myApp" ng-controller="MyController">
<div class="container">
<div class="row">
<div class="col-md-4 col-sm-6 col-xs-12" ng-repeat="user in users">
<article class="material-card {{colors[$index+1]}}" id="card{{$index}}">
<h2>
<span class="raleway">{{user.name}}</span>
<strong>
<i class="fa fa-fw fa-star"></i>
{{user.email}}
</strong>
</h2>
<div class="mc-content">
<div class="img-container">
<img class="img-responsive" src="{{user.image}}">
</div>
<div class="mc-description">
{{user.desc}}
</div>
</div>
<a class="mc-btn-action" ng-click="make_active($index)">
<i class="fa fa-bars" id="iconspin{{$index}}"></i>
</a>
<div class="mc-footer">
<h4>
Social
</h4>
<a class="fa fa-fw fa-facebook"></a>
<a class="fa fa-fw fa-twitter"></a>
<a class="fa fa-fw fa-linkedin"></a>
<a class="fa fa-fw fa-google-plus"></a>
</div>
</article>
</div>
</div>
</div>
</div>
<script>
var app = angular.module('myApp', ['angular.filter']);
app.controller('MyController', function ($scope,$http,$sce)
{
$scope.colors = ['material-card','Red','Pink','Purple','Indigo','Blue','Light-Blue','Cyan','Teal','Green','Light-Green','Lime','Yellow','Amber','Orange','Deep-Orange','Brown','Grey','Deep-Purple'];
$scope.make_active = function(id)
{
if(!$("#card"+id).hasClass("mc-active"))
{
$("#iconspin"+id).addClass('fa-spin-fast');
$("#card"+id).addClass("mc-active");
window.setTimeout(function ()
{
$("#iconspin"+id).removeClass('fa-bars').removeClass('fa-spin-fast').addClass('fa-arrow-left');
}, 500);
}
else
{
$("#iconspin"+id).addClass('fa-spin-fast');
$("#card"+id).removeClass("mc-active");
window.setTimeout(function ()
{
$("#iconspin"+id).removeClass('fa-arrow-left').removeClass('fa-spin-fast').addClass('fa-bars');
}, 500);
}
}
$scope.users = [{'name':'Paresh Gami','email':'<a href="/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="caadaba7a3baabb8afb9a2ff8aada7aba3a6e4a9a5a7">[email protected]</a>','desc':'He has appeared in more than 100 films and television shows, including The Deer Hunter, Annie Hall, The Prophecy trilogy, The Dogs of War ...','image':'http://u.lorenzoferrara.net/marlenesco/material-card/thumb-christopher-walken.jpg'},{'name':'Paresh Gami','email':'<a href="/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="8fe8eee2e6ffeefdeafce7bacfe8e2eee6e3a1ece0e2">[email protected]</a>','desc':'He has appeared in more than 100 films and television shows, including The Deer Hunter, Annie Hall, The Prophecy trilogy, The Dogs of War ...','image':'http://u.lorenzoferrara.net/marlenesco/material-card/thumb-christopher-walken.jpg'},{'name':'Paresh Gami','email':'<a href="/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="dcbbbdb1b5acbdaeb9afb4e99cbbb1bdb5b0f2bfb3b1">[email protected]</a>','desc':'He has appeared in more than 100 films and television shows, including The Deer Hunter, Annie Hall, The Prophecy trilogy, The Dogs of War ...','image':'http://u.lorenzoferrara.net/marlenesco/material-card/thumb-christopher-walken.jpg'},{'name':'Paresh Gami','email':'<a href="/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="1671777b7f66776473657e2356717b777f7a3875797b">[email protected]</a>','desc':'He has appeared in more than 100 films and television shows, including The Deer Hunter, Annie Hall, The Prophecy trilogy, The Dogs of War ...','image':'http://u.lorenzoferrara.net/marlenesco/material-card/thumb-christopher-walken.jpg'},
]
});
</script>
</body>
</html>
Feel free to run the entire code but make sure to copy the CSS from the link provided below:
https://github.com/marlenesco/material-cards/blob/master/dist/material-cards.css