diff --git a/contents/_includes/covers/full-screen-menu.njk b/contents/_includes/covers/full-screen-menu.njk new file mode 100644 index 0000000..7ce4ba5 --- /dev/null +++ b/contents/_includes/covers/full-screen-menu.njk @@ -0,0 +1,4 @@ +
\ No newline at end of file diff --git a/contents/full-screen-menu.md b/contents/full-screen-menu.md new file mode 100644 index 0000000..3df8918 --- /dev/null +++ b/contents/full-screen-menu.md @@ -0,0 +1,49 @@ +--- +layout: layouts/post.njk +title: Full screen menu +description: Create a full screen menu with CSS flexbox +keywords: css fixed, css flexbox, css menu +--- + +## HTML + +```html + +``` + +## CSS + +```css +.full-screen-menu { + /* Full screen overlay */ + height: 100%; + left: 0; + position: fixed; + top: 0; + width: 100%; + + /* Center the content */ + align-items: center; + display: flex; + justify-content: center; +} + +.full-screen-menu__close { + /* Shown at top left corner */ + left: 1rem; + position: absolute; + top: 1rem; +} +``` + +You can use the [close button](/close-button/) to create a button for closing the menu. + +{% demo %}{% include "covers/full-screen-menu.njk" %}{% enddemo %} diff --git a/contents/index.njk b/contents/index.njk index 1445439..72570ec 100644 --- a/contents/index.njk +++ b/contents/index.njk @@ -129,6 +129,7 @@ eleventyExcludeFromCollections: true {% pattern "Circular navigation" %}{% include "covers/circular-navigation.njk" %}{% endpattern %} {% pattern "Dot navigation" %}{% include "covers/dot-navigation.njk" %}{% endpattern %} {% pattern "Drawer" %}{% include "covers/drawer.njk" %}{% endpattern %} + {% pattern "Full screen menu" %}{% include "covers/full-screen-menu.njk" %}{% endpattern %} {% pattern "Menu" %}{% include "covers/menu.njk" %}{% endpattern %} {% pattern "Pagination" %}{% include "covers/pagination.njk" %}{% endpattern %} {% pattern "Previous next buttons" %}{% include "covers/previous-next-buttons.njk" %}{% endpattern %} diff --git a/pages/full-screen-menu/index.tsx b/pages/full-screen-menu/index.tsx deleted file mode 100644 index 664e94a..0000000 --- a/pages/full-screen-menu/index.tsx +++ /dev/null @@ -1,140 +0,0 @@ -import * as React from 'react'; -import Head from 'next/head'; - -import { Pattern } from '../../constants/Pattern'; -import { PatternLayout } from '../../layouts/PatternLayout'; -import BrowserFrame from '../../placeholders/BrowserFrame'; -import Rectangle from '../../placeholders/Rectangle'; - -const Details: React.FC<{}> = () => { - return ( -