-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.jsx
54 lines (52 loc) · 1.85 KB
/
index.jsx
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
/* eslint-disable react/no-unescaped-entities */
import React from "react";
import { Code } from "../../components/code";
import { TwicAbstract } from "../../components/demo-wrapper/twicAbstract";
import { TwicWrapper } from "../../components/demo-wrapper/twicWrapper";
import { TwicImg } from "@twicpics/components/react";
import "./index.scss";
const TwicHero = () => {
return (
<div id="twic-hero-container">
<TwicWrapper gitHubUrl="src/pages/hero/index.jsx">
<div className="twic-demo-container">
<TwicAbstract title="Hero image">
<p>To display a hero image (or video) you need to :</p>
<ul>
<li>
define the dimensions of TwicImg (or TwicVideo) especially it's
height.
</li>
<li>
use<Code>ratio="none"</Code>to free <a href="/ratio" target="_blank" rel="noreferrer">
aspect ratio
</a>
</li>
<li>
specify the dimensions of the original image in <a href="/intrinsic" target="_blank" rel="noreferrer">
intrinsic
</a> property as in<Code>intrinsic="3840x2160"</Code>
</li>
</ul>
<p>
Your hero media should resize itself according to the viewport
while preserving its intrinsic ratio aspect.
</p>
<p>
<strong>Change the dimensions of your browser </strong>
to see the image adapt it's new viewport.
</p>
</TwicAbstract>
<div className="hero">
<TwicImg
src="components/goldenGate.jpg"
ratio="none"
intrinsic="3840x2160"
/>
</div>
</div>
</TwicWrapper>
</div>
);
};
export default TwicHero;