Skip to content

Commit 4a8958d

Browse files
committed
Updated hero section on front page and added the bit under the faq
1 parent c2ce71d commit 4a8958d

File tree

4 files changed

+67
-38
lines changed

4 files changed

+67
-38
lines changed

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@ Use the following `docker-compose.yaml` file to deploy:
4242
```yaml
4343
services:
4444
db:
45+
restart: always
4546
image: postgres:latest
4647
environment:
4748
- POSTGRES_HOST_AUTH_METHOD=trust # fine for testing, ideally add a password before deployment

src/lib/assets/Construct Logo.3mf

92.3 KB
Binary file not shown.

src/lib/assets/model.png

23.3 KB
Loading

src/routes/+page.svelte

Lines changed: 66 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,13 @@
77
import Shop from './Shop.svelte';
88
import Footer from './Footer.svelte';
99
10-
import model from '$lib/assets/keyring.obj?url';
10+
import model from '$lib/assets/Construct Logo.3mf?url';
11+
import modelImage from '$lib/assets/model.png';
1112
1213
let { data } = $props();
1314
1415
import * as THREE from 'three';
15-
import { OBJLoader } from 'three/examples/jsm/Addons.js';
16+
import { ThreeMFLoader } from 'three/examples/jsm/Addons.js';
1617
import { OrbitControls } from 'three/examples/jsm/Addons.js';
1718
import { onMount } from 'svelte';
1819
import Head from '$lib/components/Head.svelte';
@@ -59,21 +60,21 @@
5960
controls.enablePan = false;
6061
controls.dampingFactor = 0.1;
6162
controls.enableDamping = true;
62-
controls.autoRotate = true;
63+
controls.autoRotate = false;
6364
controls.autoRotateSpeed = 2;
6465
controls.update();
6566
6667
// Lighting
67-
const hemisphere = new THREE.HemisphereLight(0xffffff, 0xffffff, 1.1);
68+
const hemisphere = new THREE.HemisphereLight(0xffffff, 0xffffff, 4);
6869
scene.add(hemisphere);
6970
70-
const directional = new THREE.DirectionalLight(0xffffff, 1.1);
71+
const directional = new THREE.DirectionalLight(0xffffff, 1);
7172
directional.castShadow = true;
7273
directional.shadow.mapSize.width = 2048;
7374
directional.shadow.mapSize.height = 2048;
7475
scene.add(directional);
7576
76-
const directional2 = new THREE.DirectionalLight(0xffffff, 1.1);
77+
const directional2 = new THREE.DirectionalLight(0xffffff, 1);
7778
directional2.castShadow = true;
7879
directional2.shadow.mapSize.width = 2048;
7980
directional2.shadow.mapSize.height = 2048;
@@ -92,20 +93,20 @@
9293
}
9394
}
9495
95-
var meshMaterial = new THREE.MeshStandardMaterial({
96-
transparent: true,
97-
opacity: 0.9,
98-
color: 0xb2a090,
99-
roughness: 0.5,
100-
flatShading: false,
101-
side: THREE.DoubleSide
102-
});
96+
// var meshMaterial = new THREE.MeshStandardMaterial({
97+
// transparent: true,
98+
// opacity: 1,
99+
// color: 0xb2a090,
100+
// roughness: 0.5,
101+
// flatShading: false,
102+
// side: THREE.DoubleSide
103+
// });
103104
104105
function parseObject(object: THREE.Group<THREE.Object3DEventMap>) {
105106
object = object as THREE.Group<THREE.Object3DEventMap> & { children: THREE.Mesh[] };
106107
107108
object.rotation.x = THREE.MathUtils.degToRad(-90);
108-
object.rotation.z = THREE.MathUtils.degToRad(-25);
109+
// object.rotation.z = THREE.MathUtils.degToRad(-25);
109110
110111
const aabb = new THREE.Box3().setFromObject(object);
111112
const center = aabb.getCenter(new THREE.Vector3());
@@ -121,8 +122,8 @@
121122
box.getSize(size);
122123
const largestDimension = Math.max(size.x, size.y, size.z);
123124
124-
camera.position.z = largestDimension * 0.6;
125-
camera.position.y = largestDimension * 1.4;
125+
camera.position.z = largestDimension * 0.3;
126+
camera.position.y = largestDimension * 1.38;
126127
127128
directional.position.set(largestDimension * 2, largestDimension * 2, largestDimension * 2);
128129
directional2.position.set(-largestDimension * 2, largestDimension * 2, -largestDimension * 2);
@@ -155,11 +156,11 @@
155156
// material.needsUpdate = true;
156157
// }
157158
158-
if (Array.isArray(mesh.material)) {
159-
mesh.material = meshMaterial;
160-
} else if (mesh.material instanceof THREE.Material) {
161-
mesh.material = meshMaterial;
162-
}
159+
// if (Array.isArray(mesh.material)) {
160+
// mesh.material = meshMaterial;
161+
// } else if (mesh.material instanceof THREE.Material) {
162+
// mesh.material = meshMaterial;
163+
// }
163164
164165
const edges = new THREE.EdgesGeometry(mesh.geometry);
165166
const lines = new THREE.LineSegments(
@@ -187,7 +188,7 @@
187188
scene.add(object);
188189
}
189190
190-
var loader = new OBJLoader();
191+
var loader = new ThreeMFLoader();
191192
192193
loader.load(
193194
model,
@@ -217,24 +218,40 @@
217218

218219
<div class="flex w-full flex-col items-center justify-center px-10 lg:flex-row">
219220
<div class="mt-30">
220-
<div class="flex flex-row">
221-
<a class="mb-5 flex h-7 flex-row items-center gap-2 hover:opacity-50 transition-opacity shrink pr-2" href="https://hackclub.com">
221+
<div class="relative z-1 flex flex-row">
222+
<a
223+
class="mb-1 flex h-7 shrink flex-row items-center gap-2 pr-2 transition-opacity hover:opacity-50"
224+
href="https://hackclub.com"
225+
>
222226
<img src="https://assets.hackclub.com/icon-rounded.svg" alt="Hack Club logo" class="h-7" />
223-
<p class="text-lg font-semibold"><span class="text-hc-red-500">Hack Club</span> presents...</p>
227+
<p class="text-lg font-semibold">
228+
<span class="font-bold text-hc-red-500">Hack Club</span> presents...
229+
</p>
224230
</a>
225231
</div>
226-
<h1 class="font-hero text-4xl text-primary-500 sm:text-5xl md:text-6xl">Construct</h1>
227-
<p class="my-3 text-xl font-medium">Spend 50 hours doing CAD projects, get a 3D printer!</p>
228-
{#if data.loggedIn}
229-
<Button text="Go to dashboard" href="/dashboard" />
230-
{:else}
231-
<Button text="Login with Hack Club" href="/auth/idv" />
232-
{/if}
233-
<p class="text-md my-3">Ages 13-18, launching [TBD]!</p>
234-
</div>
235-
<div class="mt-12 flex h-100 w-80 flex-col md:w-100">
236-
<canvas class="h-full w-full" id={`canvas`}></canvas>
237-
<p class="mt-2 w-full text-center text-sm">interact with me!</p>
232+
<div class="hidden sm:block">
233+
<div
234+
class="group z-0 flex flex-col overflow-clip transition-all hover:h-130 sm:h-25 sm:w-150 md:h-30 md:w-160 lg:h-35 lg:w-200"
235+
>
236+
<canvas
237+
class="h-200 w-full transition-transform sm:translate-y-[-255px] sm:group-hover:-translate-y-15 md:translate-y-[-255px] md:group-hover:-translate-y-15 lg:translate-y-[-330px] lg:group-hover:-translate-y-35"
238+
width="200"
239+
height="200"
240+
id={`canvas`}
241+
></canvas>
242+
</div>
243+
<p class="relative z-1 mt-2 w-full animate-pulse text-center text-sm">interact with me!</p>
244+
</div>
245+
<img src={modelImage} alt="construct model logo" class="mt-3 mb-6 sm:hidden" />
246+
<div class="relative z-1 w-full text-center">
247+
<p class="my-3 text-xl font-medium">Spend 50 hours doing CAD projects, get a 3D printer!</p>
248+
{#if data.loggedIn}
249+
<Button text="Go to dashboard" href="/dashboard" />
250+
{:else}
251+
<Button text="Login with Hack Club" href="/auth/idv" />
252+
{/if}
253+
<p class="text-md my-3">Ages 13-18, launching [TBD]!</p>
254+
</div>
238255
</div>
239256
</div>
240257

@@ -287,4 +304,15 @@
287304
</div>
288305
</div>
289306

307+
<div class="mt-15 mb-30 flex flex-col items-center justify-center gap-5 px-10">
308+
<h1 class="text-center text-3xl font-bold sm:text-4xl">Ready?</h1>
309+
<div class="w-full max-w-2xl text-center">
310+
{#if data.loggedIn}
311+
<Button text="Go to dashboard" href="/dashboard" />
312+
{:else}
313+
<Button text="Login with Hack Club" href="/auth/idv" />
314+
{/if}
315+
</div>
316+
</div>
317+
290318
<Footer />

0 commit comments

Comments
 (0)