Skip to content

Commit

Permalink
fix blob for mobile
Browse files Browse the repository at this point in the history
  • Loading branch information
Jeffrieh committed Mar 20, 2024
1 parent 891ae6b commit fa9bc5f
Show file tree
Hide file tree
Showing 7 changed files with 65 additions and 18 deletions.
10 changes: 10 additions & 0 deletions assets/scss/utility.scss
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,10 @@
opacity: 0.5;
}

.is-heavily-dimmed {
opacity: 0.2;
}

.has-header-top {
padding-top: 75px;
}
Expand Down Expand Up @@ -100,3 +104,9 @@
flex-direction: column-reverse;
}
}

.is-justify-content-start-tablet {
@include tablet {
justify-content: flex-start;
}
}
2 changes: 1 addition & 1 deletion components/AnimatedMesh.vue
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ const blobState: AnimatedObjectState = {
const brainState: AnimatedObjectState = {
properties: {
rotation: new Vector3(0, -0.3, 0),
position: new Vector3(5, 0, 0),
position: new Vector3(6, 0, 0),
scale: new Vector3(1, 1, 1),
},
uniforms: {
Expand Down
9 changes: 7 additions & 2 deletions components/EcosystemStatisticsBlock.vue
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
<template>
<div class="columns is-centered is-size-1 is-vcentered is-6">
<div class="column is-one-third" v-for="statistic in statistics">
<div
class="columns is-centered is-size-1 is-vcentered is-6 is-mobile is-multiline"
>
<div
class="column is-two-third is-one-third-tablet"
v-for="statistic in statistics"
>
<div class="has-text-weight-bold" style="font-size: 2.5rem">
<ClientOnly>
<div class="is-flex is-capitalized">
Expand Down
17 changes: 5 additions & 12 deletions components/HeroSection.vue
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,11 @@
<section class="section">
<div class="container mt-5">
<div class="columns is-vcentered">
<div class="column is-half" data-aos="fade-in" data-aos-delay="0">
<div
class="column is-full-mobile is-three-fifths-tablet is-half-widescreen"
data-aos="fade-in"
data-aos-delay="0"
>
<h1 v-if="title" class="title is-spaced is-auto-phrase is-in-front">
<span class="has-text-primary is-block is-in-front">{{
title
Expand All @@ -17,9 +21,6 @@
<slot name="subtitle"></slot>
<slot name="footer"></slot>
</div>
<div class="column is-half is-vcentered">
<slot name="side"></slot>
</div>
</div>
</div>
</section>
Expand Down Expand Up @@ -59,13 +60,5 @@ const props = defineProps({
font-size: 54px;
}
}
.three-canvas {
position: absolute;
top: 0;
left: 0;
z-index: 0;
width: 100%;
height: 100%;
}
}
</style>
41 changes: 40 additions & 1 deletion layouts/top.vue
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,16 @@

<div class="is-relative">
<div
:class="{ 'is-earth': route.name == 'ecosystem' }"
class="three-canvas is-absolute is-fullwidth has-background-smoke"
style="height: 750px"
>
<TresCanvas preset="realistic" ref="canvas" :alpha="true">
<TresPerspectiveCamera ref="camera" visible :position="[0, -1, 15]" />
<TresPerspectiveCamera
ref="camera"
visible
:position="[posX, -1, 15]"
/>

<TresAmbientLight :color="'#101D56'" :intensity="2" />

Expand All @@ -45,8 +50,42 @@

<script setup lang="ts">
const showNotification = ref(true);
const route = useRoute();
const WIDESCREEN = 1408;
const MOBILE = 768;
const screenSize = useWindowSize().width;
const posX = computed(() => {
if (screenSize.value <= MOBILE) {
return 6;
} else if (screenSize.value >= WIDESCREEN) {
return 0;
} else {
return 6 - ((screenSize.value - MOBILE) / (WIDESCREEN - MOBILE)) * 8;
}
});
//create a value of 0-6 that when the screen size is 300 (mobile) the number is 0 but when the screenSize is 1400+ the number is 6 and stays there
const close = () => {
showNotification.value = false;
};
</script>

<style lang="scss">
.three-canvas {
overflow: hidden;
display: flex;
justify-content: center;
opacity: 0.2;
@include desktop {
opacity: 0.5;
}
@include widescreen {
opacity: 1;
}
}
</style>
2 changes: 1 addition & 1 deletion pages/ecosystem/index.vue
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<template>
<div>
<HeroSection style="height: 550px">
<HeroSection style="height: 650px" class="">
<template #title>
<h1 class="has-text-primary title mb-5">
Be Part of the <br />
Expand Down
2 changes: 1 addition & 1 deletion pages/index.vue
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<template>
<div>
<div class="is-clipped">
<HeroSection style="min-height: 750px">
<template #title>
<h1 class="title is-spaced has-text-primary is-auto-phrase is-in-front">
Expand Down

0 comments on commit fa9bc5f

Please sign in to comment.