All Projects → web-tiki → Responsive Grid Of Hexagons

web-tiki / Responsive Grid Of Hexagons

Licence: apache-2.0
CSS responsive grid of hexagons

Projects that are alternatives of or similar to Responsive Grid Of Hexagons

Livecoding.tw
官網
Stars: ✭ 42 (-91.27%)
Mutual labels:  html5, css3, html-css
Flexy
Flexy is minimal CSS framework made with Flex
Stars: ✭ 114 (-76.3%)
Mutual labels:  html5, css3, html-css
Frontend Mentor Challenge
Here you will find all the challenges that we took from frontend-mentor.
Stars: ✭ 47 (-90.23%)
Mutual labels:  html5, website, css3
Pure Css3 Animated Border
Pure CSS3 animated border for all html element.
Stars: ✭ 63 (-86.9%)
Mutual labels:  html5, css3, html-css
Katana
Katana is CSS Layout System made with Flexbox
Stars: ✭ 57 (-88.15%)
Mutual labels:  css3, css-grid, html-css
Online Bling
Stars: ✭ 9 (-98.13%)
Mutual labels:  html5, website, css3
Portfolio one Page Template
Free responsive one page portfolio template
Stars: ✭ 106 (-77.96%)
Mutual labels:  html5, website, css3
Gaintime
GainTime é um framework de HTML, CSS e JS para desenvolvimento de projetos responsivos, focado na simplicidade.
Stars: ✭ 19 (-96.05%)
Mutual labels:  html5, website, css3
Samsara
☸️ Continuous UI
Stars: ✭ 1,051 (+118.5%)
Mutual labels:  layout, html5, css3
Driveway
pure CSS masonry layouts
Stars: ✭ 607 (+26.2%)
Mutual labels:  layout, html5, css3
Front End Daily Challenges
As of October 2020, 170+ works have been accomplished, challenge yourself each day!
Stars: ✭ 598 (+24.32%)
Mutual labels:  layout, html5, css3
unitscss
UNITS is a simple and beautiful CSS component set.
Stars: ✭ 13 (-97.3%)
Mutual labels:  website, css3, css-grid
spotify-true-random
🔀 An application for unbiased truly random playlist and library shuffling with Spotify.
Stars: ✭ 51 (-89.4%)
Mutual labels:  website, css3, html-css
anniew.xyz
My Personal Website / Portfolio
Stars: ✭ 41 (-91.48%)
Mutual labels:  website, css3, html-css
Theme Ad
🔨 Art design theme for write and show.
Stars: ✭ 262 (-45.53%)
Mutual labels:  html5, css3
Front Ui
😄 🎨 Collect some front-end special effects (收集一些前端特效)
Stars: ✭ 259 (-46.15%)
Mutual labels:  html5, css3
Dynamic effect
平时练习的一些前端动效,基于HTML5,CSS3,Canvas,Svg
Stars: ✭ 264 (-45.11%)
Mutual labels:  html5, css3
Theannoyingsite.com
The Annoying Site a.k.a. "The Power of the Web Platform"
Stars: ✭ 446 (-7.28%)
Mutual labels:  html5, website
Get Me Through
A Free, Offline, Real-Time, Open-source web-app to assist organisers of any event in allowing only authorised/invited people using Face-Recognition Technology or QR Code.
Stars: ✭ 255 (-46.99%)
Mutual labels:  html5, css3
Saltgui
A web interface for managing SaltStack based infrastructure.
Stars: ✭ 278 (-42.2%)
Mutual labels:  html5, html-css

CSS and HTML responsive grid of hexagons.

View live demo

Responsive grid of hexagons demo

Flexbox vs CSS grid

This branch uses flexbox to layout the hexagons. Another version using CSS grid layout is availbale on the css-grid branch.
CSS grid has lower browser support than flexbox (see canIuse) but makes the hexagon spacing easier to understand and work with.

Features

  • The hexagon grid is responsive according to the width of the container (#hexGrid)
  • Hexagons keep their aspect ratio according to their width
  • The number of hexagons per row is adaptive and changes from 5 to 2 on media query break points
  • A title and short text slide in on hexagon hover and focus
  • Hexagons and can be cycled through with tab (keyboard navigation)

Text and hover effect:

The CSS for the text and hover effect is identified in the hexagons.css stylesheet. You can remove it completely or change the hover effect, font, font-size...

Changing the number of hexagons per row:

The width of the .hex elements defines the number of hexagons per row. The CSS properties that need to be changed are all in the media queries under the HEXAGON SIZING AND EVEN ROW INDENTATION comment.
Each media query changes the number of hexagons per row.

To change the number of hexagons per row, you need to:

Width of .hex

Customize the with of the .hex elements with:

w = width of the .hex elements in percent
x = the number of hexagons you want on the odd rows (1st, 3rd, 5th...)

w = 100 / x

Example for 8 hexagons on odd rows (this means there will be 7 hexagons on even rows):

w = 100 / 8 = 12.5%

Indent even rows

The even rows (2nd, 4th,6th...) are indented with margin-left on the first hexagon of even rows.

The selector:
You can select that hexagon with the .hex:nth-child(an+b) selector (more info on on the nth-child() pseudo-class on MDN). To determine the selector, you can use this rule:

.hex:nth-child(an+b)

x = the number of hexagons on odd rows(1st, 3rd, 5th...)
Y = the number of hexagons on even rows(2nd, 4th, 6th...)
a = x + y
b = x + 1

Example for 8 hexagons on odd rows (this means there will be 7 hexagons on even rows):

x = 8
y = 7
a = 8 + 7 = 15
b = 8 + 1 = 9

The selector is : .hex:nth-child(15n+9)

Value of margin-left:
The value of margin left is half the width of one hexagon so for 8 hexagons on odd row :

with of hexagons = 12.5% (see "width of .hex")
margin-left = 12.5 / 2 = 6.25%

Created by web-tiki

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].