<link href="//netdna.bootstrapcdn.com/bootstrap/3.0.0/css/bootstrap.min.css" rel="stylesheet" id="bootstrap-css">
<script src="//netdna.bootstrapcdn.com/bootstrap/3.0.0/js/bootstrap.min.js"></script>
<script src="//code.jquery.com/jquery-1.11.1.min.js"></script>
<!------ Include the above in your HEAD tag ---------->
<!DOCTYPE html><html class=''>
<head><script src='//production-assets.codepen.io/assets/editor/live/console_runner-079c09a0e3b9ff743e39ee2d5637b9216b3545af0de366d4b9aad9dc87e26bfd.js'></script><script src='//production-assets.codepen.io/assets/editor/live/events_runner-73716630c22bbc8cff4bd0f07b135f00a0bdc5d14629260c3ec49e5606f98fdd.js'></script><script src='//production-assets.codepen.io/assets/editor/live/css_live_reload_init-2c0dc5167d60a5af3ee189d570b1835129687ea2a61bee3513dee3a50c115a77.js'></script><meta charset='UTF-8'><meta name="robots" content="noindex"><link rel="shortcut icon" type="image/x-icon" href="//production-assets.codepen.io/assets/favicon/favicon-8ea04875e70c4b0bb41da869e81236e54394d63638a1ef12fa558a4a835f1164.ico" /><link rel="mask-icon" type="" href="//production-assets.codepen.io/assets/favicon/logo-pin-f2d2b6d2c61838f7e76325261b7195c27224080bc099486ddd6dccb469b8e8e6.svg" color="#111" /><link rel="canonical" href="https://codepen.io/AndrewThian/pen/QdeOVa?depth=everything&order=popularity&page=64&q=react&show_forks=false" />
<style class="cp-pen-styles">html, body {
display: flex;
align-items: center;
justify-content: center;
flex-direction: column;
margin-top: 16px;
margin-bottom: 16px;
}
div#app {
display: flex;
align-items: center;
justify-content: center;
flex-direction: column;
}
div#app .search-wrapper {
position: relative;
}
div#app .search-wrapper label {
position: absolute;
font-size: 12px;
color: rgba(0, 0, 0, 0.5);
top: 8px;
left: 12px;
z-index: -1;
transition: .15s all ease-in-out;
}
div#app .search-wrapper input {
padding: 4px 12px;
color: rgba(0, 0, 0, 0.7);
border: 1px solid rgba(0, 0, 0, 0.12);
transition: .15s all ease-in-out;
background: white;
}
div#app .search-wrapper input:focus {
outline: none;
transform: scale(1.05);
}
div#app .search-wrapper input:focus + label {
font-size: 10px;
transform: translateY(-24px) translateX(-12px);
}
div#app .search-wrapper input::-webkit-input-placeholder {
font-size: 12px;
color: rgba(0, 0, 0, 0.5);
font-weight: 100;
}
div#app .wrapper {
display: flex;
max-width: 444px;
flex-wrap: wrap;
padding-top: 12px;
}
div#app .card {
box-shadow: rgba(0, 0, 0, 0.11765) 0px 1px 6px, rgba(0, 0, 0, 0.11765) 0px 1px 4px;
max-width: 124px;
margin: 12px;
transition: .15s all ease-in-out;
}
div#app .card:hover {
transform: scale(1.1);
}
div#app .card a {
text-decoration: none;
padding: 12px;
color: #03A9F4;
font-size: 24px;
display: flex;
flex-direction: column;
align-items: center;
}
div#app .card a img {
height: 100px;
}
div#app .card a small {
font-size: 10px;
padding: 4px;
}
div#app .hotpink {
background: hotpink;
}
div#app .green {
background: green;
}
div#app .box {
width: 100px;
height: 100px;
border: 1px solid rgba(0, 0, 0, 0.12);
}
</style></head><body>
<div id="app">
<div class="search-wrapper">
<input type="text" v-model="search" placeholder="Search title.."/>
<label>Search title:</label>
</div>
<div class="wrapper">
<div class="card" v-for="post in filteredList">
<a v-bind:href="post.link" target="_blank">
<img v-bind:src="post.img"/>
<small>posted by: {{ post.author }}</small>
{{ post.title }}
</a>
</div>
</div>
</div>
<script src='//production-assets.codepen.io/assets/common/stopExecutionOnTimeout-b2a7b3fe212eaa732349046d8416e00a9dec26eb7fd347590fbced3ab38af52e.js'></script><script src='https://cdnjs.cloudflare.com/ajax/libs/vue/2.1.9/vue.min.js'></script>
<script >'use strict';
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
var Post = function Post(title, link, author, img) {
_classCallCheck(this, Post);
this.title = title;
this.link = link;
this.author = author;
this.img = img;
};
var app = new Vue({
el: '#app',
data: {
search: '',
postList: [new Post('Vue.js', 'https://vuejs.org/', 'Chris', 'https://vuejs.org//images/logo.png'), new Post('React.js', 'https://facebook.github.io/react/', 'Tim', 'https://daynin.github.io/clojurescript-presentation/img/react-logo.png'), new Post('Angular.js', 'https://angularjs.org/', 'Sam', 'https://angularjs.org/img/ng-logo.png'), new Post('Ember.js', 'http://emberjs.com/', 'Rachel', 'http://www.gravatar.com/avatar/0cf15665a9146ba852bf042b0652780a?s=200'), new Post('Meteor.js', 'https://www.meteor.com/', 'Chris', 'http://hacktivist.in/introduction-to-nodejs-mongodb-meteor/img/meteor.png'), new Post('Aurelia', 'http://aurelia.io/', 'Tim', 'https://cdn.auth0.com/blog/aurelia-logo.png'), new Post('Node.js', 'https://nodejs.org/en/', 'A. A. Ron', 'https://code-maven.com/img/node.png'), new Post('Pusher', 'https://pusher.com/', 'Alex', 'https://avatars1.githubusercontent.com/u/739550?v=3&s=400'), new Post('Feathers.js', 'http://feathersjs.com/', 'Chuck', 'https://cdn.worldvectorlogo.com/logos/feathersjs.svg')]
},
computed: {
filteredList: function filteredList() {
var _this = this;
return this.postList.filter(function (post) {
return post.title.toLowerCase().includes(_this.search.toLowerCase());
});
}
}
});
//# sourceURL=pen.js
</script>
</body></html>