-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.php
56 lines (39 loc) · 1.12 KB
/
index.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
<?php get_header(); ?>
<div id="container">
<div id="content">
<?php
$args = array( 'post_type' => 'portfolio' );
$query = new WP_Query( $args );
?>
<div id="myMosaic">
<?php while ( $query->have_posts() ) : $query->the_post() ?>
<div class="item withImage" style="background-image: url('<?php the_post_thumbnail_url(); ?>');">
<div class="shader"></div>
<div class="linkWrap">
<a href="<?php the_permalink(); ?>"><?php the_title(); ?></a>
</div>
</div>
<?php endwhile; ?>
<?php wp_reset_postdata(); ?>
</div>
</div><!-- #container -->
<script>
const duration = 200;
const modifier = 100;
$('.withImage').hover(function(){
$(this).children('.shader').stop().animate({
opacity: .4
}, duration);
$(this).children('.linkWrap').stop().animate({
opacity: 1
}, duration+modifier);
},function(){
$(this).children('.shader').stop().animate({
opacity: 0
}, duration);
$(this).children('.linkWrap').stop().animate({
opacity: 0
}, duration-modifier);
});
</script>
<?php get_footer(); ?>