Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adding Boi to couple of places #1417

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
693 changes: 692 additions & 1 deletion web/package-lock.json

Large diffs are not rendered by default.

6 changes: 5 additions & 1 deletion web/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,9 @@
"@docusaurus/preset-classic": "2.4.0",
"@kodingdotninja/use-tailwind-breakpoint": "^0.0.5",
"@mdx-js/react": "^1.6.22",
"@react-hooks-library/core": "^0.5.1",
"@react-three/drei": "^7.5.1",
"@react-three/fiber": "^7.0.6",
"@svgr/webpack": "^6.5.1",
"autoprefixer": "^10.4.13",
"classnames": "^2.3.2",
Expand All @@ -37,7 +40,8 @@
"react-modal": "^3.14.3",
"react-tooltip": "^4.5.1",
"react-transition-group": "^4.4.5",
"tailwindcss": "^3.2.4"
"tailwindcss": "^3.2.4",
"three": "^0.130.1"
},
"devDependencies": {
"@docusaurus/module-type-aliases": "2.2.0",
Expand Down
131 changes: 131 additions & 0 deletions web/src/components/DaBoi.jsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,131 @@
import React, { Suspense, useRef, useEffect } from "react";
import { Canvas, useLoader, useThree } from "@react-three/fiber";
import { OrbitControls, Environment, useTexture } from "@react-three/drei";
import { FBXLoader } from "three/examples/jsm/loaders/FBXLoader";
import { Box3, Vector3 } from "three";

function Model() {
const fbx = useLoader(FBXLoader, "/boi/Models/bee_low.fbx");
const [baseColorMap, heightMap, metallicMap, normalMap, roughnessMap] =
useTexture([
"/boi/Textures/bee_low_body_low_BaseColor.png",
"/boi/Textures/bee_low_body_low_Height.png",
"/boi/Textures/bee_low_body_low_Metallic.png",
"/boi/Textures/bee_low_body_low_Normal.png",
"/boi/Textures/bee_low_body_low_Roughness.png",
]);

fbx.scale.set(0.6, 0.6, 0.6);
fbx.position.y = 1;
fbx.position.x = 0;
fbx.rotation.z = -0.1;

fbx.traverse((o) => {
if (o.isMesh) {
o.material.map = baseColorMap;
o.material.displacementMap = heightMap;
o.material.metalnessMap = metallicMap;
o.material.normalMap = normalMap;
o.material.roughnessMap = roughnessMap;
o.castShadow = true;
o.receiveShadow = true;
}
});

return (
<>
<primitive object={fbx} />
{fbx && <Controls model={fbx} />}
</>
);
}

function Lights() {
return (
<>
<directionalLight position={[8, 8, 2]} intensity={2} castShadow />
<hemisphereLight
color={"#ffffff"}
groundColor={"#b3858c"}
intensity={2}
/>
<spotLight
color={0xffffff}
intensity={100}
position={[2.5, 5, 2.5]}
angle={Math.PI / 6}
penumbra={1}
decay={2}
distance={0}
castShadow
shadow-mapSize-width={1024}
shadow-mapSize-height={1024}
shadow-camera-near={1}
shadow-camera-far={10}
shadow-focus={1}
/>
</>
);
}

function Controls({ model }) {
const { camera, gl } = useThree();

const controls = useRef();

useEffect(() => {
if (!controls.current) {
return;
}
if (!model) {
return;
}
const box = new Box3().setFromObject(model);
const center = box.getCenter(new Vector3());
controls.current.target.copy(center);
}, [model]);

return (
<OrbitControls
ref={controls}
args={[camera, gl.domElement]}
enablePan={false}
enableZoom={false}
enableDamping={true}
dampingFactor={0.1}
autoRotate={true}
autoRotateSpeed={2}
minPolarAngle={Math.PI / 2}
maxPolarAngle={Math.PI / 2}
minAzimuthAngle={-Math.PI / 2}
/>
);
}

export default function DaBoi({ height = 200, width = 200 }) {
return (
<Canvas
style={{
height,
width,
background: "transparent",
}}
camera={{ position: [0, 0, 245], fov: 50, near: 0.1, far: 1000 }}
>
<Suspense fallback={null}>
<Model />
<Environment
files={[
"/boi/pisa/px.png",
"/boi/pisa/nx.png",
"/boi/pisa/py.png",
"/boi/pisa/ny.png",
"/boi/pisa/pz.png",
"/boi/pisa/nz.png",
]}
/>
</Suspense>
<Lights />
</Canvas>
);
}
56 changes: 56 additions & 0 deletions web/src/components/DiscordCallout.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
import React, { Suspense, lazy } from "react";
import {
BreakPointHooks,
breakpointsTailwind,
} from "@react-hooks-library/core";
import SectionContainer from "./Layouts/SectionContainer";
import { DiscordIcon } from "./Nav/SocialIcons";

const { useGreater } = BreakPointHooks(breakpointsTailwind);

const DaBoi = lazy(() => import("./DaBoi"));

export function DiscordCallout() {
const isGreaterMd = useGreater("md");

return (
<SectionContainer className="space-y-16 lg:py-18">
<div className="flex justify-between items-center bg-gray-200 rounded-xl p-16 pl-16 relative">
<div className="space-y-6 max-w-prose">
<div className="space-y-2">
<h2 className="text-4xl font-bold text-gray-900">Meet Da Boi</h2>
<p className="text-gray-600 text-lg leading-relaxed">
Da Boi is our community mascot. He's a friendly little guy who
loves to code and hang out with his friends. Join our Discord to
meet him and the rest of the community!
</p>
</div>
<a
href="https://discord.gg/rzdnErX"
className="inline-flex gap-2 items-center space-x-2
px-3 py-2 rounded
bg-yellow-500 text-white text-sm leading-4
border border-yellow-500 hover:border-yellow-400
hover:bg-yellow-400
transition ease-out duration-200"
>
Join Discord <DiscordIcon />
</a>
</div>
<div
className="absolute right-1 top-1/2 -translate-y-1/2"
style={{
width: 400,
height: 400,
}}
>
{isGreaterMd && (
<Suspense fallback={null}>
<DaBoi height={400} width={400} />
</Suspense>
)}
</div>
</div>
</SectionContainer>
);
}
95 changes: 61 additions & 34 deletions web/src/components/Features.js
Original file line number Diff line number Diff line change
@@ -1,12 +1,17 @@
import React from 'react'
import React, { lazy, Suspense } from 'react'
import Link from '@docusaurus/Link'
import classNames from 'classnames'
import { Terminal, Layers, Coffee, Code, Unlock, Repeat, Send, Link2, Grid, ArrowRight, Globe, Settings, Mail, Type, Star } from 'react-feather'

import { BreakPointHooks, breakpointsTailwind } from '@react-hooks-library/core'

import SectionContainer from './Layouts/SectionContainer'

import styles from '../pages/styles.module.css'


const DaBoi = lazy(() => import('./DaBoi'))

const Lang = () => (
<>
<span className='underline decoration-yellow-500 font-bold'>
Expand Down Expand Up @@ -60,87 +65,109 @@ const TextLink = ({ url, label }) => (
</Link>
)

const { useGreater } = BreakPointHooks(breakpointsTailwind)

const Features = () => {
return (
<SectionContainer className='space-y-16 lg:py-18'>
<dl className='grid grid-cols-1 lg:grid-cols-4 md:gap-16 lg:gap-x-8 xl:gap-x-16'>

const isGreaterMd = useGreater('md')

return (
<SectionContainer className="space-y-16 lg:py-18">
<dl className="grid grid-cols-1 lg:grid-cols-3 md:gap-8 lg:gap-x-8 xl:gap-x-16">
<Feature
Icon={Star}
title='Open Source'
url='https://github.com/wasp-lang/wasp'
title="Open Source"
url="https://github.com/wasp-lang/wasp"
description={`
This is the way. Wasp is fully open-source and you're welcome to contribute!
`}
/>

<Feature
Icon={Unlock}
title='Full-stack Auth'
url='/blog/2023/04/12/auth-ui'
title="Full-stack Auth"
url="/blog/2023/04/12/auth-ui"
description={`
Add login with social providers or email in a few lines of code with powerful UI helpers. No third party vendor lock-in.
`}
/>

<Feature
Icon={Link2}
title='RPC (Client <-> Server)'
url='/docs/data-model/operations/overview'
title="RPC (Client <-> Server)"
url="/docs/data-model/operations/overview"
description={`
Wasp provides a typesafe RPC layer that instantly brings your data models and server logic to the client.
`}
/>

<Feature
Icon={Send}
title='Simple Deployment'
url='/docs/advanced/deployment/overview'
description={`
Deploy your app to any platform. Wasp offers CLI helpers for the most popular options.
`}
/>
<div className="self-center">
<Feature
Icon={Send}
title="Simple Deployment"
url="/docs/advanced/deployment/overview"
description={`
Deploy your app to any platform. Wasp offers CLI helpers for the most popular options.
`}
/>
</div>

<div className="hidden lg:grid place-content-center">
<div
style={{
width: "300px",
height: "300px",
}}
>
{isGreaterMd && (
<Suspense fallback={null}>
<DaBoi height={300} width={300} />
</Suspense>
)}
Comment on lines +122 to +125
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think boi fits well here, it messes up the page a bit too much in my opinion.

image

What about putting it up in the navbar instead?

image

</div>
</div>

<Feature
Icon={Settings}
title='Jobs'
url='/docs/advanced/jobs'
description={`
Easily define, schedule and run specialized server tasks.
Persistent, retryable, delayable.
`}
/>
<div className="self-center">
<Feature
Icon={Settings}
title="Jobs"
url="/docs/advanced/jobs"
description={`
Easily define, schedule and run specialized server tasks.
Persistent, retryable, delayable.
`}
/>
</div>

<Feature
Icon={Mail}
title='Email Sending'
url='/docs/advanced/email'
title="Email Sending"
url="/docs/advanced/email"
description={`
All you need to do is connect an email provider and you can send emails!
`}
/>

<Feature
Icon={Type}
title='Full-stack Type Safety'
url='/docs/tutorial/queries#implementing-a-query'
title="Full-stack Type Safety"
url="/docs/tutorial/queries#implementing-a-query"
description={`
Full support for TypeScript with auto-generated types that span the whole stack.
`}
/>

<Feature
Icon={Grid}
title='And More!'
url='/docs'
title="And More!"
url="/docs"
description={`
Custom API routes, database seeding, optimistic updates, automatic cache invalidation on the client, ...
`}
/>
</dl>
</SectionContainer>
)
);
}

const FeaturesWithSkewedBorder = () => (
Expand Down
1 change: 0 additions & 1 deletion web/src/components/Hero.js
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,6 @@ entity Task {=psl ... psl=} // Your Prisma data model.

</div>


{/* 1-min video */}
{/*
<div className='flex justify-center mt-20'>
Expand Down
Loading
Loading