Skip to content

Commit

Permalink
Merge branch 'products-overview-page'
Browse files Browse the repository at this point in the history
  • Loading branch information
AWWaldron committed Jun 6, 2024
2 parents 50036e1 + b1e7874 commit 2d8b82f
Show file tree
Hide file tree
Showing 12 changed files with 144 additions and 190 deletions.
9 changes: 9 additions & 0 deletions public/images/Overview_hero.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
39 changes: 39 additions & 0 deletions public/images/SnapDb_qrCode.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
9 changes: 9 additions & 0 deletions public/images/Sparta_phone.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
32 changes: 17 additions & 15 deletions src/components/SiteNavHeader.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -11,21 +11,21 @@
const dropdownLinks = [
{
text: 'PRODUCTS',
url: '/products',
image: '/images/products_card.png',
text: "PRODUCTS",
url: "/products",
image: "/images/products_card.png",
subLinks: [
{ url: '/products', text: 'OVERVIEW' },
{ url: '/products/sparta', text: 'SPARTA' },
{ url: '/products/my-career', text: 'MyCareer' },
{ url: '/products/SnapDB', text: 'Snap Database' },
],
{ url: "/products", text: "OVERVIEW" },
{ url: "/products/sparta", text: "SPARTA" },
{ url: "/products/my-career", text: "MyCareer" },
{ url: "/products/SnapDB", text: "Snap Database" }
]
},
{
text: 'ABOUT',
image: '/images/about_card.png',
url: '/about',
subLinks: [{ url: '/who-we-are', text: 'WHO WE ARE' }],
subLinks: [{ url: '/about', text: 'WHO WE ARE' }],
},
{
text: 'CAREER',
Expand All @@ -35,12 +35,12 @@
{ url: '/career', text: 'TRAINING' },
{ url: '/roles', text: 'ROLES' },
],
titleClasses: 'text-sm lg:text-xl',
titleClasses: "text-sm lg:text-xl"
},
{
text: 'CONTACT',
image: '/images/contact_card.png',
url: '/contact',
text: "CONTACT",
image: "/images/contact_card.png",
url: "/contact",
subLinks: [
{ url: '/contact/get-in-touch', text: 'GET IN TOUCH' },
{ url: '/contact/request-a-demo', text: 'REQUEST A DEMO' },
Expand All @@ -64,9 +64,11 @@
});
</script>

<header id="header" class="w-full sticky top-0 z-30 bg-custom-gradient-blue-header">
<header id="header"
class="w-full sticky top-0 z-30 bg-custom-gradient-blue-header">
<nav>
<div class="flex flex-row justify-between items-center w-full py-2 sm:py-4 md:gap-4 lg:gap-8 px-16">
<div
class="flex flex-row justify-between items-center w-full py-2 sm:py-4 md:gap-4 lg:gap-8 px-16">
<a href="/">
<span
class="tracking-widest leading-relaxed sm:leading-snug text-base sm:text-xl text-white font-colossalis whitespace-nowrap bg-gradient-to-r from-white via-slate-50 to-slate-100 inline-block text-transparent bg-clip-text">
Expand Down
63 changes: 0 additions & 63 deletions src/components/accordion/Accordion.svelte
Original file line number Diff line number Diff line change
@@ -1,63 +0,0 @@
<script>
import { mobile,active } from './stores.js';
import AccordionSection from './AccordionSection.svelte'
import FooterFull from '@components/FooterFull.svelte'
export let products;
products.sort((a,b) => a.data.order - b.data.order)
// Uncomment below to limit accordion to only the top three products
products = products.slice(0,3);
let width = 0;
$: mobile.set(width < 1024);
function setActive(section){
if ($active == parseInt(section)){
active.set(0);
}
else{
active.set(section);
}
}
function expandLink(link){
return "products/"+link;
}
</script>

<svelte:window bind:innerWidth={width} />

<div class="grid grid-cols-1 lg:h-5/6" class:lg:grid-cols-6={products.length == 3} class:lg:grid-cols-7={products.length == 4}>
<!-- svelte-ignore a11y-click-events-have-key-events -->
<div role="button" tabindex="0" class="flex flex-col col-span-1 justify-end lg:justify-normal h-96 px-16 lg:px-32 {($active==0 && !$mobile) ? 'col-span-3': ''} {($active!=0 && !$mobile) ? 'col-span-2': ''} bg-[url('/images/shaking_hands.png')] bg-auto bg-no-repeat bg-cover lg:h-full" on:click={() => setActive(0)}>
<div class="h-1/4"></div>
<div class="py-8 text-mcswf-gold font-bold text-center font-expressway text-xl lg:text-4xl">
OUR PRODUCT PORTFOLIO
</div>
<div class="text-base lg:text-2xl font-expressway text-center py-8">
Real solutions to real problems - Created for Marines, by Marines at the Marine Corps Software Factory
</div>
</div>
<!-- svelte-ignore a11y-click-events-have-key-events -->
{#each products as product}
<div role="button" tabindex="0" class="h-fit lg:h-full {($active==product.data.order && !$mobile) ? 'col-span-2': 'col-span-1'} red-radial-gradient" on:click={() => setActive(product.data.order)} >
<div class="relative h-full lg:border-x lg:border-y-0 border-y">
<AccordionSection
text={product.data.description}
title={product.data.product}
sequence={product.data.order}
href={expandLink(product.id)}
/>
</div>
</div>
{/each}
</div>

<FooterFull></FooterFull>



93 changes: 0 additions & 93 deletions src/components/accordion/AccordionSection.svelte

This file was deleted.

12 changes: 6 additions & 6 deletions src/components/sections/ContentImageFull.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -16,17 +16,17 @@
<div class="items-center max-w-screen-xl gap-16 px-4 py-8 mx-auto grid grid-cols-1 justify-center lg:grid-cols-2 md:py-8 md:px-6">
{#if flipped}
<div class="flex justify-center">
<img class="w-3/4 rounded-lg aspect-square object-cover {imageClasses}" src={image} alt={imageAltText} />
<img class="w-7/8 lg:w-3/4 rounded-lg aspect-square object-cover {imageClasses}" src={image} alt={imageAltText} />
</div>
{/if}
{#if !flipped}
<div class="justify-center flex lg:hidden">
<img class="w-3/4 rounded-lg object-cover aspect-square {imageClasses}" src={image} alt={imageAltText} />
<img class="w-7/8 rounded-lg object-cover aspect-square {imageClasses}" src={image} alt={imageAltText} />
</div>
{/if}
<div class="font-light text-white sm:text-lg w-3/4 lg:w-full place-self-center">
<h2 class="mb-4 mt-6 lg:mt-0 tracking-tight lg:text-center text-mcswf-gold text-2xl font-bold md:text-3xl lg:text-4xl {titleClasses}">
{title}
{@html title}
</h2>
<div class="flex justify-center">
{#if content instanceof Array}
Expand All @@ -42,16 +42,16 @@
{/if}
</div>
{#if link}
<div class="grid w-full gap-3 mt-8 sm:inline-flex sm:justify-center justify-items-center">
<ButtonCustom color="white" size="xl" class="w-64" {link}>
<div class="grid w-full gap-3 mt-8 lg:inline-flex lg:justify-center justify-items-center">
<ButtonCustom color="white" size="xl" class="w-full lg:w-64" {link}>
{linkText}
</ButtonCustom>
</div>
{/if}
</div>
{#if !flipped}
<div class="justify-center hidden lg:flex">
<img class="w-3/4 rounded-lg aspect-square object-cover {imageClasses}" src={image} alt={imageAltText} />
<img class="lg:w-3/4 rounded-lg aspect-square object-cover {imageClasses}" src={image} alt={imageAltText} />
</div>
{/if}
</div>
Expand Down
4 changes: 4 additions & 0 deletions src/content/config.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,10 @@ const productCollection = defineCollection({
src: z.string(),
alt: z.string(),
}),
image2: z.object({
src: z.string(),
alt: z.string(),
}),
order: z.number(),
heading: z.string(),
bullets: z.array(z.string()),
Expand Down
5 changes: 4 additions & 1 deletion src/content/products/SnapDB.yaml
Original file line number Diff line number Diff line change
@@ -1,11 +1,14 @@
product: 'Snap Database'
description: "The Strategic Capabilities Office commissioned Snap Database to address the issue of transmitting information via a signal. SnapDB creates a local QR code that can display a message when viewed by an unmanned aerial system (UAS)."
background:
background:
src: '/images/snapdb_header.jpg'
alt: 'Marine gesturing at a television that says SnapDB'
image:
src: '/images/iPhone_x.svg'
alt: 'Snap Database on an iPhone'
image2:
src: '/images/SnapDb_qrCode.svg'
alt: 'Snap Database on an iPhone'
order: 3
heading: "Snap Database"
bullets:
Expand Down
3 changes: 3 additions & 0 deletions src/content/products/my-career.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@ background:
image:
src: '/images/myCareer.png'
alt: ' '
image2:
src: '/images/shaking_hands.png'
alt: ' '
order: 2
heading: "Manpower Management Enlisted Assignments"
bullets:
Expand Down
3 changes: 3 additions & 0 deletions src/content/products/sparta.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@ background:
image:
src: '/images/sparta_handheld.gif'
alt: ' '
image2:
src: '/images/Sparta_phone.svg'
alt: ' '
order: 1
heading: "Visualize Maritime Vessels \n Process Sensor Data \n Disseminate"
bullets:
Expand Down
62 changes: 50 additions & 12 deletions src/pages/products/index.astro
Original file line number Diff line number Diff line change
@@ -1,18 +1,56 @@
---
import Layout from '../../layouts/Layout.astro'
import { getCollection } from 'astro:content'
import { displaySiteBanner } from '../../components/stores.js'
import Layout from '../../layouts/Layout.astro';
import { getCollection } from 'astro:content';
import { displaySiteBanner } from '../../components/stores.js';
import FooterFull from '@components/FooterFull.svelte';
import '../../styles/global.css'
import '../../styles/fonts.css'
import Accordion from '../../components/accordion/Accordion.svelte'
const products = await getCollection('products')
displaySiteBanner.set(false)
import '../../styles/global.css';
import '../../styles/fonts.css';
import Hero from '../../components/elements/Hero.svelte';
import ContentImageFull from '../../components/sections/ContentImageFull.svelte';
const products = await getCollection('products');
displaySiteBanner.set(false);
products.sort((a,b) => a.data.order - b.data.order)
---

<Layout title="">
<div class="bg-black h-screen">
<Accordion products={products} client:only />


<Layout title='Overview'>
<div
class='fixed left-0 z-10 flex justify-center w-full align-middle top-24 h-5/6'>
<img src='/ega.svg' />
</div>
<div class='relative font-expressway red-radial-gradient scrollbar-hide'>
<div
class="relative z-20 h-fit bg-[url('/images/Overview_hero.svg')] bg-top bg-cover bg-center bg-no-repeat rounded-b-2xl lg:rounded-none">
<div
class='bg-gradient-to-t from-black py-20 rounded-b-2xl lg:rounded-none'>
<Hero
padding='pt-24'
title='OUR PRODUCT PORTFOLIO'
content='Real solutions to real problems - Created for Marines, by Marines at the Marine Corps Software Factory.'
contentClasses='pt-5'
/>
</div>
</div>
<div class='relative z-20'>
{products.map(e => (

<ContentImageFull
flipped = { e.data.order % 2 === 0 }
link=`products/${e.id}`
linkText='LEARN MORE'
title=`<span class="flex"><span class='text-mcswf-gold text-[48px] flex-shrink lg:text-[64px] font-menobanner font-light'>0${e.data.order}</span> <span class='ml-2 text-[32px] lg:ml-5'>${e.data['product']}</span></span>`
content={e.data['description']}
image={e.data['image2'].src}
imageClasses=''
titleClasses='text-white tracking-[4px]'
/>
),
)}
</div>
<div class='pt-20 relative z-20'>
<FooterFull client:only />
</div>
</div>
</Layout>

0 comments on commit 2d8b82f

Please sign in to comment.