forked from Tresjs/lab
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request Tresjs#41 from Tresjs/feature/30-landing-page-with…
…-product feat: 30 landing page with product
- Loading branch information
Showing
14 changed files
with
2,251 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
<script setup lang="ts"> | ||
import { useGLTF, Levioso, ContactShadows } from '@tresjs/cientos' | ||
const props = defineProps({ | ||
color: { | ||
type: String, | ||
required: true, | ||
}, | ||
}) | ||
const { | ||
scene: headphones, | ||
nodes, | ||
materials, | ||
} = await useGLTF('/models/headphones/headphones.gltf', { | ||
draco: true, | ||
}) | ||
watch( | ||
() => props.color, | ||
color => { | ||
materials.Base.color.set(color) | ||
if (color === '#000000') { | ||
materials.Base.roughness = 1 | ||
materials.Cush.color.set('#050505') | ||
} else { | ||
materials.Cush.color.set('#A4BCB7') | ||
} | ||
}, | ||
{ immediate: true }, | ||
) | ||
console.log({ headphones, nodes, materials }) | ||
</script> | ||
<template> | ||
<Levioso> | ||
<primitive :object="nodes.Headphones_7" :position="[0, 0.5, 0]" :scale="[0.8, 0.8, 0.8]"></primitive> | ||
</Levioso> | ||
<ContactShadows :opacity="0.2" :blur="3" :position="[0, -2, 0]" /> | ||
</template> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,78 @@ | ||
<script setup lang="ts"> | ||
import { TresCanvas } from '@tresjs/core' | ||
import { BasicShadowMap, SRGBColorSpace } from 'three' | ||
import { MouseParallax } from '@tresjs/cientos' | ||
import Headphones from './Headphones.vue' | ||
const gl = { | ||
shadows: true, | ||
alpha: false, | ||
shadowMapType: BasicShadowMap, | ||
outputColorSpace: SRGBColorSpace, | ||
} | ||
const state = reactive({ | ||
selectedColor: '#903345', | ||
colors: ['#903345', '#F2D3AC', '#F2F2F2', '#000000'], | ||
}) | ||
</script> | ||
|
||
<template> | ||
<div class="landingpage-bg w-full inset-0 h-full"></div> | ||
<div class="absolute w-full inset-0 h-full flex justify-center items-center bg-red-200 bg-opacity-75"> | ||
<div class="w-2/3 h-1/2 bg-red-300 shadow-lg rounded flex"> | ||
<div class="w-1/2"></div> | ||
<div class="w-1/2 p-4 text-light"> | ||
<h1 class="title animate-fade-in-right animate-ease">Experience Sound</h1> | ||
|
||
<span class="absolute border-1 border-solid border-white w-800px inline-block" /> | ||
|
||
<p class="w-2/3 my-8 animate-fade-in"> | ||
Experience unparalleled audio immersion with the innovative SonicWave™️ Harmony Headphones. | ||
</p> | ||
|
||
<ul class="flex gap-8"> | ||
<li v-for="color in state.colors"> | ||
<button | ||
class="w-10 h-10 rounded-full border-2 border-solid border-white mr-2 cursor-pointer" | ||
:style="{ backgroundColor: color }" | ||
@click="state.selectedColor = color" | ||
></button> | ||
</li> | ||
</ul> | ||
</div> | ||
</div> | ||
</div> | ||
<div class="absolute w-1/2 inset-0 h-full flex justify-center items-center"> | ||
<TresCanvas v-bind="gl" class="pointer-events-none"> | ||
<TresPerspectiveCamera :position="[0, 0, 11]" /> | ||
<MouseParallax :factor="0.1" /> | ||
<Suspense> | ||
<Headphones :color="state.selectedColor" /> | ||
</Suspense> | ||
<TresAmbientLight :intensity="2" /> | ||
<TresPointLight :position="[0, 0, 10]" :intensity="1" /> | ||
<TresDirectionalLight :position="[3, 3, 3]" :intensity="3" /> | ||
</TresCanvas> | ||
</div> | ||
</template> | ||
|
||
<style scoped> | ||
@import url('https://fonts.googleapis.com/css2?family=Bebas+Neue&family=Heebo&display=swap'); | ||
* { | ||
font-family: 'Heebo', sans-serif; | ||
} | ||
.title { | ||
margin-top: -120px; | ||
font-family: 'Bebas Neue', cursive; | ||
font-size: 128px; | ||
} | ||
.landingpage-bg { | ||
background-image: url('/landingpage-bg.avif'); | ||
filter: blur(24px); | ||
} | ||
</style> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
--- | ||
thumbnail: /product-landing-page.png | ||
title: Product Landing Page | ||
slug: product-landing-page | ||
author: alvarosabu | ||
description: Transparent backdrop and model staging | ||
tags: ['product', 'levioso', 'glsl', 'contactShadows'] | ||
--- | ||
|
||
::product-landing-page | ||
:: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Binary file not shown.
Binary file not shown.
Oops, something went wrong.