UNPKG

1gallery

Version:

a modern SEO friendly ejs web banner gallery for any kind of slides (photos, html...)

210 lines (209 loc) 3.72 kB
._1gallery { width: 100%; overflow: auto; position: relative; box-sizing: border-box; } ._1gallery * { box-sizing: border-box; } ._1gallery .slideArea { height: 100%; position: absolute; display: flex; } ._1gallery.smooth .slideArea { transition: all 0.9s ease; } ._1gallery >.prev, ._1gallery >.next, ._1gallery >.cardCounter, ._1gallery >.zoom { display: none; } ._1gallery.js { overflow: hidden; } ._1gallery.js >.prev, ._1gallery.js >.next, ._1gallery.js >.cardCounter, ._1gallery.js >.zoom { display: flex; position: absolute; align-items: center; justify-content: space-evenly; user-select: none; } ._1gallery.js >.prev, ._1gallery.js >.next { top: 50%; width: 10%; font-size: 200%; border-radius: 100%; text-decoration: none; user-select: none; color: #666; } ._1gallery.js >.prev:hover, ._1gallery.js >.next:hover { cursor: pointer; color: #222; background-color: rgba(255,255,255,0.3); } ._1gallery.js >.prev:hover > *, ._1gallery.js >.next:hover > * { transform: scale(1.2); } ._1gallery.js >.prev span, ._1gallery.js >.next span { display: block; } ._1gallery.js >.prev { left: 20px; } ._1gallery.js >.next { right: 20px; } ._1gallery.banner { height: 150px; } ._1gallery .card { margin: 0 5px; height: 100%; max-width: 100%; display: flex; align-items: center; justify-content: center; position: relative; object-fit: contain; overflow: hidden; flex: 1; } ._1gallery .card.ratio { flex: none; } ._1gallery .card.cover { object-fit: cover; } ._1gallery .card .cardContent { object-fit: contain; overflow: hidden; max-width: 100%; box-sizing: border-box; margin: 0; } ._1gallery .card .cardContentimg { user-select: none; pointer-events: none; } ._1gallery .card .cardContent img { user-select: none; pointer-events: none; } ._1gallery .card .cardContent.cover { object-fit: cover; } ._1gallery .card .cardContent[class*="ratio"] { position: absolute; top: 0; left: 0; right: 0; bottom: 0; max-height: 100%; max-width: 100%; } ._1gallery .card .ratio-helper { display: block; width: auto; height: 100%; } ._1gallery.js .card { flex: none; } ._1gallery.js .card .cardContent { position: initial; } ._1gallery.js .card .ratio-helper { display: none; } ._1gallery.smooth .card { cursor: grab; } ._1gallery .card { cursor: ew-resize; } ._1gallery > .cardCounter { left: 50%; bottom: 5px; text-align: center; width: 250px; margin-left: -125px; height: 20px; color: #666; } ._1gallery > .cardCounter a { text-decoration: none; color: #666; font-weight: bold; user-select: none; cursor: pointer; display: inline-block; padding: 0 10px; } ._1gallery > .cardCounter a:hover { transform: scale(1.2); } ._1gallery > .cardCounter .dot { opacity: 0.3; background-color: #222; box-shadow: 0 0 10px #fff; border-radius: 100%; padding: 8px; } ._1gallery > .cardCounter .dot.active { opacity: 0.9; } ._1gallery .cardContent.dummy { display: flex; align-items: center; justify-content: center; font-size: 300%; font-family: sans-serif; } ._1gallery .cardContent.dummy.cover { width: 100vw; height: 100vh; } ._1gallery.splash { height: 100vh; } ._1gallery>.zoom { left: 50%; top: 0; width: 50px; height: 50px; margin-left: -25px; line-height: 50px; text-align: center; font-size: 200%; text-decoration: none; user-select: none; } ._1gallery>.zoom:hover { cursor: pointer; transform: scale(1.2); } ._1gallery.fullScreen { position: fixed; top: 0; left: 0; right: 0; bottom: 0; z-index: 10; } ._1gallery.fullScreen .card { width: 100vw; } ._1gallery.fullScreen .card .cardContent { overflow: auto; }