Skip to content

Commit

Permalink
build(front): adds margin to posts summary paragraphs
Browse files Browse the repository at this point in the history
  • Loading branch information
dgrebb committed Oct 28, 2023
1 parent ff76a0e commit 4386a45
Show file tree
Hide file tree
Showing 4 changed files with 43 additions and 23 deletions.
50 changes: 27 additions & 23 deletions front/src/lib/components/Image.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -30,27 +30,31 @@
});
</script>

{#if loaded}
<img
{src}
{alt}
{title}
{width}
{height}
class={classes}
aria-hidden={ariaHidden}
/>
{:else if failed}
<p>That image was lost. Poor thing.</p>
<script>
Sentry.captureMessage('Image Not Found', {
image: src,
page: document.location.pathname,
hostname: document.location.hostname,
});
</script>
{:else if loading}
<div class="image-loader" style={`height: ${height}px; width: ${width}px`}>
<div
class="image-loader"
class:loaded
style={`height: ${height}px; width: ${width}px`}
>
{#if loaded}
<img
{src}
{alt}
{title}
{width}
{height}
class={classes}
aria-hidden={ariaHidden}
/>
{:else if failed}
<p>That image was lost. Poor thing.</p>
<script>
Sentry.captureMessage('Image Not Found', {
image: src,
page: document.location.pathname,
hostname: document.location.hostname,
});
</script>
{:else if loading}
<Loading />
</div>
{/if}
{/if}
</div>
7 changes: 7 additions & 0 deletions front/src/lib/styles/global.css
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,14 @@ body {
display: flex;
justify-content: center;
align-items: center;
opacity: 0;
transition-duration: var(--transition-duration);
transition-property: opacity;
transition-timing-function: var(--transition-timing-function);
margin: auto;
&.loaded {
opacity: 1;
}
}

.scroll-top {
Expand Down
8 changes: 8 additions & 0 deletions front/src/lib/styles/pages/home.css
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,14 @@
transition-property: max-width;
padding-right: 1rem;
padding-left: 1rem;
.image-loader {
margin: 0.5rem 0;
}
@media screen and (min-width: 480px) {
.image-loader {
margin: 0;
}
}
.bio-picture {
position: relative;
z-index: 5;
Expand Down
1 change: 1 addition & 0 deletions front/static/styles/noscript.css
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ body .footer {
}
.image-loader {
display: none;
opacity: 1;
}
.syntax-highlighter {
.language {
Expand Down

0 comments on commit 4386a45

Please sign in to comment.