Skip to content

Commit

Permalink
Merge pull request #93 from illacloud/feat/update-pricing
Browse files Browse the repository at this point in the history
Feat/update pricing
  • Loading branch information
Wangtaofeng authored Jan 31, 2024
2 parents 216b210 + fcab54d commit 7d7755f
Show file tree
Hide file tree
Showing 37 changed files with 2,018 additions and 79 deletions.
4 changes: 3 additions & 1 deletion src/ILLATheme/CommonFooter/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,9 @@ const CommonFooter: FC<ICommonFooterProps> = ({
whiteTheme ? "text-grayBlue-02" : "text-white-02",
)}
>
<Translate id="slogan-1">Build AI Driven Business App</Translate>
<Translate id="slogan-1">
Create AI-Driven Apps like Assembling Blocks
</Translate>
</span>
</div>
<div>
Expand Down
4 changes: 2 additions & 2 deletions src/components/banner/modal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -32,12 +32,12 @@ type Props = {
export const BannerModal: FC<Props> = ({
title = translate({
id: "blog.scroll_down",
message: "Build AI Driven Business Apps with ILLA Cloud",
message: "Create AI-Driven Apps like Assembling Blocks with ILLA Cloud",
}),
variant = "purple",
image = {
src: "https://cdn.illacloud.com/illa-website/home/blogIcon/modalIcon.webp",
alt: "Build AI Driven Business Apps with ILLA Cloud",
alt: "Create AI-Driven Apps like Assembling Blocks with ILLA Cloud",
href: CLOUD_URL,
},
}) => {
Expand Down
12 changes: 4 additions & 8 deletions src/components/common/Publicize/index.module.css
Original file line number Diff line number Diff line change
Expand Up @@ -2,20 +2,16 @@
@apply hidden lg:block bg-white/[0.04] rounded-[20px] cursor-pointer mx-auto;
@apply text-white min-w-[400px] h-[40px] overflow-hidden px-[25px];
@apply text-[14px] leading-[22px] font-[400] relative;
@apply border-[1px] border-solid border-white/[0.12];
@apply border-[1px] border-solid;
backdrop-filter: blur(5px);
border-color: rgba(199, 172, 255, 0.16);
}
.publicizeStyle {
@apply object-none object-center w-[402px] h-[124px] absolute top-[50%] left-[50%] z-[0] opacity-[0.16];
@apply object-none object-center w-[402px] h-[124px] absolute top-[50%] left-[50%] z-[0] opacity-[0.1];
@apply lg:w-[579px] lg:h-[179px] flex flex-row items-center justify-between;
filter: blur(23px);
transform: translate(-50%, -50%);
background: linear-gradient(
90deg,
#ea984c 0%,
#5c9ac6 45.31%,
#687100 91.49%
);
background: linear-gradient(90deg, #c56dfb 0%, #ad45ff 45.31%, #492cff 100%);
}
.publicIntru {
@apply flex items-center gap-[11px];
Expand Down
4 changes: 4 additions & 0 deletions src/components/common/TechButton/index.module.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
.techBtn {
@apply flex items-center justify-center w-full py-[10px] px-[32px] rounded-[8px] font-[500] text-[16px] leading-[28px] cursor-pointer text-white-01;
@apply bg-tech-purple-03 hover:bg-tech-purple-04 active:bg-tech-purple-02 hover:text-white-01 hover:no-underline;
}
31 changes: 31 additions & 0 deletions src/components/common/TechButton/index.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
import { FC } from "react"
import style from "./index.module.css"
import Link from "@docusaurus/Link"
import clsx from "clsx"
import { useUtmParams } from "@site/src/hooks/useUtmParams"

interface TechButtonProps {
btnText: string
link?: string
customClass?: string
handleClick?: () => void
}

const TechButton: FC<TechButtonProps> = ({
btnText,
link,
customClass,
handleClick,
}) => {
const getUtmParams = useUtmParams()
return (
<Link
to={getUtmParams(link)}
className={clsx("hover:no-underline", customClass)}
onClick={handleClick}
>
<span className={style.techBtn}>{btnText}</span>
</Link>
)
}
export default TechButton
4 changes: 2 additions & 2 deletions src/components/flow/DesignContent/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import ContentHeader from "../ContentHeader"
import { translate } from "@docusaurus/Translate"
import clsx from "clsx"

const tempContent = {
const CONTENT = {
titleExtra: translate({
id: "illa_flow.how_it_works.how_it_works",
message: "How it works",
Expand Down Expand Up @@ -77,7 +77,7 @@ const DesignContent: FC = () => {
contentImageTop,
contentImageBottomLeft,
contentImageBottomRight,
} = tempContent
} = CONTENT
return (
<div className={style.containerStyle}>
<ContentHeader title={title} desc={desc} titleExtra={titleExtra} />
Expand Down
4 changes: 3 additions & 1 deletion src/components/home/Index/Mobile/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,9 @@ const BannerMobile: FC<IBannerPCProps> = (props) => {
<div className={style.bannerContainer}>
<div className={style.textContainerStyle}>
<h1 className={style.sloganStyle}>
<Translate id="slogan-1">Build AI Driven Business App</Translate>
<Translate id="slogan-1">
Create AI-Driven Apps like Assembling Blocks
</Translate>
</h1>
<span className={style.descStyle}>
<Interpolate
Expand Down
11 changes: 0 additions & 11 deletions src/components/home/Index/PC/index.module.css
Original file line number Diff line number Diff line change
Expand Up @@ -6,17 +6,6 @@
@apply w-full overflow-hidden absolute z-[-1];
}

.bgStyle {
@apply hidden lg:block absolute top-[0px] z-[0] w-full h-[382px] object-top object-none;
}

.bgStyle::-webkit-media-controls-enclosure,
.bgStyle::-webkit-media-controls-panel,
.bgStyle::-webkit-media-controls-play-button,
.bgStyle::-webkit-media-controls-start-playback-button {
display: none;
}

.bannerContentContainer {
@apply flex justify-center pt-[24px] flex-col items-center gap-[186px];
@apply lg:max-w-[1040px];
Expand Down
13 changes: 5 additions & 8 deletions src/components/home/Index/PC/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import Solutions from "../components/Solutions"
import LinkButton from "@site/src/components/common/LinkButton"
import { CLOUD_URL } from "@site/src/constants/url"
import Interpolate from "@docusaurus/Interpolate"
import { useHomePaintBg } from "../hooks/usePaintBg"

const description = translate({
id: "description",
Expand All @@ -24,25 +25,21 @@ const BannerPC: FC<IBannerPCProps> = (props) => {
const canvasRef = useRef<HTMLCanvasElement | null>(null)
const containerRef = useRef<HTMLDivElement>(null)

usePaintBg(canvasRef, containerRef)
useHomePaintBg(canvasRef, containerRef)

return (
<div ref={containerRef} className={style.bannerContainerStyle}>
<div className={style.canvasContainerStyle}>
<canvas ref={canvasRef} />
</div>
<video className={style.bgStyle} loop autoPlay muted playsInline>
<source
src={require("/img/home3/bannerBg.mp4")?.default}
type="video/mp4"
/>
</video>
<div className={style.bannerContentContainer}>
<Publicize stars={githubStarts} />
<div className={style.bannerTextContainerStyle}>
<div className="flex flex-col gap-[16px]">
<h1 className={style.sloganStyle}>
<Translate id="slogan-1">Build AI Driven Business App</Translate>
<Translate id="slogan-1">
Create AI-Driven Apps like Assembling Blocks
</Translate>
</h1>
<span className={style.descStyle}>
<Interpolate
Expand Down
114 changes: 114 additions & 0 deletions src/components/home/Index/hooks/usePaintBg.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,114 @@
import { useCallback, useEffect, useRef } from "react"

export const useHomePaintBg = (canvasRef, containerRef) => {
const requestId = useRef(null)
const cacheWidth = useRef(containerRef.current?.clientWidth)
const init = useCallback(() => {
const canvas = canvasRef.current
const ctx = canvas.getContext("2d")
const interval = 56
const dropColor = "rgba(255, 255, 255, 1)"
let dropSpeed = 3
let dropAcceleration = 0.002

canvas.width = containerRef.current?.clientWidth
canvas.height = containerRef.current?.clientHeight

const drawGrid = () => {
ctx.strokeStyle = "rgba(255, 255, 255, 0.1)"

for (let y = 0; y <= canvas.height; y += interval) {
ctx.beginPath()
ctx.moveTo(0, y)
ctx.lineTo(canvas.width, y)
ctx.stroke()
}

for (let x = 0; x <= canvas.width; x += interval) {
ctx.beginPath()
ctx.moveTo(x, 0)
ctx.lineTo(x, canvas.height)
ctx.stroke()
}
}

const drawDrop = (drop) => {
const gradient = ctx.createLinearGradient(
drop.x,
drop.y,
drop.x,
drop.y + 40,
)
gradient.addColorStop(1, dropColor)
gradient.addColorStop(0, "rgba(255, 255, 255, 0)")
ctx.strokeStyle = gradient
ctx.beginPath()
ctx.moveTo(drop.x, drop.y)
ctx.lineTo(drop.x, drop.y + 80)
ctx.stroke()
}

const drops = [
{ x: interval * 4, y: -20 },
{ x: interval * 8, y: -100 },
{ x: interval * 12, y: -70 },
{ x: interval * 16, y: -50 },
{ x: interval * 20, y: -110 },
{ x: interval * 24, y: -20 },
{ x: interval * 28, y: -100 },
{ x: interval * 32, y: -70 },
{ x: interval * 36, y: -50 },
]

const animate = () => {
ctx.clearRect(0, 0, canvas.width, canvas.height)
drawGrid()
if (canvas.width > 390) {
for (let i = 0; i < drops.length; i++) {
const drop = drops[i]
drawDrop(drop)

drop.y += dropSpeed
dropSpeed -= dropAcceleration
if (dropSpeed <= 2) {
dropSpeed = 2
}
if (drop.y > canvas.height) {
drop.y = -20
dropSpeed = 3
}
}
requestId.current = requestAnimationFrame(animate)
}
}
requestId.current = animate()
}, [canvasRef])

useEffect(() => {
const item = containerRef.current
const observer = new ResizeObserver((entries) => {
const { width } = entries[0].contentRect
if (
width === cacheWidth.current ||
Math.abs(width - cacheWidth.current) < 10
)
return
cacheWidth.current = width
requestId.current && cancelAnimationFrame(requestId.current)
init()
})
observer.observe(item)
init()
return () => {
if (observer) {
observer.unobserve(item)
}
}
}, [containerRef, init])

useEffect(() => {
return () => {
requestId.current && cancelAnimationFrame(requestId.current)
}
}, [])
}
19 changes: 19 additions & 0 deletions src/components/pricing/CardList/index.module.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
.cardListTitle {
@apply flex flex-row items-center py-[8px] gap-[8px] font-[600] text-[16px] leading-[24px];
}

.cardListIcon {
@apply h-[16px] w-[16px] self-start flex-none text-tech-purple-03;
}

.cardListContent {
@apply flex py-[4px] flex-row items-center gap-[8px] font-[400] text-[14px] leading-[18px];
}

.lineThroughStyle {
@apply text-white-04 line-through ml-[24px];
}

.doubt {
@apply cursor-pointer w-[16px] h-[16px] ml-[8px] align-middle;
}
76 changes: 76 additions & 0 deletions src/components/pricing/CardList/index.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
import React, { FC, MouseEvent } from "react"
import clsx from "clsx"
import style from "./index.module.css"
import DoubtIcon from "@site/static/img/pricing/doubt.svg"
import PriceTipIcon from "@site/static/img/public/priceTip.svg"

interface CardListProps {
name: string
values: {
text: string
tip: string
hasLineThrough?: boolean
whiteThroughLine?: boolean
}[]
mouseLeave: () => void
mouseOver: (
e: MouseEvent,
value: string,
index: number,
isBound?: boolean,
) => void
index: number
}

export const CardList: FC<CardListProps> = ({
name,
values,
mouseLeave,
mouseOver,
index,
}) => {
return (
<div className="w-full">
<p className={style.cardListTitle}>{name}</p>
{values.map(({ text, tip, hasLineThrough, whiteThroughLine }, i) => {
return (
<p className={style.cardListContent} key={`${text}${i}`}>
{text && !hasLineThrough && (
<PriceTipIcon className={style.cardListIcon} />
)}
<span
className={clsx(
hasLineThrough && style.lineThroughStyle,
whiteThroughLine && "line-through",
)}
>
{text}
{!hasLineThrough && tip && (
<>
<span
className={clsx(style.doubt, "inline-block lg:hidden")}
onMouseOver={(e) => {
mouseOver(e, tip, index, true)
}}
onMouseLeave={mouseLeave}
>
<DoubtIcon className="h-[16px] w-[16px]" />
</span>
<span
className={clsx(style.doubt, "hidden lg:inline-block")}
onMouseOver={(e) => {
mouseOver(e, tip, index)
}}
onMouseLeave={mouseLeave}
>
<DoubtIcon className="h-[16px] w-[16px]" />
</span>
</>
)}
</span>
</p>
)
})}
</div>
)
}
Loading

0 comments on commit 7d7755f

Please sign in to comment.