Components /
Video Gallery

Theme: 
default
Info page
Compatible with: 
Any CSS framework
Copy:

HTML

CSS
View code

Download




/* -------------------------------- 

File#: _3_video-gallery
Title: Video Gallery
Descr: A list of video previews opening a modal window
Usage: codyhouse.co/license

-------------------------------- */
/* reset */
*, *::after, *::before {
  box-sizing: border-box;
}

* {
  font: inherit;
  margin: 0;
  padding: 0;
  border: 0;
}

body {
  background-color: hsl(0, 0%, 100%);
  font-family: system-ui, sans-serif;
  color: hsl(230, 7%, 23%);
  font-size: 1rem;
}

h1, h2, h3, h4 {
  line-height: 1.2;
  color: hsl(230, 13%, 9%);
  font-weight: 700;
}

h1 {
  font-size: 2.0736rem;
}

h2 {
  font-size: 1.728rem;
}

h3 {
  font-size: 1.25rem;
}

h4 {
  font-size: 1.2rem;
}

ol, ul, menu {
  list-style: none;
}

button, input, textarea, select {
  background-color: transparent;
  border-radius: 0;
  color: inherit;
  line-height: inherit;
  appearance: none;
}

textarea {
  resize: vertical;
  overflow: auto;
  vertical-align: top;
}

a {
  color: hsl(250, 84%, 54%);
}

table {
  border-collapse: collapse;
  border-spacing: 0;
}

img, video, svg {
  display: block;
  max-width: 100%;
}

@media (min-width: 64rem) {
  body {
    font-size: 1.25rem;
  }

  h1 {
    font-size: 3.051rem;
  }

  h2 {
    font-size: 2.44rem;
  }

  h3 {
    font-size: 1.75rem;
  }

  h4 {
    font-size: 1.5625rem;
  }
}

/* variables */
:root {
  /* colors */
  --vu0-color-primary-hsl: 250, 84%, 54%;
  --vu0-color-contrast-low-hsl: 240, 4%, 65%;
  --vu0-color-contrast-high-hsl: 230, 7%, 23%;
  --vu0-color-contrast-higher-hsl: 230, 13%, 9%;
  --vu0-color-bg-hsl: 0, 0%, 100%;
  --vu0-color-black-hsl: 230, 13%, 9%;
  --vu0-color-white-hsl: 0, 0%, 100%;

  /* spacing */
  --vu0-space-4xs: 0.125rem;
  --vu0-space-sm: 0.75rem;
  --vu0-space-md: 1.25rem;
  --vu0-space-xl: 3.25rem;
  --vu0-space-2xl: 5.25rem;

  /* typography */
  --vu0-text-base: 1rem;
  --vu0-text-sm: 0.833rem;
}

@media(min-width: 64rem){
  :root {
    /* spacing */
    --vu0-space-4xs: 0.1875rem;
    --vu0-space-sm: 1.125rem;
    --vu0-space-md: 2rem;
    --vu0-space-xl: 5.125rem;
    --vu0-space-2xl: 8.25rem;

    /* typography */
    --vu0-text-base: 1.25rem;
    --vu0-text-sm: 1rem;
  }
}

/* icons */
.vu0-icon {
  height: var(--vu0-size, 1em);
  width: var(--vu0-size, 1em);
  display: inline-block;
  color: inherit;
  fill: currentColor;
  line-height: 1;
  flex-shrink: 0;
  max-width: initial;
}

.vu0-icon--sm {
  --vu0-size: 24px;
}

.vu0-icon--lg {
  --vu0-size: 48px;
}

.vu0-icon--is-spinning {
  animation: vu0-icon-spin 1s infinite linear;
}

@keyframes vu0-icon-spin {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(360deg);
  }
}

/* component */
.video-gallery {
  position: relative;
  z-index: 1;
  padding: var(--vu0-space-2xl) 0;
}

.video-gallery__container {
  width: calc(100% - 2*var(--vu0-space-md));
  margin-left: auto;
  margin-right: auto;
  max-width: 32rem;
}

@media(min-width: 48rem) {
  .video-gallery__container {
    max-width: 48rem;
  }
}

@media(min-width: 64rem) {
  .video-gallery__container {
    max-width: 64rem;
  }
}

@media(min-width: 80rem) {
  .video-gallery__container {
    max-width: 80rem;
  }
}

.video-gallery__title {
  margin-bottom: var(--vu0-space-xl);
  text-align: center;
}

.video-gallery__grid {
  display: grid;
  gap: var(--vu0-space-md);
}

@media(min-width: 48rem) {
  .video-gallery__grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media(min-width: 64rem) {
  .video-gallery__grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

.video-card__modal-control {
  display: block;
  color: inherit;
  text-decoration: none;
  position: relative;
  margin-bottom: var(--vu0-space-sm);
}

.video-card__modal-control:hover .video-card__preview {
  -webkit-filter: contrast(110%);
          filter: contrast(110%);
  box-shadow: 0 0.9px 1.5px hsla(var(--vu0-color-black-hsl), 0.03),0 3.1px 5.5px hsla(var(--vu0-color-black-hsl), 0.08),0 14px 25px hsla(var(--vu0-color-black-hsl), 0.12);
}

.video-card__modal-control:hover .video-card__play-btn::before {
  -webkit-transform: scale(1.2);
          transform: scale(1.2);
}

.video-card__preview {
  display: block;
  width: 100%;
  aspect-ratio: 4/3;
  -o-object-fit: cover;
     object-fit: cover;
  border-radius: 0.75em;
  box-shadow: 0 0.3px 0.4px hsla(var(--vu0-color-black-hsl), 0.025),0 0.9px 1.5px hsla(var(--vu0-color-black-hsl), 0.05), 0 3.5px 6px hsla(var(--vu0-color-black-hsl), 0.1);
  transition: box-shadow 0.3s, -webkit-filter 0.3s;
  transition: filter 0.3s, box-shadow 0.3s;
  transition: filter 0.3s, box-shadow 0.3s, -webkit-filter 0.3s;
}

.video-card__play-btn {
  position: absolute;
  width: 100%;
  height: 100%;
  top: 0;
  left: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: hsl(var(--vu0-color-white-hsl));
}

.video-card__play-btn .vu0-icon {
  position: relative;
  z-index: 1;
}

.video-card__play-btn::before {
  content: "";
  position: absolute;
  width: 60px;
  height: 60px;
  top: calc(50% - 30px);
  left: calc(50% - 30px);
  background-color: hsla(var(--vu0-color-black-hsl), 0.8);
  border-radius: 50%;
  transition: -webkit-transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1), -webkit-transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.video-card__title {
  font-size: var(--vu0-text-base);
  margin-bottom: var(--vu0-space-4xs);
}

.video-card__duration {
  font-size: var(--vu0-text-sm);
  color: hsl(var(--vu0-color-contrast-low-hsl));
}

/* utility classes */
:where(.vu0-media-wrapper-16\:9) {
  position: relative;
  height: 0;
}

.vu0-media-wrapper-16\:9 {
  padding-bottom: 56.25%;
}

.vu0-media-wrapper-16\:9 > * {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
}

.vu0-media-wrapper-16\:9 > *:not(iframe) {
  object-fit: cover;
}

.vu0-sr-only {
  position: absolute;
  clip: rect(1px, 1px, 1px, 1px);
  clip-path: inset(50%);
  width: 1px;
  height: 1px;
  overflow: hidden;
  padding: 0;
  border: 0;
  white-space: nowrap;
}

.vu0-shadow-md {
  box-shadow:0 0.9px 1.5px hsla(var(--vu0-color-black-hsl), 0.03),0 3.1px 5.5px hsla(var(--vu0-color-black-hsl), 0.08),0 14px 25px hsla(var(--vu0-color-black-hsl), 0.12);
}

.vu0-overflow-auto {
  overflow: auto;
}

.vu0-max-height-100\% {
  max-height: 100%;
}

.vu0-max-width-md {
  max-width: 64rem;
}

.vu0-width-100\% {
  width: 100%;
}

.vu0-padding-x-md {
  padding-left: var(--vu0-space-md);
  padding-right: var(--vu0-space-md);
}

.vu0-flex-center {
  justify-content: center;
  align-items: center;
}

.vu0-flex {
  display: flex;
}

.vu0-bg-black {
  --vu0-bg-o: 1;
  background-color: hsla(var(--vu0-color-black-hsl), var(--vu0-bg-o, 1));
}

.vu0-color-bg {
  --vu0-color-o: 1;
  color: hsla(var(--vu0-color-bg-hsl), var(--vu0-color-o, 1));
}

.vu0-bg-opacity-90\% {
  --vu0-bg-o: 0.9;
}

Copy CSS