add cat widget

This commit is contained in:
zepp 2025-03-11 05:15:09 -04:00
parent 348f21593a
commit a8299178ec
4 changed files with 17 additions and 21 deletions

View File

@ -1,49 +1,43 @@
--- ---
import { Image } from "astro:assets"; import { Image } from "astro:assets";
import baxter from "../images/baxter.png";
import catImg from "../images/widgets/cat.gif";
const backgroundColor = "#ffd4de"; const backgroundColor = "#ffd4de";
const backgroundColorNightMode = "#240046"; const backgroundColorNightMode = "#240046";
--- ---
<div class="widget-box"> <div class="widget-box">
<div class="baxter-widget widget"> <div class="cat-widget widget">
<p class="widget-text">give baxter a pet :3</p> <p>a friend to browse my homepage with &lt;3</p>
<Image src={baxter} alt="my cat baxter that can be clicked on to pet" /> <Image src={catImg} alt="a cat sitting in a stained glass window"/>
</div> </div>
</div> </div>
<style define:vars={{backgroundColor, backgroundColorNightMode}}> <style define:vars={{backgroundColor, backgroundColorNightMode}}>
.widget-box { .widget-box {
height: 100%; height: 100%;
width: 20vw; width: 20vw;
margin-left: 2.5rem; margin-left: 2.5rem;
border-radius: 25px;
display: flex; display: flex;
flex-direction: column; flex-direction: column;
grid-column: 3/4; grid-column: 3/4;
grid-row: 2/3; grid-row: 2/3;
} }
.baxter-widget { .cat-widget {
background-color: var(--backgroundColor);
height: 19vw;
width: 20vw;
border-radius: 25px;
display: flex; display: flex;
flex-direction: column; flex-direction: column;
gap: 2rem; align-items: center;
border-radius: 25px;
height: 35vh;
width: 20vw;
} }
.widget { @media (prefers-color-scheme: dark) {
background-color: var(--backgroundColor); .widget {
} background-color: var(--backgroundColorNightMode);
}
.widget-text {
padding: 0.5rem 0;
font-size: 1.25rem;
width: 19vw;
text-align: center;
border-bottom: 4px solid hotpink;
} }
</style> </style>

Binary file not shown.

Before

Width:  |  Height:  |  Size: 24 KiB

BIN
src/images/widgets/cat.gif Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 20 KiB

View File

@ -2,6 +2,7 @@
import "../styles/global.css"; import "../styles/global.css";
import Header from "../components/Header.astro"; import Header from "../components/Header.astro";
import Navigation from "../components/Navigation.astro"; import Navigation from "../components/Navigation.astro";
import WidgetBar from "../components/WidgetBar.astro";
import Footer from "../components/Footer.astro"; import Footer from "../components/Footer.astro";
const { pageTitle } = Astro.props; const { pageTitle } = Astro.props;
@ -22,6 +23,7 @@ const { pageTitle } = Astro.props;
<slot /> <slot />
</section> </section>
</main> </main>
<WidgetBar />
<Footer /> <Footer />
</body> </body>
</html> </html>