Skip to content
Open
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
15 changes: 0 additions & 15 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -52,21 +52,6 @@

<script defer type="module" src="/src/main.js"></script>

<link
Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

(Refactored for sitewide performance; see inline docs in modified src/pages/Home/Hero/Hero.vue)

rel="preload"
as="image"
href="/assets/images/hero/hero-resized.png"
type="image/png"
fetchpriority="high"
/>

<link
rel="preload"
as="image"
href="/assets/images/hero/hero-illustration.png"
type="image/png"
/>

<!-- JSON-LD structured data -->
<script type="application/ld+json">
{
Expand Down
Binary file removed public/assets/images/hero/hero-illustration.png
Binary file not shown.
14 changes: 7 additions & 7 deletions src/components/AccountPages/Banner.vue
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ const props = defineProps({
<img
:src="OrangeStar"
class="absolute z-10"
alt="orange star"
alt=""
:class="[
isDesktop ? 'w-[70px] right-[8%] top-[23%]' : '',
isTablet ? 'w-[60px] right-[8%] top-[25%]' : '',
Expand All @@ -73,7 +73,7 @@ const props = defineProps({
<img
:src="YellowStar"
class="absolute z-10"
alt="yellow star"
alt=""
:class="[
isDesktop ? 'w-[65px] right-[40%] top-[15%]' : '',
isTablet ? 'w-[60px] left-[75%] top-[20%]' : '',
Expand All @@ -84,7 +84,7 @@ const props = defineProps({
<img
:src="BlueStar"
class="w-[65px] absolute z-10"
alt="blue star"
alt=""
:class="[
isDesktop ? 'w-[70px] left-[8%] top-[22%]' : '',
isTablet ? 'left-[21%] top-[20%]' : '',
Expand All @@ -95,7 +95,7 @@ const props = defineProps({
<img
:src="Book"
class="absolute z-10 rotate-[330deg]"
alt="book"
alt=""
:class="[
isDesktop ? 'left-[40%] top-[75%] rotate-[360deg]' : '',
!isPageShort && isDesktop ? 'w-[60px]' : '',
Expand All @@ -109,7 +109,7 @@ const props = defineProps({
:src="CarlImgPath"
ref="imgRef"
class="object-contain absolute left-[50%] translate-x-[-50%] top-[50%] translate-y-[-50%] z-10"
alt="Carl icon"
alt=""
:class="[
isDesktop
? 'top-[40%] max-h-[80vw] max-w-[80vw/3]'
Expand All @@ -127,7 +127,7 @@ const props = defineProps({
<img
:src="Bulb"
class="absolute z-10 rotate-[20deg]"
alt="lightbulb"
alt=""
:class="[
isDesktop ? 'right-[10%] top-[70%]' : '',
!isPageShort && isDesktop ? 'w-[55px]' : '',
Expand All @@ -140,7 +140,7 @@ const props = defineProps({
<img
:src="Glasses"
class="absolute z-10"
alt="glasses"
alt=""
:class="[
isDesktop ? 'left-[13%] top-[68%]' : '',
!isPageShort && isDesktop ? 'w-[60px]' : '',
Expand Down
22 changes: 22 additions & 0 deletions src/pages/Home/Hero/Hero.vue
Original file line number Diff line number Diff line change
Expand Up @@ -67,4 +67,26 @@ import YellowStar from '/assets/images/testimonials/star.svg';
import Glasses from '/assets/images/impact/glasses.svg';
import Book from '/assets/images/SignUpImg/books.png';
import Bulb from '/assets/images/about-us/bulb.png';

import { onMounted, onUnmounted } from 'vue';

// Preload Hero image for Home Page only
// To improve performance sitewide (vs always preloading assets in index.html)
onMounted(() => {
const link = document.createElement('link');
link.id = 'hero-preload';
link.rel = 'preload';
link.as = 'image';
link.type = 'image/png';
link.href = '/assets/images/hero/hero-resized.png';
link.fetchPriority = 'high';
document.head.appendChild(link);
});

onUnmounted(() => {
const link = document.getElementById('hero-preload');
if (link) {
document.head.removeChild(link);
}
});
</script>
40 changes: 0 additions & 40 deletions src/pages/OurProjects/Hero/Hero.vue

This file was deleted.

1 change: 0 additions & 1 deletion src/pages/OurProjects/OurProjects.vue
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
import Header from '../../components/Header/Header.vue';
import ScrollUpButton from '../../components/ScrollUpButton/ScrollUpButton.vue';
import ProjectsInAction from './ProjectsInAction/ProjectsInAction.vue';
import Hero from './Hero/Hero.vue';
import ResearchTech from './ResearchTech/ResearchTech.vue';
import HaveYouHeard from './Events/HaveYouHeard/HaveYouHeard.vue';
import KatyYouthHacks from './Events/KatyYouthHacks/KatyYouthHacks.vue';
Expand Down
12 changes: 1 addition & 11 deletions src/pages/OurProjects/ResearchTech/ResearchTech.vue
Original file line number Diff line number Diff line change
Expand Up @@ -66,17 +66,7 @@ const items2 = [
id="div_about_us"
class="flex flex-wrap justify-center gap-6 mt-[40px] tablet:mt-[72px] mb-[32px] w-full transition-all duration-500 ease-in-out"
>
<div
Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

  • Before: Inapplicable UI logic/Tailwind classes since items2 array length is 3, but template checks for 4-8 items
  • After: Removed undefined variables (showAll, smallScreen) to resolve access warnings and correctly reflect UI logic

(Initial :class rules appear to be copied from PressList.vue. See below)

`PressList.vue` snippet for reference
<!--- (PressList.vue) -->
<div
  v-for="(item, index) in displayedItems"
  :key="index"
  class="flex animate-fade-slide-in"
  :class="{
    'opacity-0 translate-y-4':
      (smallScreen ? index >= 4 : index >= 8) && !showAll,
    'opacity-100 translate-y-0':
      showAll || (smallScreen ? index < 4 : index < 8),
  }"
>

v-for="(item, index) in items2"
:key="index"
class="flex transition-all duration-300 ease-in-out"
:class="{
'opacity-0 translate-y-4':
(smallScreen ? index >= 4 : index >= 8) && !showAll,
'opacity-100 translate-y-0':
showAll || (smallScreen ? index < 4 : index < 8),
}"
>
<div v-for="(item, index) in items2" :key="index" class="flex">
<div class="flex flex-col w-full my-3">
<div class="flex justify-center w-full">
<div class="px-4">
Expand Down