Skip to content

Commit

Permalink
add falling stars animation to home page :DD
Browse files Browse the repository at this point in the history
and resume
and 404 page
  • Loading branch information
csc530 committed Aug 16, 2024
1 parent 8746456 commit 5e908f3
Show file tree
Hide file tree
Showing 10 changed files with 216 additions and 40 deletions.
11 changes: 6 additions & 5 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,13 @@
<link href="devicon.min.css" rel="stylesheet">
<title>my site</title>

<meta property="description" content="my awes-mazingly lovely site" />
<meta property="og:image" content="Link preview image URL">
<meta property="og:site_name" content="christofercousins.ca">
<meta property="og:title" content="my site">
<meta property="og:description" content="my awes-mazingly lovely site" />
<meta content="my awes-mazingly lovely site" property="description">
<meta content="Link preview image URL" property="og:image">
<meta content="christofercousins.ca" property="og:site_name">
<meta content="my site" property="og:title">
<meta content="my awes-mazingly lovely site" property="og:description">
<!-- <meta property="og:url" content="Canonical link preview URL"> -->
<script src="https://kit.fontawesome.com/f6ae6b9ec4.js" crossorigin="anonymous"></script>
</head>

<body>
Expand Down
11 changes: 4 additions & 7 deletions src/App.vue
Original file line number Diff line number Diff line change
@@ -1,21 +1,18 @@
<template>
<SpeedInsights />

<div class="is-flex is-flex-direction-column">
<header>
<TheNav />
</header>
<main class="container is-fluid">
<RouterView />
</main>
<TheFoot />
</div>
<SpeedInsights />
</template>


<style scoped lang="css">
div {
min-height: 100vh;
<style scoped module lang="css">
main {
min-height: 50vh;
}
</style>

Expand Down
Binary file added src/assets/resume.pdf
Binary file not shown.
123 changes: 123 additions & 0 deletions src/components/FallingStars.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,123 @@
<template lang="html">
<span ref="skyRef"></span>
</template>

<style lang="css">
/* huge lovesXshoutouts to starknight */
.star::before {
/* content: "\f005";
font-family: FontAwesome; */
text-shadow: 0 0 5px #fff, 0 0 20px #fff, 0 0 50px #fff;
}
@keyframes starfallAnimation {
0% {
transform: translateY(0) rotate(0deg);
opacity: 1;
}
80% {
opacity: 1;
}
100% {
transform: translateY(100vh) rotate(360deg);
opacity: 0;
}
}
@media screen and (max-width: 600px) {
.star {
font-size: 8px;
}
}
</style>

<script setup lang="ts">
import { useInterval, useIntervalFn } from "@vueuse/core";
import { defineProps, onUnmounted, watch, watchEffect, withDefaults } from "vue";
import { ref } from "vue";
const props = withDefaults(defineProps<{
size?: number;
duration?: number;
interval?: number;
colour?: string;
position?: 'infront' | 'behind' | 'interleave';
}>(),
{
interval: Math.random() + 0.25,
duration: Math.random() * 5 + 5,
size: Math.random() * 12 + 1,
position: 'behind',
}
);
const skyRef = ref<HTMLElement | null>();
const fallingStars = ref<number | null>(null);
// setInterval(stars, 1000);
const count = ref(0);
function stars() {
const star = document.createElement('i');
star.id = `star-${count.value}`;
count.value++;
star.classList.add('fa-solid', 'fa-star', 'star');
star.style.position = 'absolute';
star.style.top = '-16px';
star.style.left = Math.random() * innerWidth + 'px';
star.style.fontSize = props.size + 'px';
star.style.color = props.colour ?? 'white';
star.style.animation = `starfallAnimation ${props.duration}s linear forwards`;
switch (props.position) {
case 'infront':
star.style.zIndex = '1000';
break;
case 'behind':
star.style.zIndex = '-1000';
break;
case 'interleave': {
let zIndex = Math.round(Math.random() * 10);
if (Math.random() > 0.5)
zIndex *= -1
star.style.zIndex = zIndex.toString();
break;
}
}
const animation = star.getAnimations()?.[0];
if (animation)
animation.addEventListener("finish", () => {
document.querySelector(`#${star.id}`)?.remove();
})
skyRef.value?.appendChild(star);
setTimeout(() => {
const icon: HTMLElement | null = document.querySelector(`#${star.id}`);
if (icon) {
icon.getAnimations()?.[0].addEventListener("finish", () => {
icon.remove();
count.value--;
})
}
}, props.duration * 1000);
}
watch(skyRef, () => {
if (skyRef.value) {
fallingStars.value = setInterval(stars, props.interval * 100);
}
})
onUnmounted(() => {
clearInterval(fallingStars.value ?? -0);
})
</script>
8 changes: 5 additions & 3 deletions src/components/TheFoot.vue
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@
class="footer flex is-flex-direction-column justify-content-center has-text-centered has-background-inherit">
<img src="https://raw.githubusercontent.com/catppuccin/catppuccin/18acd8f58d49b551eb8cc0ff035a006d605c9905/assets/footers/ext_black_monochromatic.svg"
alt="logo" :width="width" decoding="auto" loading="lazy" />
<small class="font-italic" title="get it cuz... heh heh, it's the footer😆 .. oh nvm">insert obligatory mort quote here</small>
<small class="font-italic" title="get it cuz... heh heh, it's the footer😆 .. oh nvm">insert obligatory
mort quote here</small>
<section class="section">
<h2 class="subtitle is-7">Acknowledgements, Thx, Credits</h2>
<ul class="is-flex is-flex-direction-row is-gap-3 is-justify-content-space-around">
Expand All @@ -27,8 +28,9 @@
</a>
</li>
<li title="le moi" class="image is-128x128" wi lang="fr-CA">
<img class="is-rounded" srcset="/bitmoji_sipping-tea.png, /bitmoji_hi.png"
alt="bitmoji">
<a href="https://github.com/csc530/mysite">
<img class="is-rounded" srcset="/bitmoji_sipping-tea.png, /bitmoji_hi.png" alt="bitmoji">
</a>
</li>
</ul>
</section>
Expand Down
17 changes: 10 additions & 7 deletions src/components/TheNav.vue
Original file line number Diff line number Diff line change
@@ -1,28 +1,30 @@
<template>
<nav class="navbar is-spaced -has-shadow" role="navigation" aria-label="main navigation">
<div class="navbar-brand">
<a class="navbar-item" title="you know the sh*t">✝️👽🧠🖤</a>
<a class="navbar-item" href="https://y.at/✝️🧠🍁👽" title="beep bop boo deep dorp">🖤✝️🧠🍁👽🖤</a>
<button ref="hamburgerRef" @click.stop.prevent="toggleHamburger" class="navbar-burger" aria-label="menu"
aria-expanded="false">
<span aria-hidden="true"></span>
<span aria-hidden="true"></span>
<span aria-hidden="true"></span>
<span aria-hidden="true"></span>
</button>

<div class="navbar-item">
<img @click="toggleTheme" :src="themeIcons.getTheme(colourTheme)" alt="theme icon" decoding="auto"
loading="lazy" />
</div>
</div>

<div class="navbar-menu" ref="navMenuRef">
<div class="navbar-start">
<router-link v-for="route in routes" :key="route.path" class="navbar-item" :to="route.path">
<router-link v-for="route in navigableRoutes" :key="route.path" class="navbar-item" :to="route.path">
{{ route.name }}
</router-link>
</div>
</div>

<div class="navbar-end">
<div class="navbar-item">
<img @click="toggleTheme" :src="themeIcons.getTheme(colourTheme)" alt="theme icon" decoding="auto"
loading="lazy" />
<div class="navbar-end">

</div>
</div>

Expand All @@ -37,6 +39,7 @@
const router = useRouter();
const routes = router.getRoutes();
const navigableRoutes = computed(() => routes.filter(route => !route.path.includes(":")));
const navMenuRef = ref<HTMLDivElement | null>(null);
const hamburgerRef = ref<HTMLDivElement | null>(null);
Expand Down
67 changes: 50 additions & 17 deletions src/components/TheWelcome.vue
Original file line number Diff line number Diff line change
@@ -1,15 +1,29 @@
<template>
<section class="hero has-text-centered is-fullheight ">
<section ref="heroRef" class="hero has-text-centered is-fullheight-with-navbar">
<FallingStars :size="13" :interval="1" :duration="10" :colour="starColour" position="interleave" />
<section class="hero-head">
</section>
<div class="hero-body">
<div class="container">
<h1 class="title">[be] in awee</h1>
<section class="container">
<h1 class="title">🤓Christofer 😽 Cousins😉</h1>
<!-- and my pfp is spinning in the middle with radiance-->
<!-- surrounded by stars? gifs??-->
<!-- huge loves to starknoght https://github.com/StarKnightt/Falling-Stars -->
<img alt="" src="">

<h2 class="subtitle">Christofer: <span ref="attrRef"></span></h2>
</div>
<h2 style="min-height: 3rem; min-width: 3rem;" class="subtitle" ref="attrRef"></h2>
</section>
</div>
<section class="hero-foot">
<nav class="tabs is-centered">
<ul>
<li><a href="https://github.com/csc530"><i class="fab fa-github"></i></a></li>
<li><a href="https://www.linkedin.com/in/christofer-cousins/"><i class="fab fa-linkedin"></i></a>
</li>
<li @click="nope"><a><i class="fab fa-twitter"></i></a></li>
<li><a :href="resume" target="_parent"><i class="fas fa-file"></i></a></li>
</ul>
</nav>
</section>
</section>
</template>

Expand All @@ -20,17 +34,36 @@
</style>

<script setup lang="ts">
import WelcomeItem from "./WelcomeItem.vue";
import DocumentationIcon from "./icons/IconDocumentation.vue";
import ToolingIcon from "./icons/IconTooling.vue";
import EcosystemIcon from "./icons/IconEcosystem.vue";
import CommunityIcon from "./icons/IconCommunity.vue";
import SupportIcon from "./icons/IconSupport.vue";
import resume from "@/assets/resume.pdf";
import FallingStars from "@/components/FallingStars.vue";
import { computed, ref, watch } from "vue";
import consola from "consola";
import { useColorMode } from "@vueuse/core";
import { PuccinTheme } from "@/types/helper";
const attrRef = ref<HTMLSpanElement | null>(null);
const colour = useColorMode<PuccinTheme>()
const starColour = computed(() => {
switch (colour.value) {
case PuccinTheme.latte:
return '#04a5e5';
case 'light':
return 'Black';
case PuccinTheme.mocha:
return '#cba6f7';
case 'dark':
return 'White';
default:
return undefined;
}
})
const heroRef = ref<HTMLElement | null>(null);
const attrRef = ref<HTMLSpanElement | null>(null);
function nope() {
return alert('I don\'t have twitter (X) 😹😜');
}
const attributes = ref([
"computer scientist",
Expand All @@ -53,11 +86,9 @@
"Vue💚Lover"
]);
const attribute = ref(attributes.value[Math.random() * attributes.value.length | 0]);
watch(attrRef, (value) => {
watch(attrRef, () => {
typeAttribute(randomAttribute());
});
})
function typeAttribute(attribute: string) {
if (!attrRef.value)
Expand Down Expand Up @@ -105,4 +136,6 @@
}
return attr;
}
</script>
10 changes: 10 additions & 0 deletions src/pages/40UhOh.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
<template>
<div>
<h1>uh oh</h1>
<p>you got lost</p>
</div>

</template>

<script setup lang="ts">
</script>
6 changes: 6 additions & 0 deletions src/router/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,12 @@ const router = createRouter({
// this generates a separate chunk (About.[hash].js) for this route
// which is lazy-loaded when the route is visited.
component: () => import("../pages/AboutPage.vue")
},
{
path: "/:pathMatch(.*)*",
name: "404",
component: () => import("../pages/40UhOh.vue"),
meta: {title: "404 - Page Not Found"}
}
],
linkActiveClass: "is-active",
Expand Down
3 changes: 2 additions & 1 deletion src/views/ProjectsView.vue
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@
<li class="box">
<a href="https://github.com/csc530/vuebulma" class="has-text-current">
<h3 class="has-text-link">Vuebulma</h3>
<p>Vue.js and Bulma</p>
<p>Vue.js and Bulma component library</p>
<small>currently upgrading to bulma v1.0...</small>
</a>
</li>

Expand Down

1 comment on commit 5e908f3

@vercel
Copy link

@vercel vercel bot commented on 5e908f3 Aug 16, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.