<commit_before>import Swiper from "better-react-swiper"
import { graphql, navigate, StaticQuery } from "gatsby"
import Img from "gatsby-image"
import React from "react"
import styled from "styled-components"
import { useWindowWidth } from "../hooks/useWindowWidth"
import IconSearch from "../images/icon-search.svg"
import Arrow from "./Arrow"

const PhotoGalleryWrapper = styled.div`
  display: flex;
  flex-wrap: wrap;
  margin: 0 -8px;

  @media screen and (max-width: 768px) {
    position: relative;
    justify-content: center;
    width: calc(100% + 64px);
    margin: 0 -32px 36px;
  }
`

const Hover = styled.div`
  display: none;
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.25);
`

const Zoom = styled.div`
  display: flex;
  justify-content: center;
  align-items: center;
  position: absolute;
  bottom: 8px;
  right: 8px;
  width: 33px;
  height: 32px;
  background: linear-gradient(180deg, #ff3418 0%, #ca1f08 100%);
  border-radius: 10px;
`

const ZoomIcon = styled(IconSearch)`
  width: 14px;
  fill: #fff;
`

const PhotoWrapper = styled.div`
  flex: 0 0 calc(33.33% - 16px);
  margin: 8px;
  position: relative;
  cursor: pointer;

  &:hover {
    outline: 3px solid #fff;
  }

  &:hover ${Hover} {
    display: block;
  }
`

const PhotoWrapperMobile = styled.div`
  flex: 0 0 calc(100% - 16px);
  margin: 0 8px;
`

const SeeMoreMobile = styled.div`
  cursor: pointer;
  position: absolute;
  top: 100%;
  margin-top: -16px;
  display: flex;
  justify-content: center;
  align-items: center;
  background: linear-gradient(180deg, #ff3418 0%, #ca1f08 100%);
  border-radius: 10px;
  padding: 14px 18px;
  font-weight: 700;
  font-size: 24px;
  line-height: 1;

  svg {
    margin-left: 5px;
    width: 18px;
    fill: #fff;
  }
`

// TODO: extract childImageSharp to fragment?
interface PhotosQuery {
  photos: {
    edges: [
      {<commit_msg>feat: force image gallery to 3/2 ratio<commit_after>import Swiper from "better-react-swiper"
import { graphql, navigate, StaticQuery } from "gatsby"
import Img from "gatsby-image"
import React from "react"
import styled from "styled-components"
import { useWindowWidth } from "../hooks/useWindowWidth"
import IconSearch from "../images/icon-search.svg"
import Arrow from "./Arrow"

const PhotoGalleryWrapper = styled.div`
  display: flex;
  flex-wrap: wrap;
  margin: 0 -8px;

  @media screen and (max-width: 768px) {
    position: relative;
    justify-content: center;
    width: calc(100% + 64px);
    margin: 0 -32px 36px;
  }
`

const Hover = styled.div`
  display: none;
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.25);
`

const Zoom = styled.div`
  display: flex;
  justify-content: center;
  align-items: center;
  position: absolute;
  bottom: 8px;
  right: 8px;
  width: 33px;
  height: 32px;
  background: linear-gradient(180deg, #ff3418 0%, #ca1f08 100%);
  border-radius: 10px;
`

const ZoomIcon = styled(IconSearch)`
  width: 14px;
  fill: #fff;
`

const PhotoWrapper = styled.div`
  flex: 0 0 calc(33.33% - 16px);
  margin: 8px;
  position: relative;
  cursor: pointer;

  .gatsby-image-wrapper > div {
    padding-bottom: 66.6666% !important;
  }

  &:hover {
    outline: 3px solid #fff;
  }

  &:hover ${Hover} {
    display: block;
  }
`

const PhotoWrapperMobile = styled.div`
  flex: 0 0 calc(100% - 16px);
  margin: 0 8px;

  .gatsby-image-wrapper > div {
    padding-bottom: 66.6666% !important;
  }
`

const SeeMoreMobile = styled.div`
  cursor: pointer;
  position: absolute;
  top: 100%;
  margin-top: -16px;
  display: flex;
  justify-content: center;
  align-items: center;
  background: linear-gradient(180deg, #ff3418 0%, #ca1f08 100%);
  border-radius: 10px;
  padding: 14px 18px;
  font-weight: 700;
  font-size: 24px;
  line-height: 1;

  svg {
    margin-left: 5px;
    width: 18px;
    fill: #fff;
  }
`

// TODO: extract childImageSharp to fragment?
interface PhotosQuery {
  photos: {
    edges: [
      {
{'fraction_non_alphanumeric': 0.13462976813762154, 'fraction_numerical': 0.054350536025928695, 'mean_word_length': 3.341991341991342, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '340454', 'n_tokens_mistral': 1675, 'n_tokens_neox': 1475, 'n_words': 412}