1
0
mirror of https://github.com/phuoc-ng/csslayout.git synced 2025-08-05 13:47:25 +02:00

Add full screen menu

This commit is contained in:
Phuoc Nguyen
2019-11-30 20:17:53 +07:00
parent e83efe1b22
commit f74fb6660e
5 changed files with 173 additions and 0 deletions

View File

@@ -15,6 +15,7 @@ enum Pattern {
FeatureList = 'Feature list',
FixedAtCorner = 'Fixed at corner',
FloatingLabel = 'Floating label',
FullScreenMenu = 'Full screen menu',
HolyGrail = 'Holy grail',
InputAddOn = 'Input addon',
MediaObject = 'Media object',

View File

@@ -99,6 +99,7 @@ const ExplorePage = () => {
<CoverCard pattern={Pattern.FeatureList} />
<CoverCard pattern={Pattern.FixedAtCorner} />
<CoverCard pattern={Pattern.FloatingLabel} />
<CoverCard pattern={Pattern.FullScreenMenu} />
<CoverCard pattern={Pattern.InputAddOn} />
<CoverCard pattern={Pattern.MediaObject} />
<CoverCard pattern={Pattern.Menu} />

View File

@@ -0,0 +1,49 @@
import React from 'react';
import Frame from '../../placeholders/Frame';
import Rectangle from '../../placeholders/Rectangle';
const Cover: React.FC<{}> = () => {
return (
<Frame>
<div
style={{
alignItems: 'center',
display: 'flex',
height: '100%',
justifyContent: 'center',
padding: '8px',
}}
>
<div
style={{
height: '100%',
position: 'relative',
width: '100%',
}}
>
<div
style={{
alignItems: 'center',
backgroundColor: 'rgba(0, 0, 0, 0.25)',
display: 'flex',
flexDirection: 'column',
height: '100%',
justifyContent: 'center',
left: 0,
position: 'absolute',
top: 0,
width: '100%',
}}
>
<div style={{ marginBottom: '4px', width: '60%' }}><Rectangle /></div>
<div style={{ marginBottom: '4px', width: '40%' }}><Rectangle /></div>
<div style={{ marginBottom: '4px', width: '50%' }}><Rectangle /></div>
</div>
</div>
</div>
</Frame>
);
};
export default Cover;

View File

@@ -0,0 +1,121 @@
import React from 'react';
import DetailsLayout from '../../layouts/DetailsLayout';
import BrowserFrame from '../../placeholders/BrowserFrame';
import Rectangle from '../../placeholders/Rectangle';
const Details: React.FC<{}> = () => {
return (
<DetailsLayout title="Full screen menu">
<div style={{ padding: '64px 32px' }}>
<BrowserFrame
content={(
<div
style={{
alignItems: 'center',
display: 'flex',
flexDirection: 'column',
height: '100%',
justifyContent: 'center',
padding: '8px',
}}
>
<button
style={{
backgroundColor: 'transparent',
borderColor: 'transparent',
padding: 0,
position: 'absolute',
right: '16px',
top: '16px',
}}
>
<svg
viewBox="0 0 24 24"
style={{
fill: 'none',
height: 24,
stroke: '#000',
strokeLinecap: 'round',
strokeLinejoin: 'round',
strokeWidth: 1,
width: 24,
}}
>
<path
d={`M7,16.999l10-10
M17,16.999l-10-10
M12,0.499c6.351,0,11.5,5.149,11.5,11.5s-5.149,11.5-11.5,11.5
S0.5,18.35,0.5,11.999S5.649,0.499,12,0.499z`}
/>
</svg>
</button>
<div
style={{
alignItems: 'center',
backgroundColor: 'rgba(0, 0, 0, 0.25)',
display: 'flex',
flexDirection: 'column',
height: '100%',
justifyContent: 'center',
left: 0,
position: 'absolute',
top: 0,
width: '100%',
}}
>
<ul
style={{
alignItems: 'center',
display: 'flex',
flexDirection: 'column',
listStyleType: 'none',
margin: 0,
padding: 0,
}}
>
<li style={{ marginBottom: '16px', width: '256px' }}><Rectangle /></li>
<li style={{ marginBottom: '16px', width: '144px' }}><Rectangle /></li>
<li style={{ marginBottom: '16px', width: '128px' }}><Rectangle /></li>
<li style={{ width: '160px' }}><Rectangle /></li>
</ul>
</div>
</div>
)}
source={`
<div style="
/* Full screen overlay */
height: 100%;
left: 0;
position: fixed;
top: 0;
width: 100%;
/* Content is centered */
align-items: center;
display: flex;
justify-content: center;
">
<!-- The close button -->
<button style="
/* Shown at top right corner */
position: absolute;
right: 16px;
top: 16px;
">
...
</button>
<!-- The navigation menu -->
<ul>
...
</ul>
</div>
`}
/>
</div>
</DetailsLayout>
);
};
export default Details;

View File

@@ -21,6 +21,7 @@
<url><loc>https://csslayout.io/patterns/feature-list</loc></url>
<url><loc>https://csslayout.io/patterns/fixed-at-corner</loc></url>
<url><loc>https://csslayout.io/patterns/floating-label</loc></url>
<url><loc>https://csslayout.io/patterns/full-screen-menu</loc></url>
<url><loc>https://csslayout.io/patterns/input-addon</loc></url>
<url><loc>https://csslayout.io/patterns/media-object</loc></url>
<url><loc>https://csslayout.io/patterns/menu</loc></url>