Skip to content

Commit

Permalink
refactor: CSS Update
Browse files Browse the repository at this point in the history
  • Loading branch information
devuri committed Dec 5, 2020
1 parent 1cd1923 commit 7795ed0
Show file tree
Hide file tree
Showing 3 changed files with 97 additions and 59 deletions.
96 changes: 96 additions & 0 deletions assets/css/igfeed-gird.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,96 @@
.igfeed-container {
margin: 0 auto;
}

.igfeed {
display: flex;
flex-direction: row;
flex-wrap: wrap;
/* justify-content: flex-start; */
justify-content: center;
align-content: stretch;
padding: 0;
}

.igfeed-item {
display: block;
float: left;
flex: 0 0 auto;
padding: 2px;
position: relative;
}

/* item description */
.igfeed-item-info {
display: none;
font-size: small;
padding: 8px;
position: absolute;
left: 50%;
top: 50%;
width: 100%;
height: 100%;
background-color: rgba(0, 0, 0, 0);
transform: translate(-50%, -50%);
transition: background-color 300ms linear;
}

.igfeed-item-info p {
font-weight: 600;
vertical-align: middle;
color: rgba(255, 255, 255, 0);
text-align: center;
transition: color 300ms linear;
position: relative;
top: 50%;
-ms-transform: translateY(-50%);
-webkit-transform: translateY(-50%);
transform: translateY(-50%);
}

.igfeed-item:hover .igfeed-item-info,
.igfeed-item:focus .igfeed-item-info {
display: block;
background-color: rgba(0, 0, 0, .6);
}

.igfeed-item-info:hover p {
color: rgba(255, 255, 255, 1);
}

/* item description */

@media screen and (min-width: 1024px) {
.igfeed-item {
width: calc(100%/6);
height: calc(100%/6);
}
}

@media screen and (min-width: 769px) and (max-width: 1024px) {
.igfeed-item {
width: calc(100%/4);
height: calc(100%/4);
}
}

@media screen and (min-width: 481px) and (max-width: 768px) {
.igfeed-item {
width: calc(100%/3);
height: calc(100%/3);
}
}

@media screen and (min-width: 321px) and (max-width: 480px) {
.igfeed-item {
width: calc(100%/2);
height: calc(100%/2);
}
}

@media screen and (max-width: 320px) {
.igfeed-item {
width: 100%;
height: 100%;
}
}
58 changes: 0 additions & 58 deletions assets/css/simsocial-photo-gird.css

This file was deleted.

2 changes: 1 addition & 1 deletion sim-social.php
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@
// register styles.
add_action( 'init', function() {

wp_register_style( 'sim-social-feed-grid', plugin_dir_url( __FILE__ ) . 'assets/css/simsocial-photo-gird.css', array(), '1.4.3', 'all' );
wp_register_style( 'igfeed-grid', plugin_dir_url( __FILE__ ) . 'assets/css/igfeed-gird.css', array(), '1.6.3', 'all' );
}
);

Expand Down

0 comments on commit 7795ed0

Please sign in to comment.