feat: disappearing branding (#109)

This commit is contained in:
Ayo Ayco 2024-09-02 13:31:05 +02:00 committed by GitHub
parent ce7941179b
commit 9214b5eebd
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
5 changed files with 26 additions and 14 deletions

View file

@ -1,7 +1,7 @@
--- ---
--- ---
<div><a href="/"> <div id="jumbotron"><a href="/">
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<svg width="487.1" height="151.38" version="1.1" viewBox="0 0 128.88 40.052" xmlns="http://www.w3.org/2000/svg"> <svg width="487.1" height="151.38" version="1.1" viewBox="0 0 128.88 40.052" xmlns="http://www.w3.org/2000/svg">

View file

@ -20,10 +20,9 @@ const cleanContent = await cozify(article.content ?? '', Astro.url.origin)
<!-- <!--
Changing anything inside the #post div can cause a difference in the cached version of the post in users' devices. For this reason, we should avoid changing the HTML and instead do it with CSS when possible. Changing anything inside the #post div can cause a difference in the cached version of the post in users' devices. For this reason, we should avoid changing the HTML and instead do it with CSS when possible.
--> -->
<div id="post">
{ {
article && article.url !== '/' && article && article.url !== '/' &&
<> <div id="post">
{article.source && <span class="source">{article.source}</span>} {article.source && <span class="source">{article.source}</span>}
{article.title && <h1 class="title">{article.title}</h1>} {article.title && <h1 class="title">{article.title}</h1>}
{(article.author || datePublished) && ( {(article.author || datePublished) && (
@ -33,6 +32,5 @@ const cleanContent = await cozify(article.content ?? '', Astro.url.origin)
</ul> </ul>
)} )}
<content set:html={cleanContent} /> <content set:html={cleanContent} />
</> </div>
} }
</div>

View file

@ -25,15 +25,23 @@ const { url } = Astro.props;
/> />
<button <button
aria-label="Submit" aria-label="Submit"
class="btn right-buttons" class="btn right-buttons primary"
type="submit" type="submit"
id="submit" id="submit"
> >
<Icon name="ri:ai-generate" /> <Icon name="ri:ai-generate" />
</button> </button>
<a
aria-label="Home"
class="btn right-buttons"
type="button"
id="app-home"
href="/"
>
<Icon name="mdi:home" />
</a>
</form> </form>
<SettingsPopover toggle="settings-toggle" />
</div> </div>
<style> <style>
@ -73,11 +81,6 @@ const { url } = Astro.props;
caret-color: var(--accent); caret-color: var(--accent);
} }
#app-back,
#app-settings {
display: none;
}
label { label {
display: block; display: block;
border: 0px; border: 0px;
@ -97,14 +100,18 @@ const { url } = Astro.props;
} }
} }
.btn.primary {
color: var(--accent);
}
.btn { .btn {
color: rgb(var(--gray));
display: block; display: block;
border: 0px; border: 0px;
height: 100%; height: 100%;
vertical-align: middle; vertical-align: middle;
background-color: transparent; background-color: transparent;
padding: 0.5rem 0; padding: 0.5rem 0;
color: var(--accent);
svg { svg {
border: 0px; border: 0px;

View file

@ -1,9 +1,9 @@
--- ---
import { ArticleData } from "@extractus/article-extractor"; import { ArticleData } from "@extractus/article-extractor";
import "../styles/app.css";
import "../styles/reset.css"; import "../styles/reset.css";
import '../styles/variables.css'; import '../styles/variables.css';
import Footer from "../components/Footer.astro";
export interface Props { export interface Props {
article: ArticleData | null article: ArticleData | null
} }

7
src/styles/app.css Normal file
View file

@ -0,0 +1,7 @@
#app-wrapper {
&:has(#router-outlet #post) {
#jumbotron {
display: none;
}
}
}