style: hero landing page fleaker (#250)

* debug: disable onmount

* hide hero bg

* test wrapping text in div

* more debugging

* more debugggg

* fix positioning

* finally
This commit is contained in:
Rotimi Best
2024-04-11 01:42:56 +01:00
committed by GitHub
parent 763b1b658c
commit acad0e6c5c
3 changed files with 42 additions and 63 deletions
-1
View File
@@ -1,4 +1,3 @@
@tailwind base; @tailwind base;
@tailwind components; @tailwind components;
@tailwind utilities; @tailwind utilities;
+23 -43
View File
@@ -3,46 +3,18 @@
import { fly } from 'svelte/transition'; import { fly } from 'svelte/transition';
import { sineInOut } from 'svelte/easing'; import { sineInOut } from 'svelte/easing';
import { PUBLIC_ENABLE_USERS_COMPANIES } from '$env/static/public'; import { PUBLIC_ENABLE_USERS_COMPANIES } from '$env/static/public';
import HeroBackground from '$lib/Hero/HeroBackground.svelte';
let width = '710';
let height = '710';
let animate = false; let animate = false;
onMount(() => { onMount(() => {
const handleResize = () => {
const screenWidth = window.innerWidth;
if (screenWidth < 768) {
// Mobile view
width = '1920';
height = '1440';
} else {
// Desktop view
width = '710';
height = '710';
}
};
handleResize();
setTimeout(() => { setTimeout(() => {
animate = true; animate = true;
}, 70); }, 70);
window.addEventListener('resize', handleResize);
return () => {
window.removeEventListener('resize', handleResize);
};
}); });
</script> </script>
<div <div class="root relative border-b-2 text-center bg-[#F5F8FE] h-full mt-[5%] w-full">
class="relative border-b-2 text-center bg-[#F5F8FE] h-[110vh] lg:h-[150vh] mt-[5%] overflow-hidden" <div class="pt-24 w-full">
>
<div class="overflow-hidden absolute h-full top-0 z-0">
<HeroBackground />
</div>
<div class="z-30 absolute top-[13%] lg:top-[4%]">
<div class="mb-10 ml-[5%] lg:ml-0 flex w-full items-center justify-start lg:justify-center"> <div class="mb-10 ml-[5%] lg:ml-0 flex w-full items-center justify-start lg:justify-center">
<a <a
target="_blank" target="_blank"
@@ -54,7 +26,7 @@
> >
</div> </div>
<div class="justify-between w-[90%] absolute top-[3%] left-[4%] hidden lg:flex"> <div class="justify-between w-[90%] absolute top-[5%] left-[4%] hidden lg:flex">
{#if animate} {#if animate}
<div <div
class="relative transition-all hover:scale-110 rotate-12" class="relative transition-all hover:scale-110 rotate-12"
@@ -101,16 +73,18 @@
{/if} {/if}
</div> </div>
<h1 <div class="w-full flex flex-col">
class="mx-auto w-[89%] pr-20 lg:pr-0 lg:w-[60%] text-left lg:text-center font-bold md:leading-[1.5] text-slate-900 text-5xl lg:text-7xl" <h1
> class="mx-auto w-[89%] pr-20 lg:pr-0 lg:w-[60%] text-left lg:text-center font-bold md:leading-[1.5] text-slate-900 text-5xl lg:text-7xl"
Launch Your Online Bootcamp <span class="text-blue-700">In Minutes </span> >
</h1> Launch Your Online Bootcamp <span class="text-blue-700">In Minutes </span>
</h1>
<p class="text-md mx-auto mt-10 px-4 text-slate-700 md:text-lg lg:mt-6 lg:w-[42%] lg:p-0"> <p class="text-md mx-auto mt-10 px-4 text-slate-700 md:text-lg lg:mt-6 lg:w-[42%] lg:p-0">
Meet a better learning management system (LMS) for teachers and students. ClassroomIO allows Meet a better learning management system (LMS) for teachers and students. ClassroomIO allows
you to launch and scale your online bootcamp with ease. you to launch and scale your online bootcamp with ease.
</p> </p>
</div>
<div class="justify-between w-[90%] absolute top-[25%] left-[4%] hidden lg:flex"> <div class="justify-between w-[90%] absolute top-[25%] left-[4%] hidden lg:flex">
{#if animate} {#if animate}
@@ -161,7 +135,7 @@
<div class="my-10 flex flex-col items-center justify-center gap-4 md:flex-row"> <div class="my-10 flex flex-col items-center justify-center gap-4 md:flex-row">
<a <a
class="md:text-base w-11/12 rounded-md border-gray-200 border-2 px-6 py-3 text-sm font-medium text-center transition-all delay-100 hover:bg-black hover:text-white hover:shadow-xl hover:scale-95 md:w-fit lg:px-6 lg:py-4 lg:font-semibold" class="md:text-base w-11/12 rounded-md border-gray-200 border-2 px-6 py-3 text-sm font-medium text-center transition-all delay-100 hover:bg-gray-200 hover:shadow-xl hover:scale-95 md:w-fit lg:px-6 lg:py-4 lg:font-semibold"
href="/demo" href="/demo"
rel="noopener noreferrer nofollow" rel="noopener noreferrer nofollow"
> >
@@ -186,8 +160,8 @@
<div class="relative my-5 md:my-10"> <div class="relative my-5 md:my-10">
<img <img
{width} width="710"
{height} height="710"
src="./cio-hero.webp" src="./cio-hero.webp"
alt="hero section with dark vs light mode" alt="hero section with dark vs light mode"
class="mx-auto w-[85%] rounded-lg shadow-lg lg:w-[70%]" class="mx-auto w-[85%] rounded-lg shadow-lg lg:w-[70%]"
@@ -208,3 +182,9 @@
{/if} {/if}
</div> </div>
</div> </div>
<style>
.root {
background-image: url('/hero-bg.svg');
}
</style>
File diff suppressed because one or more lines are too long

Before

Width:  |  Height:  |  Size: 9.5 KiB

After

Width:  |  Height:  |  Size: 9.6 KiB