Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add background, refactor partials #40

Merged
merged 3 commits into from
Oct 3, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/layouts/Base.astro
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
---
import config from "@/config/config.json";
import { plainify } from "@/lib/utils/textConverter";
import Footer from "@/partials/Footer.astro";
import Header from "@/partials/Header.astro";
import Footer from "@/components/Footer.astro";
import Header from "@/components/Header.astro";
import "@/styles/main.scss";

// types for frontmatters
Expand Down
35 changes: 35 additions & 0 deletions src/layouts/components/Background.astro
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@

<div class="">
<div class="dark:light-particle"></div>
<div class="dark:light-particle"></div>
<div class="dark:light-particle"></div>
<div class="dark:light-particle"></div>
<div class="dark:light-particle"></div>
<div class="dark:light-particle"></div>
<div class="dark:light-particle"></div>
<div class="dark:light-particle"></div>
<div class="dark:light-particle"></div>
<div class="dark:light-particle"></div>
<div class="dark:light-particle"></div>
<div class="dark:light-particle"></div>
<div class="dark:light-particle"></div>
<div class="dark:light-particle"></div>
<div class="dark:light-particle"></div>
<div class="dark:light-particle"></div>
<div class="dark:light-particle"></div>
<div class="dark:light-particle"></div>
<div class="dark:light-particle"></div>
<div class="dark:light-particle"></div>
<div class="dark:light-particle"></div>
<div class="dark:light-particle"></div>
<div class="dark:light-particle"></div>
<div class="dark:light-particle"></div>
<div class="dark:light-particle"></div>
<div class="dark:light-particle"></div>
<div class="dark:light-particle"></div>
<div class="dark:light-particle"></div>
<div class="dark:light-particle"></div>
<div class="dark:light-particle"></div>
<div class="dark:light-particle"></div>
<div class="dark:light-particle"></div>
</div>
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion src/pages/about.astro
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
import Base from "@/layouts/Base.astro";
import PageHeader from "@/partials/PageHeader.astro";
import PageHeader from "@/components/PageHeader.astro";
import { markdownify } from "@/lib/utils/textConverter";
import { Image } from "@astrojs/image/components";
import { getEntryBySlug } from "astro:content";
Expand Down
2 changes: 1 addition & 1 deletion src/pages/blog/categories/[category].astro
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import Base from "@/layouts/Base.astro";
import { getSinglePage } from "@/lib/contentParser.astro";
import { getTaxonomy } from "@/lib/taxonomyParser.astro";
import taxonomyFilter from "@/lib/utils/taxonomyFilter";
import PageHeader from "@/partials/PageHeader.astro";
import PageHeader from "@/components/PageHeader.astro";

export async function getStaticPaths() {
const categories = await getTaxonomy(
Expand Down
2 changes: 1 addition & 1 deletion src/pages/blog/categories/index.astro
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import config from "@/config/config.json";
import Base from "@/layouts/Base.astro";
import { getAllTaxonomy, getTaxonomy } from "@/lib/taxonomyParser.astro";
import { humanize } from "@/lib/utils/textConverter";
import PageHeader from "@/partials/PageHeader.astro";
import PageHeader from "@/components/PageHeader.astro";

const { blog_folder }: { blog_folder: string } = config.settings;
const categories = await getTaxonomy(blog_folder, "categories");
Expand Down
4 changes: 2 additions & 2 deletions src/pages/blog/index.astro
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ import Base from "@/layouts/Base.astro";
import { getSinglePage } from "@/lib/contentParser.astro";
import { getAllTaxonomy, getTaxonomy } from "@/lib/taxonomyParser.astro";
import { sortByDate } from "@/lib/utils/sortFunctions";
import PageHeader from "@/partials/PageHeader.astro";
import BlogSidebar from "@/partials/BlogSidebar.astro";
import PageHeader from "@/components/PageHeader.astro";
import BlogSidebar from "@/components/BlogSidebar.astro";
import { getEntryBySlug } from "astro:content";

const { blog_folder } = config.settings;
Expand Down
4 changes: 2 additions & 2 deletions src/pages/blog/page/[slug].astro
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ import Base from "@/layouts/Base.astro";
import { getSinglePage } from "@/lib/contentParser.astro";
import { getAllTaxonomy, getTaxonomy } from "@/lib/taxonomyParser.astro";
import { sortByDate } from "@/lib/utils/sortFunctions";
import PageHeader from "@/partials/PageHeader.astro";
import BlogSidebar from "@/partials/BlogSidebar.astro";
import PageHeader from "@/components/PageHeader.astro";
import BlogSidebar from "@/components/BlogSidebar.astro";
import { getEntryBySlug } from "astro:content";

const { blog_folder } = config.settings;
Expand Down
2 changes: 1 addition & 1 deletion src/pages/blog/tags/[tag].astro
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import Base from "@/layouts/Base.astro";
import { getSinglePage } from "@/lib/contentParser.astro";
import { getTaxonomy } from "@/lib/taxonomyParser.astro";
import taxonomyFilter from "@/lib/utils/taxonomyFilter";
import PageHeader from "@/partials/PageHeader.astro";
import PageHeader from "@/components/PageHeader.astro";

export async function getStaticPaths() {
const tags = await getTaxonomy(config.settings.blog_folder, "tags");
Expand Down
2 changes: 1 addition & 1 deletion src/pages/blog/tags/index.astro
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import config from "@/config/config.json";
import Base from "@/layouts/Base.astro";
import { getAllTaxonomy, getTaxonomy } from "@/lib/taxonomyParser.astro";
import { humanize } from "@/lib/utils/textConverter";
import PageHeader from "@/partials/PageHeader.astro";
import PageHeader from "@/components/PageHeader.astro";

const { blog_folder }: { blog_folder: string } = config.settings;
const tags = await getTaxonomy(blog_folder, "tags");
Expand Down
2 changes: 1 addition & 1 deletion src/pages/drink/bottles/[bottle].astro
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import Base from "@/layouts/Base.astro";
import { getSinglePage } from "@/lib/contentParser.astro";
import { getTaxonomy } from "@/lib/taxonomyParser.astro";
import taxonomyFilter from "@/lib/utils/taxonomyFilter";
import PageHeader from "@/partials/PageHeader.astro";
import PageHeader from "@/components/PageHeader.astro";

export async function getStaticPaths() {
const bottles = await getTaxonomy(
Expand Down
2 changes: 1 addition & 1 deletion src/pages/drink/bottles/index.astro
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
import config from "@/config/config.json";
import Base from "@/layouts/Base.astro";
import { getAllTaxonomy, getTaxonomy } from "@/lib/taxonomyParser.astro";
import PageHeader from "@/partials/PageHeader.astro";
import PageHeader from "@/components/PageHeader.astro";

const { drink_folder }: { drink_folder: string } = config.settings;
const bottles = await getTaxonomy(drink_folder, "bottles");
Expand Down
4 changes: 2 additions & 2 deletions src/pages/drink/index.astro
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ import config from "@/config/config.json";
import Base from "@/layouts/Base.astro";
import { getSinglePage } from "@/lib/contentParser.astro";
import { getAllTaxonomy, getTaxonomy } from "@/lib/taxonomyParser.astro";
import PageHeader from "@/partials/PageHeader.astro";
import DrinkSidebar from "@/partials/DrinkSidebar.astro";
import PageHeader from "@/components/PageHeader.astro";
import DrinkSidebar from "@/components/DrinkSidebar.astro";
import { getEntryBySlug } from "astro:content";

const { drink_folder } = config.settings;
Expand Down
4 changes: 2 additions & 2 deletions src/pages/drink/page/[slug].astro
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ import Base from "@/layouts/Base.astro";
import { getSinglePage } from "@/lib/contentParser.astro";
import { getAllTaxonomy, getTaxonomy } from "@/lib/taxonomyParser.astro";
import { sortByDate } from "@/lib/utils/sortFunctions";
import PageHeader from "@/partials/PageHeader.astro";
import DrinkSidebar from "@/partials/DrinkSidebar.astro";
import PageHeader from "@/components/PageHeader.astro";
import DrinkSidebar from "@/components/DrinkSidebar.astro";
import { getEntryBySlug } from "astro:content";

const { drink_folder } = config.settings;
Expand Down
2 changes: 1 addition & 1 deletion src/pages/drink/spirits/[spirit].astro
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import Base from "@/layouts/Base.astro";
import { getSinglePage } from "@/lib/contentParser.astro";
import { getTaxonomy } from "@/lib/taxonomyParser.astro";
import taxonomyFilter from "@/lib/utils/taxonomyFilter";
import PageHeader from "@/partials/PageHeader.astro";
import PageHeader from "@/components/PageHeader.astro";

export async function getStaticPaths() {
const spirits = await getTaxonomy(
Expand Down
2 changes: 1 addition & 1 deletion src/pages/drink/spirits/index.astro
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
import config from "@/config/config.json";
import Base from "@/layouts/Base.astro";
import { getAllTaxonomy, getTaxonomy } from "@/lib/taxonomyParser.astro";
import PageHeader from "@/partials/PageHeader.astro";
import PageHeader from "@/components/PageHeader.astro";

const { drink_folder }: { drink_folder: string } = config.settings;
const spirits = await getTaxonomy(drink_folder, "spirits");
Expand Down
2 changes: 1 addition & 1 deletion src/pages/drink/tags/[tag].astro
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import Base from "@/layouts/Base.astro";
import { getSinglePage } from "@/lib/contentParser.astro";
import { getTaxonomy } from "@/lib/taxonomyParser.astro";
import taxonomyFilter from "@/lib/utils/taxonomyFilter";
import PageHeader from "@/partials/PageHeader.astro";
import PageHeader from "@/components/PageHeader.astro";

export async function getStaticPaths() {
const tags = await getTaxonomy(config.settings.drink_folder, "tags");
Expand Down
2 changes: 1 addition & 1 deletion src/pages/drink/tags/index.astro
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
import config from "@/config/config.json";
import Base from "@/layouts/Base.astro";
import { getAllTaxonomy, getTaxonomy } from "@/lib/taxonomyParser.astro";
import PageHeader from "@/partials/PageHeader.astro";
import PageHeader from "@/components/PageHeader.astro";

const { drink_folder }: { drink_folder: string } = config.settings;
const tags = await getTaxonomy(drink_folder, "tags");
Expand Down
5 changes: 4 additions & 1 deletion src/pages/index.astro
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
---
import Base from "@/layouts/Base.astro";
import Background from "@/components/Background.astro";
import { markdownify } from "@/lib/utils/textConverter";
import type { Button, Feature } from "@/types";
import { getEntryBySlug } from "astro:content";
Expand All @@ -22,13 +23,15 @@ const { title, meta_title, banner }: Homepage = homepage.data;
title={title}
meta_title={meta_title}
>
<Background />
<!-- Banner -->
<section class="section pt-14">
<section class="section pt-14 background-area">
<div class="container">
<div class="row justify-center">
<div class="mb-16 text-center lg:col-7">
<h1 set:html={markdownify(banner.title)} class="mb-4" />
<p set:html={markdownify(banner.content)} class="mb-8" />

</div>
</div>
</div>
Expand Down
2 changes: 1 addition & 1 deletion src/pages/projects.astro
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
import Base from "@/layouts/Base.astro";
import PageHeader from "@/partials/PageHeader.astro";
import PageHeader from "@/components/PageHeader.astro";
import { getEntryBySlug } from "astro:content";

const projects = await getEntryBySlug("projects", "-index");
Expand Down
2 changes: 1 addition & 1 deletion src/pages/puzzle/index.astro
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import PuzzleCard from "@/components/PuzzleCard.astro";
import config from "@/config/config.json";
import Base from "@/layouts/Base.astro";
import { getSinglePage } from "@/lib/contentParser.astro";
import PageHeader from "@/partials/PageHeader.astro";
import PageHeader from "@/components/PageHeader.astro";
import { getEntryBySlug } from "astro:content";

const { puzzle_folder } = config.settings;
Expand Down
2 changes: 1 addition & 1 deletion src/pages/terms.astro
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
import Base from "@/layouts/Base.astro";
import PageHeader from "@/partials/PageHeader.astro";
import PageHeader from "@/components/PageHeader.astro";
import { getEntryBySlug } from "astro:content";

const terms = await getEntryBySlug("terms", "-index");
Expand Down
84 changes: 84 additions & 0 deletions src/styles/background.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,84 @@
$quantity: 32;

.light-particle {
position: fixed;
left: 50%;
top: 50%;
width: 0.4vw;
height: 0.4vw;
margin: -0.2vw 0 0 9.8vw;
animation: ease 200s alternate infinite;
pointer-events: none;

&::before,
&::after {
content: '';
position: absolute;
width: 100%;
height: 100%;
border-radius: 50%;
transform-origin: -10vw;
}

&::before {
background: black;
opacity: 0;
animation: drift ease alternate infinite;
}

&::after {
background: white;
opacity: 0;
box-shadow: 0 0 0vw 0vw yellow;
animation: drift ease alternate infinite, flash ease infinite;
}
}

// Randomize Motion
@for $i from 1 through $quantity {
$steps: random(12) + 16;
$rotationSpeed: random(10) + 8s;

.light-particle:nth-child(#{$i}){
animation-name: move#{$i};

&::before {
animation-duration: #{$rotationSpeed};
}

&::after {
animation-duration: #{$rotationSpeed}, random(6000) + 5000ms;
animation-delay: 0ms, random(8000) + 500ms;
}
}

@keyframes move#{$i} {
@for $step from 0 through $steps {
#{$step * calc(100 / $steps)}% {
transform: translateX(random(100) - 50vw) translateY(random(100) - 50vh) scale(calc(random(75) / 100) + .25);
}
}
}

}

@keyframes drift {
0% {
transform: rotate(0deg);
}
100% {
transform: rotate(360deg);
}
}

@keyframes flash {
0%, 30%, 100% {
opacity: 0;
box-shadow: 0 0 0vw 0vw yellow;
}
5% {
opacity: 1;
box-shadow: 0 0 2vw 0.4vw yellow;
}
}

2 changes: 1 addition & 1 deletion src/styles/base.scss
Original file line number Diff line number Diff line change
Expand Up @@ -105,4 +105,4 @@ a:hover {

hr {
@apply dark:border-light;
}
}
1 change: 1 addition & 0 deletions src/styles/main.scss
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
@import "components";
@import "navigation";
@import "buttons";
@import "background";
}

@layer utilities {
Expand Down