Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactor Hexagonal Grid CSS and Add Responsive Styles #530

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file added Eduhub-Community.github.io - Shortcut.lnk
Binary file not shown.
320 changes: 167 additions & 153 deletions help.css
Original file line number Diff line number Diff line change
@@ -1,212 +1,226 @@
/* GENERAL RESET */
* {
margin: 0;
padding: 0;
}



/* HEXAGON GRID CONTAINER */
#hexGrid {
display: flex;
flex-wrap: wrap;
width: 76%;
margin: 0 auto;
overflow: hidden;
font-family:Impact, Haettenschweiler, "Arial Narrow Bold", sans-serif;
list-style-type: none;
display: flex;
flex-wrap: wrap;
width: 76%;
margin: 0 auto;
overflow: hidden;
font-family: Impact, Haettenschweiler, "Arial Narrow Bold", sans-serif;
list-style-type: none;
}

/* HEXAGON STYLES */
.hex {
position: relative;
visibility:hidden;
outline:2px solid transparent; /* fix for jagged edges in FF on hover transition */
transition: all 0.5s;
backface-visibility: hidden;
will-change: transform;
transition: all 0.5s;
}
.hex::after{
content:'';
display:block;
padding-bottom: 86.602%; /* = 100 / tan(60) * 1.5 */
}
.hexIn{
position: absolute;
width:96%;
padding-bottom: 110.851%; /* = width / sin(60) */
margin: 2%;
overflow: hidden;
visibility: hidden;
outline:1px solid transparent; /* fix for jagged edges in FF on hover transition */
-webkit-transform: rotate3d(0,0,1,-60deg) skewY(30deg);
-ms-transform: rotate3d(0,0,1,-60deg) skewY(30deg);
transform: rotate3d(0,0,1,-60deg) skewY(30deg);
position: relative;
visibility: hidden;
outline: 2px solid transparent; /* fix for jagged edges in FF on hover transition */
backface-visibility: hidden;
will-change: transform;
transition: all 0.5s;
}

.hex::after {
content: '';
display: block;
padding-bottom: 86.602%; /* = 100 / tan(60) * 1.5 */
}

/* INNER HEXAGON */
.hexIn {
position: absolute;
width: 96%;
padding-bottom: 110.851%; /* = width / sin(60) */
margin: 2%;
overflow: hidden;
visibility: hidden;
outline: 1px solid transparent; /* fix for jagged edges in FF on hover transition */
transform: rotate3d(0, 0, 1, -60deg) skewY(30deg);
transition: all 0.5s;
}

/* INNER HEXAGON CONTENT */
.hexIn * {
position: absolute;
visibility: visible;
outline:1px solid transparent; /* fix for jagged edges in FF on hover transition */
position: absolute;
visibility: visible;
outline: 1px solid transparent; /* fix for jagged edges in FF on hover transition */
}

/* HEXAGON LINK STYLES */
.hexLink {
display:block;
display: block;
width: 100%;
height: 100%;
text-align: center;
color: #fff;
overflow: hidden;
-webkit-transform: skewY(-30deg) rotate3d(0,0,1,60deg);
-ms-transform: skewY(-30deg) rotate3d(0,0,1,60deg);
transform: skewY(-30deg) rotate3d(0,0,1,60deg);
transform: skewY(-30deg) rotate3d(0, 0, 1, 60deg);
}




/*** HEX CONTENT **********************************************************************/
/* HEXAGON CONTENT STYLES */
.hex img {
left: -100%;
right: -100%;
width: auto;
height: 100%;
margin: 0 auto;
left: -100%;
right: -100%;
width: auto;
height: 100%;
margin: 0 auto;
}

.hex h1, .hex p {
width: 100%;
padding: 5%;
box-sizing:border-box;
font-weight: 300;
opacity: 0;
.hex h1,
.hex p {
width: 100%;
padding: 5%;
box-sizing: border-box;
font-weight: 300;
opacity: 0;
}

/* HEXAGON CONTENT ANIMATIONS */
#demo1 {
color: #F5CE95;
text-transform: capitalize;
color: #F5CE95;
text-transform: capitalize;
text-align: center;
bottom: 50%;
padding-top: 50%;
font-size: 1.5em;
z-index: 1;
}

.hex h1:before,
.hex h1:after {
display: inline-block;
margin: 0 0.5em;
width: 0.25em;
height: 0.03em;
background: #ffffff;
content: '';
vertical-align: middle;
transition: all 0.3s;
text-align: center;
bottom: 50%;
padding-top:50%;
font-size: 1.5em;
z-index: 1;
}
.hex h1:before, .hex h1:after {
display: inline-block;
margin: 0 0.5em;
width: 0.25em;
height: 0.03em;
background: #ffffff;
content: '';
vertical-align: middle;
transition: all 0.3s;
text-align:center;
}

#demo2 {
top: 50%;
text-align: center;
text-transform: uppercase;

top: 50%;
text-align: center;
text-transform: uppercase;
}

/* HEXAGON IMAGE MASK */
.img {
position: absolute;
top: 0;
right: 0;
bottom: 0;
left: 0;
background-position: center center;
background-size: cover;
overflow: hidden;
-webkit-clip-path: polygon(50% 0%, 100% 25%, 100% 75%, 50% 100%, 0% 75%, 0% 25%);
clip-path: polygon(50% 0%, 100% 25%, 100% 75%, 50% 100%, 0% 75%, 0% 25%);
}

.img:before, .img:after {
position: absolute;
top: 0;
right: 0;
bottom: 0;
left: 0;
content: '';
opacity: 0;
transition: opacity 0.5s;
}
.img:before {
background: rgb(255, 255, 255)
position: absolute;
top: 0;
right: 0;
bottom: 0;
left: 0;
background-position: center center;
background-size: cover;
overflow: hidden;
clip-path: polygon(50% 0%, 100% 25%, 100% 75%, 50% 100%, 0% 75%, 0% 25%);
}

.img:before,
.img:after {
background: linear-gradient(to top, transparent, rgba(0, 0, 0, 0.5), transparent);
position: absolute;
top: 0;
right: 0;
bottom: 0;
left: 0;
content: '';
opacity: 0;
transition: opacity 0.5s;
}

/*** HOVER EFFECT **********************************************************************/

.img:before {
background: rgb(255, 255, 255);
}

.hexLink:hover h1, .hexLink:focus h1,
.hexLink:hover p, .hexLink:focus p{
opacity:1;
transition: 0.8s;
.img:after {
background: linear-gradient(to top, transparent, rgba(0, 0, 0, 0.5), transparent);
}

/* HOVER EFFECTS */
.hexLink:hover h1,
.hexLink:focus h1,
.hexLink:hover p,
.hexLink:focus p {
opacity: 1;
transition: 0.8s;
}

.hexIn:hover .img:before,
.hexIn:hover .img:after,
.hexIn:hover .hexLink {
opacity: 1;
opacity: 1;
}

/*** HEXAGON SIZING AND EVEN ROW INDENTATION *****************************************************************/
@media (min-width:1201px) { /* <- 5-4 hexagons per row */
#hexGrid{
padding-bottom: 5%
}
.hex {
width: 10%; /* = 100 / 5 */
}
.hex:nth-child(19n+11){ /* first hexagon of even rows */
margin-left:5%; /* = width of .hex / 2 to indent even rows */
}
/* RESPONSIVE MEDIA QUERIES */
@media (min-width: 1201px) {
/* 5-4 hexagons per row */
#hexGrid {
padding-bottom: 5%;
}
.hex {
width: 10%;
}
.hex:nth-child(19n+11) {
/* first hexagon of even rows */
margin-left: 5%;
}
}

@media (max-width: 1200px) and (min-width:901px) { /* <- 4-3 hexagons per row */
#hexGrid{
padding-bottom: 5.5%;
font-size: 13px;
}
.hex {
width: 25%; /* = 100 / 4 */
}
.hex:nth-child(17n+10){ /* first hexagon of even rows */
margin-left:12.5%; /* = width of .hex / 2 to indent even rows */
}
@media (max-width: 1200px) and (min-width: 901px) {
/* 4-3 hexagons per row */
#hexGrid {
padding-bottom: 5.5%;
font-size: 13px;
}
.hex {
width: 25%;
}
.hex:nth-child(17n+10) {
/* first hexagon of even rows */
margin-left: 12.5%;
}
}

@media (max-width: 900px) and (min-width:601px) { /* <- 3-2 hexagons per row */
#hexGrid{
padding-bottom: 7.4%;
font-size: 14px;
}
.hex {
width: 33.333%; /* = 100 / 3 */
}
.hex:nth-child(5n+4){ /* first hexagon of even rows */
margin-left:16.666%; /* = width of .hex / 2 to indent even rows */
}
@media (max-width: 900px) and (min-width: 601px) {
/* 3-2 hexagons per row */
#hexGrid {
padding-bottom: 7.4%;
font-size: 14px;
}
.hex {
width: 33.333%;
}
.hex:nth-child(5n+4) {
/* first hexagon of even rows */
margin-left: 16.666%;
}
}

@media (max-width: 600px) { /* <- 2-1 hexagons per row */
#hexGrid{
padding-bottom: 11.2%;
font-size: 12px;
}
.hex {
width: 50%; /* = 100 / 3 */
}
.hex:nth-child(3n+3){ /* first hexagon of even rows */
margin-left:25%; /* = width of .hex / 2 to indent even rows */
}
@media (max-width: 600px) {
/* 2-1 hexagons per row */
#hexGrid {
padding-bottom: 11.2%;
font-size: 12px;
}
.hex {
width: 50%;
}
.hex:nth-child(3n+3) {
/* first hexagon of even rows */
margin-left: 25%;
}
}

@media (max-width: 400px) {
/* Smaller devices */
#hexGrid {
font-size: 8px;
font-size: 8px;
}
}