Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
ba44fd6
Agregar boton y autor a quote, opcion de video o imagen
drina-bitlogic Apr 4, 2022
cbd1b2b
Modificar quote para que acepte video youtube
drina-bitlogic Apr 6, 2022
fe01281
Cambiar orden de la data
drina-bitlogic Apr 6, 2022
c0faedb
Merge branch 'SBIT-74' of https://github.com/bitlogic/bitlogic.io int…
julsh21 Apr 7, 2022
7a19341
Merge branch 'dev' of https://github.com/bitlogic/bitlogic.io into SB…
julsh21 Apr 8, 2022
537ea83
fix expanded grid
benjacanas Apr 8, 2022
88c8f92
fix video style
julsh21 Apr 11, 2022
2278f0e
Merge pull request #138 from bitlogic/SBIT-85-fix
julsh21 Apr 11, 2022
bef58d5
Merge branch 'dev' of https://github.com/bitlogic/bitlogic.io into SB…
julsh21 Apr 11, 2022
5ddf084
Merge pull request #140 from bitlogic/SBIT-93
drina-bitlogic Apr 11, 2022
e6b78fe
expanded grid title y ver mas
benjacanas Apr 11, 2022
8b771af
console log
benjacanas Apr 11, 2022
c922514
Agregar bgImage al componente Text
drina-bitlogic Apr 11, 2022
6d8f550
Merge branch 'dev' into SBIT-91
drina-bitlogic Apr 11, 2022
0bd60d0
Merge pull request #141 from bitlogic/SBIT-85-fix
julsh21 Apr 11, 2022
6d52384
Merge pull request #142 from bitlogic/SBIT-91
marino-martin Apr 11, 2022
a63463b
Validar que hay bgImage
drina-bitlogic Apr 11, 2022
839dd41
validar bgImage
drina-bitlogic Apr 11, 2022
7fd9296
fix expanded grid
benjacanas Apr 11, 2022
a0c5201
Merge pull request #143 from bitlogic/SBIT-91
marino-martin Apr 11, 2022
0a7573f
code smell
benjacanas Apr 11, 2022
f25e291
Merge pull request #144 from bitlogic/SBIT-85-fix2
marino-martin Apr 11, 2022
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
1 change: 0 additions & 1 deletion src/components/BannerHead/BannerHead.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ import { getImage, GatsbyImage } from "gatsby-plugin-image"
import { useTheme } from "../../context/themeContext"

const BannerHead = ({ data }) => {
console.log(data)
const { theme } = useTheme()

const title = data?.title
Expand Down
39 changes: 26 additions & 13 deletions src/components/Text/Text.js
Original file line number Diff line number Diff line change
@@ -1,20 +1,33 @@
import React from 'react';
import MarkdownView from "react-showdown";
import './Text.scss';
import React from "react"
import MarkdownView from "react-showdown"
import "./Text.scss"

export default function Text({ data }) {
console.log(data)
const title = data?.title;
const description = data?.text;
const title = data?.title
const description = data?.text
const bgImage = data?.backgroundImage?.url

return (
<div className="text container py-3 d-flex flex-column flex-lg-row">

{title && (
<h2 className="title me-3 mt-5 p-lg-2">{title}</h2>
)}
{description && (
<MarkdownView markdown={description} className="description px-lg-5" />
<div className="container-text">
{title !== "" && title !== undefined && title !== null ? (
<div className="text d-flex flex-column flex-md-row">
<div
className="title"
style={{
backgroundImage: `url(${bgImage})`,
}}
>
<h2 className="titleText pt-5 ps-4 pe-md-3">{title}</h2>
</div>
<MarkdownView
markdown={description}
className="description ps-4 px-lg-5"
/>
</div>
) : (
<MarkdownView markdown={description} className="px-lg-5" id="descriptionText" style={{
backgroundImage: `url(${bgImage})`,
}} />
)}
</div>
)
Expand Down
65 changes: 64 additions & 1 deletion src/components/Text/Text.scss
Original file line number Diff line number Diff line change
@@ -1,8 +1,71 @@
@import "../../styles/global.scss";

.text {
color: $primary;
margin-bottom: 50px;
.title {
text-transform: uppercase;
width: 100%;
min-height: 150px;
max-height: 65vh;
padding-top: 55px;
}
.description {
min-height: 60vh;
padding-top: 40px;
}
}

@media screen and (min-width: $breakpoint-md) {
.text {
.description {
padding-top: 55px;
}
}
}

@media screen and (min-width: $breakpoint-xl) {
.text {
.title {
max-height: 60vh;

.titleText {
max-width: 30vw;
padding-left: 5rem !important;
}
}
.description {
padding-top: 70px;
max-width: 60vw;
max-height: 55vh;
padding-right: 10rem !important;
}
}
}

#descriptionText {
height: 70vh;
margin-bottom: 50px;
display: flex;
align-items: center;

p {
background-color: #ffffff;
padding: 2em 1em;
margin: 1em 1em 0;
border-radius: 20px;
}
}

@media screen and (min-width: $breakpoint-md) {
#descriptionText {
max-height: 60vh;
}
}

@media screen and (min-width: $breakpoint-xl) {
#descriptionText {
p {
padding: 3em 3em;
}
}
}
36 changes: 21 additions & 15 deletions src/components/expandGrid/ExpandGrid.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import React, { useEffect, useRef, useState } from "react"
import { Link } from "gatsby"
import React, { useEffect, useState } from "react"
import { Flipper, Flipped } from "react-flip-toolkit"
import MarkdownView from "react-showdown"
import "./expandGrid.scss"
Expand All @@ -13,7 +14,7 @@ const ExpandGrid = ({ data }) => {
<div className="expandGrid-body">
<h2>{data.title}</h2>
<h6 className="px-5">{data.subtitle}</h6>
<AnimatedList items={data.items.slice(0,4)} />
<AnimatedList items={data.items.slice(0, 4)} />
</div>
</section>
</div>
Expand All @@ -35,9 +36,9 @@ const ListItem = ({ index, onClick, data }) => {
<div className="listItem" onClick={() => onClick(index)}>
<Flipped inverseFlipId={createCardFlipId(index)}>
<div className="listItemContent">
<div className="listItem-more">
<p>Ver mas</p>
</div>
<div className="listItem-more">
<h4>{data.title}</h4>
</div>
<Flipped
flipId={`avatar-${index}`}
stagger="card-image"
Expand All @@ -53,7 +54,7 @@ const ListItem = ({ index, onClick, data }) => {
)
}

const ExpandedListItem = ({ index, data }) => {
const ExpandedListItem = ({ index, data, isFirst }) => {
return (
<Flipped
flipId={createCardFlipId(index)}
Expand All @@ -64,13 +65,11 @@ const ExpandedListItem = ({ index, data }) => {
}, 400)
}}
>
<div
className="listItem-expanded"
>
<div className="listItem-expanded">
<Flipped inverseFlipId={createCardFlipId(index)}>
<div className="listItemContent-expanded">
<div className="listItem-more-expanded">
<p ></p>
<p></p>
</div>
<Flipped
flipId={`avatar-${index}`}
Expand All @@ -79,9 +78,16 @@ const ExpandedListItem = ({ index, data }) => {
>
<img alt="" src={data.image?.url} className="avatar-expanded" />
</Flipped>
<div className="additional-content">
<div>
<div

className={"additional-content "}
>
<div style={isFirst ? {opacity: "1"} : {}}>
<h4>{data.title}</h4>
<MarkdownView markdown={data.text} />
{data.landing_page && (
<Link to={"/" + data.landing_page.slug}>Ver más</Link>
)}
</div>
</div>
</div>
Expand All @@ -93,7 +99,7 @@ const ExpandedListItem = ({ index, data }) => {

const AnimatedList = ({ items }) => {
const [itemsArray, setItemsArray] = useState({ items, focused: null })

const [isFirst, setIsFirst] = useState(true)
useEffect(() => {
setItemsArray(prev => ({ ...prev, focused: items[0].id }))
}, [])
Expand All @@ -102,6 +108,7 @@ const AnimatedList = ({ items }) => {
for (let i = 0; i < items.length; i++) {
const item = itemsArray.items[i]
if (item.id === index) {
setIsFirst(false)
setItemsArray(prevItems => ({
items: [
item,
Expand All @@ -114,8 +121,6 @@ const AnimatedList = ({ items }) => {
}
}
}


return (
<Flipper
flipKey={itemsArray.focused}
Expand All @@ -134,6 +139,7 @@ const AnimatedList = ({ items }) => {
<>
{item.id === itemsArray.focused ? (
<ExpandedListItem
isFirst={isFirst}
index={itemsArray.focused}
data={item}
/>
Expand Down
27 changes: 20 additions & 7 deletions src/components/expandGrid/expandGrid.scss
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
display: flex;
flex-direction: row;
flex-wrap: wrap;
padding: 0 5em;
padding: 0 2em;
width: 100%;
}

Expand All @@ -40,7 +40,7 @@
&-focus {
flex: 0 1 calc(calc(100% / 3) - 10px);
}
background-color: rgba(180, 180, 180, 0.24);
background-color: rgba(255, 255, 255, 0.158);
cursor: pointer;

@media screen and (max-width: $breakpoint-xxl) {
Expand Down Expand Up @@ -116,16 +116,16 @@

.listItem-more{
position: absolute;
inset: 0 0 0 0;
inset: 0 0 20px 20px;
display: flex;
align-items: center;
justify-content: center;
align-items: flex-end;
justify-content: baseline;
transition: opacity 200ms ease;
opacity: 1;
color: black;
p{
padding: 0;
margin: 0;
@include primaryBtn;
}
&-expanded{
@extend .listItem-more;
Expand All @@ -137,7 +137,20 @@
.additional-content > div {
opacity: 0;
border-radius: 3px;
height: 5rem;
display: flex;
flex-direction: column;
height: 100%;
p {
max-height: 10vw;
overflow: hidden;
text-overflow: ellipsis;
}
a{
font-weight: 600;
color: $secondary;
text-decoration: underline;
margin: auto 0 10px 10px;
}
h4 {
text-align: left;
}
Expand Down
Loading