wip(org): Changes to layouts and modal images
This commit is contained in:
parent
b9df1709f1
commit
ffea80f77b
7 changed files with 25 additions and 12 deletions
|
@ -16,16 +16,16 @@ const DefaultLayout = ({ app, title=false, crumbs=false, children=[] }) => {
|
||||||
return (
|
return (
|
||||||
<div className="m-auto flex flex-row justify-center">
|
<div className="m-auto flex flex-row justify-center">
|
||||||
<Aside app={app} slug={slug} before={<ThemePicker app={app} className="block sm:hidden"/>}/>
|
<Aside app={app} slug={slug} before={<ThemePicker app={app} className="block sm:hidden"/>}/>
|
||||||
<section className="py-28 md:py-36">
|
<section className="py-28 md:py-36 max-w-7xl px-8 xl:pl-8 2xl:pl-16">
|
||||||
<div>
|
<div>
|
||||||
{title && (
|
{title && (
|
||||||
<div className="px-8 xl:pl-8 2xl:pl-16">
|
<>
|
||||||
<Breadcrumbs title={title} crumbs={breadcrumbs} />
|
<Breadcrumbs title={title} crumbs={breadcrumbs} />
|
||||||
{title
|
{title
|
||||||
? <h1>{title}</h1>
|
? <h1>{title}</h1>
|
||||||
: <h1>{app.getTitle(slug)}</h1>
|
: <h1>{app.getTitle(slug)}</h1>
|
||||||
}
|
}
|
||||||
</div>
|
</>
|
||||||
)}
|
)}
|
||||||
{children}
|
{children}
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -69,7 +69,7 @@ const PostPage = ({ post, author }) => {
|
||||||
<meta property="og:locale" content="en_US" key='locale' />
|
<meta property="og:locale" content="en_US" key='locale' />
|
||||||
<meta property="og:site_name" content="freesewing.dev" key='site' />
|
<meta property="og:site_name" content="freesewing.dev" key='site' />
|
||||||
</Head>
|
</Head>
|
||||||
<article className="mb-12 px-8 xl:pl-8 2xl:pl-16 max-w-7xl">
|
<article className="mb-12">
|
||||||
<div className="flex flex-row justify-between text-sm mb-1 mt-2">
|
<div className="flex flex-row justify-between text-sm mb-1 mt-2">
|
||||||
<span><TimeAgo date={post.date} /> [{post.date}]</span>
|
<span><TimeAgo date={post.date} /> [{post.date}]</span>
|
||||||
<span>
|
<span>
|
||||||
|
@ -89,7 +89,7 @@ const PostPage = ({ post, author }) => {
|
||||||
className="shadow m-auto"
|
className="shadow m-auto"
|
||||||
/>
|
/>
|
||||||
<figcaption
|
<figcaption
|
||||||
className="text-center mb-8 prose m-auto"
|
className="text-center mb-8 prose m-auto mt-1"
|
||||||
dangerouslySetInnerHTML={{__html: post.caption}}
|
dangerouslySetInnerHTML={{__html: post.caption}}
|
||||||
/>
|
/>
|
||||||
</Modal>
|
</Modal>
|
||||||
|
|
|
@ -16,10 +16,14 @@ const Figure = props => {
|
||||||
src={props?.src}
|
src={props?.src}
|
||||||
alt={props?.alt || ''}
|
alt={props?.alt || ''}
|
||||||
title={title || ''}
|
title={title || ''}
|
||||||
className="m-auto max-h-full max-w-full"
|
className="m-auto"
|
||||||
|
style={{
|
||||||
|
maxHeight: "calc(100vh - 6rem)",
|
||||||
|
maxWidth: "calc(100vw - 6rem)",
|
||||||
|
}}
|
||||||
/>
|
/>
|
||||||
{title
|
{title
|
||||||
? <figcaption className="text-center italic text-base-content mt-1">{title}</figcaption>
|
? <figcaption className="text-center italic mt-1">{title}</figcaption>
|
||||||
: (
|
: (
|
||||||
<Popout fixme>
|
<Popout fixme>
|
||||||
<h5>This image does not have an alt of title specified</h5>
|
<h5>This image does not have an alt of title specified</h5>
|
||||||
|
|
|
@ -7,10 +7,13 @@ const Modal = ({ cancel, children }) => {
|
||||||
if (modal) return (
|
if (modal) return (
|
||||||
<div className={`
|
<div className={`
|
||||||
fixed top-0 left-0 right-0 w-screen h-screen
|
fixed top-0 left-0 right-0 w-screen h-screen
|
||||||
bg-base-100 bg-opacity-90 z-30
|
bg-neutral bg-opacity-90 z-30
|
||||||
hover:cursor-zoom-out flex flex-col justify-center
|
hover:cursor-zoom-out flex flex-col justify-center
|
||||||
`} onClick={() => setModal(false)}>
|
`} onClick={() => setModal(false)}>
|
||||||
<div className="p-8 max-h-full max-w-full">
|
<div className="m-auto text-neutral-content lightbox" style={{
|
||||||
|
maxHeight: "calc(100vh - 6rem)",
|
||||||
|
maxWidth: "calc(100vw - 6rem)",
|
||||||
|
}}>
|
||||||
{children}
|
{children}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -12,8 +12,8 @@ const Aside = ({ app, slug, mobileOnly=false, before=[], after=[]}) => (
|
||||||
px-8 py-24
|
px-8 py-24
|
||||||
shrink-0
|
shrink-0
|
||||||
md:w-24 md:px-2 md:justify-center
|
md:w-24 md:px-2 md:justify-center
|
||||||
lg:w-max lg:pr-2 lg:border-r-2
|
lg:w-96 lg:pr-2 lg:border-r-2
|
||||||
xl:w-max xl:border-0
|
xl:w-lg xl:border-0
|
||||||
2xl:pr-8
|
2xl:pr-8
|
||||||
${mobileOnly ? 'block md:hidden' : ''}
|
${mobileOnly ? 'block md:hidden' : ''}
|
||||||
`}>
|
`}>
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
import themes from 'shared/themes/runtime.js'
|
import themes from 'shared/themes/runtime.js'
|
||||||
|
|
||||||
const svg = (color, d, shadowShift) => `url('data:image/svg+xml;base64,` +
|
const svg = (color, d, shadowShift) => `url('data:image/svg+xml;base64,` +
|
||||||
new Buffer(`<svg
|
Buffer.from(`<svg
|
||||||
xmlns="http://www.w3.org/2000/svg"
|
xmlns="http://www.w3.org/2000/svg"
|
||||||
fill="none"
|
fill="none"
|
||||||
stroke="none"
|
stroke="none"
|
||||||
|
|
|
@ -235,6 +235,12 @@
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* modal */
|
||||||
|
.lightbox img {
|
||||||
|
max-width: calc(100vw - 6rem);
|
||||||
|
max-height: calc(100vh - 6rem);
|
||||||
|
}
|
||||||
|
|
||||||
/* Style for navigation */
|
/* Style for navigation */
|
||||||
details { user-select: none; }
|
details { user-select: none; }
|
||||||
details > summary > svg.details-toggle {
|
details > summary > svg.details-toggle {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue