-
Notifications
You must be signed in to change notification settings - Fork 106
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
288 additions
and
7 deletions.
There are no files selected for viewing
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,72 @@ | ||
import React from "react"; | ||
import styled from "styled-components"; | ||
import { LinearGradient } from "expo"; | ||
|
||
const CourseSection = props => ( | ||
<Container> | ||
<Mask> | ||
<Image source={props.image} /> | ||
<LinearGradient | ||
colors={["rgba(0, 0, 0, 0)", "rgba(0, 0, 0, 0.5)"]} | ||
style={{ | ||
position: "absolute", | ||
width: "100%", | ||
height: "100%" | ||
}} | ||
/> | ||
<LinearGradient | ||
colors={["#3399ff", "#33e1ff"]} | ||
start={[0, 0]} | ||
end={[1, 0]} | ||
style={{ | ||
position: "absolute", | ||
bottom: 0, | ||
height: 4, | ||
borderRadius: 2, | ||
width: props.progress * 100 + "%" | ||
}} | ||
/> | ||
<Border /> | ||
<Text>{props.title}</Text> | ||
</Mask> | ||
</Container> | ||
); | ||
|
||
export default CourseSection; | ||
|
||
const Container = styled.View` | ||
width: 150px; | ||
height: 150px; | ||
border-radius: 10px; | ||
box-shadow: 0 5px 10px rgba(0, 0, 0, 0.15); | ||
`; | ||
|
||
const Mask = styled.View` | ||
height: 100%; | ||
border-radius: 10px; | ||
background: #3c4560; | ||
overflow: hidden; | ||
justify-content: flex-end; | ||
margin-left: 20px; | ||
`; | ||
|
||
const Image = styled.Image` | ||
width: 100%; | ||
height: 100%; | ||
position: absolute; | ||
`; | ||
|
||
const Text = styled.Text` | ||
font-size: 15px; | ||
font-weight: 600; | ||
color: white; | ||
margin: 16px; | ||
`; | ||
|
||
const Border = styled.View` | ||
position: absolute; | ||
width: 100%; | ||
height: 100%; | ||
border: 1px solid rgba(255, 255, 255, 0.1); | ||
border-radius: 10px; | ||
`; |
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,69 @@ | ||
import React from "react"; | ||
import styled from "styled-components"; | ||
import Course from "../components/Course"; | ||
|
||
const Courses = () => ( | ||
<Container> | ||
{courses.map((course, index) => ( | ||
<Course | ||
key={index} | ||
image={course.image} | ||
title={course.title} | ||
subtitle={course.subtitle} | ||
logo={course.logo} | ||
author={course.author} | ||
avatar={course.avatar} | ||
caption={course.caption} | ||
/> | ||
))} | ||
</Container> | ||
); | ||
|
||
export default Courses; | ||
|
||
const Container = styled.View` | ||
flex-direction: row; | ||
align-items: center; | ||
flex-wrap: wrap; | ||
padding-left: 10px; | ||
`; | ||
|
||
const courses = [ | ||
{ | ||
title: "Prototype in InVision Studio", | ||
subtitle: "10 sections", | ||
image: require("../assets/background13.jpg"), | ||
logo: require("../assets/logo-studio.png"), | ||
author: "Meng To", | ||
avatar: require("../assets/avatar.jpg"), | ||
caption: "Design an interactive prototype using Auto-Animate" | ||
}, | ||
{ | ||
title: "React for Designers", | ||
subtitle: "12 sections", | ||
image: require("../assets/background11.jpg"), | ||
logo: require("../assets/logo-react.png"), | ||
author: "Meng To", | ||
avatar: require("../assets/avatar.jpg"), | ||
caption: "Learn to design and code a React site" | ||
}, | ||
{ | ||
title: "Design and Code with Framer X", | ||
subtitle: "10 sections", | ||
image: require("../assets/background14.jpg"), | ||
logo: require("../assets/logo-framerx.png"), | ||
author: "Meng To", | ||
avatar: require("../assets/avatar.jpg"), | ||
caption: "Create powerful design and code components for your app" | ||
}, | ||
{ | ||
title: "Design System in Figma", | ||
subtitle: "10 sections", | ||
image: require("../assets/background6.jpg"), | ||
logo: require("../assets/logo-figma.png"), | ||
author: "Meng To", | ||
avatar: require("../assets/avatar.jpg"), | ||
caption: | ||
"Complete guide to designing a site using a collaborative design tool" | ||
} | ||
]; |
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