diff --git a/src/gallery.tsx b/src/gallery.tsx index 9c52acb..98c774d 100644 --- a/src/gallery.tsx +++ b/src/gallery.tsx @@ -224,76 +224,23 @@ function Exhibit(props: { return (

{exhibit.title}

-
- {exhibit.title} -
-
{exhibit.description}
- {progress ? ( -
-
-
{progressMessage}
+
+
+ {exhibit.title}
- ) : null} -
- {!exhibit.isCloned ? ( - - ) : ( - <> +
+ {!exhibit.isCloned ? ( - - - )} + ) : ( + <> + + + + )} +
+
+
+ {progress ? ( +
+
+
{progressMessage}
+
+ ) : null} +
{exhibit.description}
); diff --git a/style/base.css b/style/base.css index ed4efff..b0f195b 100644 --- a/style/base.css +++ b/style/base.css @@ -4,21 +4,27 @@ https://jupyterlab.readthedocs.io/en/stable/developer/css.html */ .jp-Gallery { - /* TODO: responsive grid instead? */ - /*display: flex; - flex-wrap: wrap;*/ display: grid; + grid-template-columns: repeat(auto-fit, minmax(100px, 200px)); + grid-auto-rows: 1fr; + justify-content: center; } .jp-Exhibit { + --jp-exhibit-bottom-reserved: 2.6lh; + --jp-exhibit-bottom-collapsed: 2.2lh; + --jp-exhibit-bottom-expanded: 3.2lh; + border: 1px solid var(--jp-border-color1); border-radius: 4px; - margin: 12px; + margin: 12px 4px; padding: 4px 8px; max-width: 200px; position: relative; display: flex; flex-direction: column; + overflow: hidden; + padding-bottom: var(--jp-exhibit-bottom-reserved); } .jp-Exhibit-title { @@ -27,8 +33,7 @@ .jp-Exhibit-description { padding: 2px; - height: 2.15em; - overflow: hidden; + min-height: 1.6lh; } .jp-Exhibit-icon > img { @@ -39,7 +44,13 @@ display: flex; justify-content: center; align-items: center; + height: 100%; +} + +.jp-Exhibit-middle { flex-grow: 1; + position: relative; + margin: 4px 0; } .jp-Launcher-openExample .jp-Gallery { @@ -56,7 +67,6 @@ border: 1px solid var(--jp-layout-color3); background: var(--jp-layout-color2); width: 100%; - margin-bottom: 10px; border-radius: 2px; position: relative; } @@ -84,19 +94,40 @@ left: 0; display: flex; opacity: 0; - padding: 20px; box-sizing: border-box; - backdrop-filter: blur(3px); - transition-property: backdrop-filter, opacity; - transition-duration: 300ms; + transition-property: opacity; + transition-duration: 200ms; border-radius: inherit; + padding: 0 40px; } -.jp-Exhibit-buttons:hover { - backdrop-filter: blur(10px); +.jp-Exhibit .jp-Exhibit-icon { + transition-property: filter; + transition-duration: 200ms; +} + +.jp-Exhibit:hover .jp-Exhibit-icon { + filter: blur(10px); +} + +.jp-Exhibit:hover .jp-Exhibit-buttons { opacity: 1; } +.jp-Exhibit-bottom { + position: absolute; + transition-property: max-height; + transition-duration: 200ms; + max-height: var(--jp-exhibit-bottom-collapsed); + bottom: 0; + margin-left: -8px; + padding: 0 4px; +} + +.jp-Exhibit:hover .jp-Exhibit-bottom { + max-height: var(--jp-exhibit-bottom-expanded); +} + .jp-Exhibit-buttons > .jp-Button { margin: auto; outline: 2px solid transparent;