Skip to content

Commit 5576c87

Browse files
committed
isotope
1 parent 2a025e4 commit 5576c87

File tree

4 files changed

+24
-7
lines changed

4 files changed

+24
-7
lines changed

src/app.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,4 +52,9 @@ wait(2000)
5252
container.appendChild(skills(container))
5353
container.appendChild(experiences(container))
5454
container.appendChild(portfolio(container))
55+
56+
return wait(1000)
57+
})
58+
.then( ()=> {
59+
container.onMounted()
5560
})

src/app.sass

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -314,9 +314,7 @@ p {
314314
}
315315

316316
&_photos {
317-
318-
319-
317+
margin: 0 auto;
320318
&-item {
321319
position: relative;
322320
width: 30em;
@@ -333,6 +331,7 @@ p {
333331

334332
.portfolio_photos-item-icon {
335333
opacity: 0;
334+
font-size: 20em;
336335
}
337336

338337
.portfolio_photos-item-title {
@@ -359,7 +358,7 @@ p {
359358
&-title {
360359
top: -10%;
361360
font-size: 4em;
362-
transition: all .5s .3s;
361+
transition: all .5s .1s;
363362
span:nth-child(even) {
364363
z-index: 15;
365364
}
@@ -372,7 +371,7 @@ p {
372371
z-index: 20;
373372
font-size: 15em;
374373
margin: 0;
375-
transition: all .3s;
374+
transition: all .5s;
376375
-webkit-text-fill-color: transparent !important;
377376
-webkit-background-clip: text !important;
378377
background-size: contain;

src/index.hbs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css">
1616
</head>
1717
<body>
18+
<script src="https://unpkg.com/isotope-layout@3/dist/isotope.pkgd.min.js"></script>
1819
{{#if js}}
1920
<script>
2021
{{{ js }}}

src/view/portfolio.js

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ const data = [
66
{
77
title: 'Project Web',
88
catalog: 'Graphic Design',
9-
img: 'assets/portfolio/1.jpg'
9+
img: 'assets/portfolio/4.jpg'
1010
},
1111
{
1212
title: 'Logo Design',
@@ -29,7 +29,7 @@ export const portfolio = container => {
2929

3030
const display = h('div', 'portfolio_photos', data.map( item=> {
3131
const img = h('img', 'portfolio_photos-item-img')
32-
const icon = h('h3', 'portfolio_photos-item-icon', item.title[0])
32+
const icon = h('h3', 'portfolio_photos-item-icon', item.title[0].toUpperCase() + item.title[1].toLowerCase())
3333
img.src = item.img
3434
icon.style.backgroundImage = `url(${item.img})`
3535

@@ -45,6 +45,18 @@ export const portfolio = container => {
4545
)
4646
}))
4747

48+
container.onMounted = ()=> {
49+
var iso = new Isotope( display, {
50+
// options
51+
itemSelector: '.portfolio_photos-item',
52+
layoutMode: 'masonry',
53+
masonry: {
54+
isFitWidth: true
55+
}
56+
});
57+
58+
}
59+
4860
return h('div', 'portfolio bg-dark',
4961
moveOnScrollOpacity(header('My latest crafts', 'Portfolio', ''), {
5062
container

0 commit comments

Comments
 (0)