-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #4392 from Savio629/handbook
[UX] Graphic Design: Create a Layer5-branded 3D book to represent the Community Handbook
- Loading branch information
Showing
5 changed files
with
143 additions
and
3 deletions.
There are no files selected for viewing
30 changes: 30 additions & 0 deletions
30
src/sections/Community/Handbook/BookComponent/BookComponent.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
import React, { useEffect } from 'react'; | ||
import BookComponentWrapper from "./BookComponent.style"; | ||
import handbookdark from "../images/handbook-dark.webp"; | ||
import { Link } from 'gatsby'; | ||
|
||
const BookComponent = () => { | ||
useEffect(() => { | ||
const bookElement = document.querySelector('.book'); | ||
bookElement.classList.add('rot-on-rel'); | ||
}, []); | ||
return ( | ||
<BookComponentWrapper> | ||
<Link | ||
className="book-container" | ||
to="/community/handbook" | ||
target="_blank" | ||
rel="noreferrer noopener" | ||
> | ||
<div className="book"> | ||
<img | ||
alt="Community HandBook" | ||
src={handbookdark} | ||
/> | ||
</div> | ||
</Link> | ||
</BookComponentWrapper> | ||
); | ||
}; | ||
|
||
export default BookComponent; |
97 changes: 97 additions & 0 deletions
97
src/sections/Community/Handbook/BookComponent/BookComponent.style.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,97 @@ | ||
import styled from "styled-components"; | ||
|
||
const BookComponentWrapper = styled.div` | ||
.book-container { | ||
display: flex; | ||
align-items: center; | ||
justify-content: center; | ||
perspective: 600px; | ||
} | ||
@keyframes initAnimation { | ||
0% { | ||
transform: rotateY(0deg); | ||
} | ||
100% { | ||
transform: rotateY(-30deg); | ||
} | ||
} | ||
.rot-on-rel { | ||
transform: rotateY(0deg); | ||
} | ||
.book { | ||
min-width: 200px; | ||
min-height: 300px; | ||
position: relative; | ||
transform-style: preserve-3d; | ||
transform: rotateY(-30deg); | ||
transition: 1s ease; | ||
animation: 1s ease 0s 1 initAnimation; | ||
} | ||
.book:hover { | ||
transform: rotateY(0deg); | ||
} | ||
.book > :first-child { | ||
position: absolute; | ||
top: 0; | ||
left: 0; | ||
background-color: red; | ||
width: 200px; | ||
height: 300px; | ||
transform: translateZ(25px); | ||
background-color: #171a12; | ||
border-radius: 0 2px 2px 0; | ||
} | ||
.book::before { | ||
position: absolute; | ||
content: ' '; | ||
left: 0; | ||
top: 3px; | ||
width: 48px; | ||
height: 294px; | ||
transform: translateX(172px) rotateY(90deg); | ||
background: linear-gradient(90deg, | ||
#fff 0%, | ||
#f9f9f9 5%, | ||
#fff 10%, | ||
#f9f9f9 15%, | ||
#fff 20%, | ||
#f9f9f9 25%, | ||
#fff 30%, | ||
#f9f9f9 35%, | ||
#fff 40%, | ||
#f9f9f9 45%, | ||
#fff 50%, | ||
#f9f9f9 55%, | ||
#fff 60%, | ||
#f9f9f9 65%, | ||
#fff 70%, | ||
#f9f9f9 75%, | ||
#fff 80%, | ||
#f9f9f9 85%, | ||
#fff 90%, | ||
#f9f9f9 95%, | ||
#fff 100% | ||
); | ||
} | ||
.book::after { | ||
position: absolute; | ||
top: 0; | ||
left: 0; | ||
content: ' '; | ||
width: 200px; | ||
height: 300px; | ||
transform: translateZ(-25px); | ||
background-color: #292929; | ||
border-radius: 0 2px 2px 0; | ||
box-shadow: -2px 1px 30px 2px #666; | ||
} | ||
`; | ||
|
||
export default BookComponentWrapper; |
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters