Skip to content

Commit 6bebe03

Browse files
committed
Added Archive skies
1 parent 0d3b5a5 commit 6bebe03

File tree

10 files changed

+44
-63
lines changed

10 files changed

+44
-63
lines changed

app/page.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import HomeClient from './home-client';
22
import { listSlugs, getIndex } from './lib/skybox';
33

44
export default function Page() {
5-
const slugs = listSlugs();
5+
const slugs = listSlugs({ includeArchived: true });
66
const meta = getIndex();
77
return <HomeClient slugs={slugs} meta={meta} />;
88
}

app/skyboxes/[slug]/skybox-client.tsx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,9 @@ export default function SkyboxClient({ slug, skyboxData, previewCount }: SkyboxC
8383
<div className="flex flex-col sm:flex-row gap-3 w-full md:w-auto">
8484

8585
{/* Source engine download
86-
86+
87+
https://github.com/Jacobdeanr/Source_Skyboxes_NextJS/releases/download/assets/sky_cloudy005.tgd
88+
8789
8890
*/}
8991
{Object.values(downloads).map((d) => (

app/ui/modal.tsx

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -126,19 +126,19 @@ export default function Modal({ slug, meta, onClose }: { slug: string; meta: Sky
126126
<h3 className="font-medium text-neutral-200">Environment Parameters</h3>
127127
<div className="grid gap-6 lg:grid-cols-2 lg:gap-x-8 items-start">
128128
{/* Fog Parameters */}
129-
{meta?.fogParameters && (
130-
<div className="bg-neutral-900/50 backdrop-blur-sm rounded-xl p-6 border border-neutral-800">
131-
<h2 className="text-xl font-semibold text-white mb-4">Fog Parameters</h2>
132-
<FogParams {...meta.fogParameters} />
133-
</div>
134-
)}
135-
{/* Sun Parameters */}
136-
{meta?.sunParameters && (
137-
<div className="bg-neutral-900/50 backdrop-blur-sm rounded-xl p-6 border border-neutral-800">
138-
<h2 className="text-xl font-semibold text-white mb-4">Sun Parameters</h2>
139-
<SunParams {...meta.sunParameters} />
140-
</div>
141-
)}
129+
{meta?.fogParameters && (
130+
<div className="bg-neutral-900/50 backdrop-blur-sm rounded-xl p-6 border border-neutral-800">
131+
<h2 className="text-xl font-semibold text-white mb-4">Fog Parameters</h2>
132+
<FogParams {...meta.fogParameters} />
133+
</div>
134+
)}
135+
{/* Sun Parameters */}
136+
{meta?.sunParameters && (
137+
<div className="bg-neutral-900/50 backdrop-blur-sm rounded-xl p-6 border border-neutral-800">
138+
<h2 className="text-xl font-semibold text-white mb-4">Sun Parameters</h2>
139+
<SunParams {...meta.sunParameters} />
140+
</div>
141+
)}
142142
</div>
143143
</div>
144144
)}

app/ui/skyboxcard.tsx

Lines changed: 0 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -70,26 +70,6 @@ export default function SkyboxCard({ slug, meta }: { slug: string; meta: SkyboxM
7070
<h2 className="text-sm font-semibold text-white line-clamp-2">
7171
{displayTitle}
7272
</h2>
73-
{/*
74-
<div className="flex items-center space-x-3 text-xs text-neutral-300">
75-
{meta?.sunParameters?.pitch !== undefined && (
76-
<span className="inline-flex items-center" title="Pitch">
77-
<svg className="w-3 h-3 mr-1 text-blue-400" fill="none" viewBox="0 0 24 24" stroke="currentColor">
78-
<path strokeLinecap="round" strokeLinejoin="round" strokeWidth={2} d="M19 14l-7 7m0 0l-7-7m7 7V3" />
79-
</svg>
80-
{meta.sunParameters.pitch}°
81-
</span>
82-
)}
83-
{meta?.sunParameters?.sunAngle !== undefined && (
84-
<span className="inline-flex items-center" title="Sun Angle">
85-
<svg className="w-3 h-3 mr-1 text-amber-400" fill="none" viewBox="0 0 24 24" stroke="currentColor">
86-
<path strokeLinecap="round" strokeLinejoin="round" strokeWidth={2} d="M12 3v1m0 16v1m9-9h-1M4 12H3m15.364 6.364l-.707-.707M6.343 6.343l-.707-.707m12.728 0l-.707.707M6.343 17.657l-.707.707M16 12a4 4 0 11-8 0 4 4 0 018 0z" />
87-
</svg>
88-
{meta.sunParameters.sunAngle}°
89-
</span>
90-
)}
91-
</div>
92-
*/}
9373
</div>
9474

9575
{/* Always visible title on mobile */}

app/ui/skyboxgrid.tsx

Lines changed: 18 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,14 @@ import type { SkyboxMeta } from '../types/skybox';
44
import { SortOption } from './sort-types';
55
import SkyboxCard from './skyboxcard';
66

7-
const TIME_OF_DAY_ORDER = ['Morning', 'Afternoon', 'Evening', 'Night', 'Other'];
8-
const WEATHER_CONDITIONS_ORDER = ['Clear', 'Cloudy', 'Hazy', 'Overcast', 'Other'];
7+
const TIME_OF_DAY_ORDER = ['Morning', 'Afternoon', 'Evening', 'Night', 'Other', 'Archived'];
8+
const WEATHER_CONDITIONS_ORDER = ['Clear', 'Cloudy', 'Hazy', 'Overcast', 'Other', 'Archived'];
99

1010
// Helper functions
11-
function getSkyboxCategory(slug: string, meta: Record<string, SkyboxMeta>, category: 'timeOfDay' | 'weatherCondition'): string {
11+
function getSkyboxCategory(slug: string, meta: Record<string, SkyboxMeta>, category: 'timeOfDay' | 'weatherCondition' ): string {
12+
if (meta[slug].archived) {
13+
return 'Archived';
14+
}
1215
return meta[slug]?.[category] || 'Other';
1316
}
1417

@@ -39,7 +42,7 @@ function sortSkyboxesByPitch(slugs: string[], meta: Record<string, SkyboxMeta>):
3942
function groupSkyboxes(
4043
slugs: string[],
4144
meta: Record<string, SkyboxMeta>,
42-
category: 'timeOfDay' | 'weatherCondition'
45+
category: 'timeOfDay' | 'weatherCondition'
4346
): Record<string, string[]> {
4447
const groups: Record<string, string[]> = {};
4548

@@ -48,7 +51,9 @@ function groupSkyboxes(
4851
if (!groups[categoryValue]) {
4952
groups[categoryValue] = [];
5053
}
54+
5155
groups[categoryValue].push(slug);
56+
console.log('categoryValue', categoryValue, slug);
5257
});
5358

5459
return groups;
@@ -61,12 +66,14 @@ function groupAndSortSkyboxes(
6166
): { title: string; slugs: string[] }[] {
6267
const groups = groupSkyboxes(slugs, meta, category);
6368
const order = category === 'timeOfDay' ? TIME_OF_DAY_ORDER : WEATHER_CONDITIONS_ORDER;
64-
return order
65-
.filter(cat => groups[cat])
66-
.map(cat => ({
67-
title: cat,
68-
slugs: sortSkyboxesByPitch(groups[cat], meta)
69-
}));
69+
70+
console.log('order', order.filter(cat => groups[cat]));
71+
72+
73+
return order.filter(cat => groups[cat]).map(cat => ({
74+
title: cat,
75+
slugs: sortSkyboxesByPitch(groups[cat], meta)
76+
}));
7077
}
7178

7279
interface SkyboxGridProps {
@@ -105,7 +112,7 @@ export default function SkyboxGrid({ slugs, meta, sort = 'time-of-day', query }:
105112
</span>
106113
</h2>
107114
<p className="mt-2 text-sm text-neutral-400 pl-6 max-w-2xl">
108-
Browse the collection of {title.toLowerCase()} skyboxes for your next project.
115+
{title === 'Archived' ? 'The original source files for these skies were lost to time, thus are unable to be remastered. However, the source engine files are still available for download.' : `Browse the collection of ${title.toLowerCase()} skyboxes for your next project.`}
109116
</p>
110117
</div>
111118

@@ -114,18 +121,6 @@ export default function SkyboxGrid({ slugs, meta, sort = 'time-of-day', query }:
114121
<SkyboxCard key={slug} slug={slug} meta={meta[slug] || {}} />
115122
))}
116123
</div>
117-
{/*
118-
{slugs.length > 4 && (
119-
<div className="text-center pt-4">
120-
<button className="inline-flex items-center text-sm font-medium text-blue-400 hover:text-blue-300 transition-colors">
121-
View all {slugs.length} {title.toLowerCase()} skies
122-
<svg className="w-4 h-4 ml-2" fill="none" stroke="currentColor" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg">
123-
<path strokeLinecap="round" strokeLinejoin="round" strokeWidth={2} d="M9 5l7 7-7 7" />
124-
</svg>
125-
</button>
126-
</div>
127-
)}
128-
*/}
129124
</section>
130125
))}
131126
</div>

public/data/sky_devroom_hdr.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,5 +5,6 @@
55
"license": "CC BY 4.0",
66
"categories": [
77
"Misc"
8-
]
8+
],
9+
"archived": true
910
}

public/data/sky_ethereal01_hdr.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,5 +31,6 @@
3131
38,
3232
47
3333
]
34-
}
34+
},
35+
"archived": true
3536
}

public/data/sky_fracture01_hdr.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,5 +25,6 @@
2525
87,
2626
103
2727
]
28-
}
28+
},
29+
"archived": true
2930
}

public/data/sky_lab_hdr.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,5 +25,6 @@
2525
113,
2626
140
2727
]
28-
}
28+
},
29+
"archived": true
2930
}

tsconfig.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,6 @@
2222
"@/*": ["./*"]
2323
}
2424
},
25-
"include": ["next-env.d.ts", "**/*.ts", "**/*.tsx", ".next/types/**/*.ts"],
25+
"include": ["next-env.d.ts", "**/*.ts", "**/*.tsx", ".next/types/**/*.ts", "scripts/generate-sitemap.js"],
2626
"exclude": ["node_modules"]
2727
}

0 commit comments

Comments
 (0)