- {
- /* render blocks */
- article.blocks.map((block, key) => {
- return
;
- })
- }
+
+
+
+
+ {
+ /* render blocks */
+ article.blocks.map((block, key) => {
+ return ;
+ })
+ }
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
-
-
-
diff --git a/packages/frontend/core/src/components/affine/onboarding/steps/unfolding.css.ts b/packages/frontend/core/src/components/affine/onboarding/steps/unfolding.css.ts
index aefeb25f08..cb3ab184f0 100644
--- a/packages/frontend/core/src/components/affine/onboarding/steps/unfolding.css.ts
+++ b/packages/frontend/core/src/components/affine/onboarding/steps/unfolding.css.ts
@@ -20,11 +20,16 @@ const fadeOut = keyframes({
export const unfoldingWrapper = style([
paperLocation,
{
+ vars: {
+ '--hover-offset-y': '0px',
+ '--hover-scale': '1',
+ },
display: 'flex',
alignItems: 'center',
justifyContent: 'center',
- transform: 'rotate(var(--toRotateZ))',
+ transform:
+ 'rotate(var(--toRotateZ)) translateY(var(--hover-offset-y)) scale(var(--hover-scale))',
cursor: 'pointer',
backgroundColor: onboardingVars.paper.bg,
@@ -38,6 +43,13 @@ export const unfoldingWrapper = style([
transition: `all 0.23s ease, width ${unfolding.sizeTransition}, height ${unfolding.sizeTransition}, transform ${unfolding.transformTransition}`,
+ ':hover': {
+ vars: {
+ '--hover-offset-y': '-10px',
+ '--hover-scale': '1.03',
+ },
+ },
+
'::before': {
// hack border
content: '""',
@@ -53,6 +65,9 @@ export const unfoldingWrapper = style([
'&[data-fold="false"]': {
vars: {
'--toRotateZ': '0deg',
+ // reset hover to avoid flickering
+ '--hover-offset-y': '0px',
+ '--hover-scale': '1',
},
width: onboardingVars.article.w,
height: onboardingVars.article.h,
diff --git a/packages/frontend/core/src/components/affine/onboarding/style.css.ts b/packages/frontend/core/src/components/affine/onboarding/style.css.ts
index f6ae03ae60..67c8dfbb17 100644
--- a/packages/frontend/core/src/components/affine/onboarding/style.css.ts
+++ b/packages/frontend/core/src/components/affine/onboarding/style.css.ts
@@ -1,4 +1,4 @@
-import { globalStyle, style } from '@vanilla-extract/css';
+import { globalStyle, keyframes, style } from '@vanilla-extract/css';
// in case that we need to support dark mode later
export const onboardingVars = {
@@ -23,16 +23,25 @@ export const onboardingVars = {
transformTransition: '0.3s ease',
},
web: {
- bg: '#fafafa',
+ bg: '#F4F4F5',
+ windowShadow:
+ '1px 18px 39px 0px rgba(0, 0, 0, 0.15), 5px 71px 71px 0px rgba(0, 0, 0, 0.09), 12px 160px 96px 0px rgba(0, 0, 0, 0.05), 20px 284px 114px 0px rgba(0, 0, 0, 0.01), 32px 443px 124px 0px rgba(0, 0, 0, 0.00)',
},
article: {
w: '1200px',
h: '800px',
+ r: '8px',
},
edgeless: {
w: '1200px',
h: '800px',
+ r: '8px',
+ },
+ wellDone: {
+ w: '800px',
+ h: '600px',
+ r: '12px',
},
canvas: {
@@ -62,6 +71,11 @@ export const perspective = style({
transformStyle: 'preserve-3d',
});
+export const fadeIn = keyframes({
+ from: { opacity: 0 },
+ to: { opacity: 1 },
+});
+
export const onboarding = style([
perspective,
{
@@ -80,9 +94,17 @@ export const onboarding = style([
inset: 0,
background: onboardingVars.web.bg,
transform: 'translateZ(-1000px) scale(2)',
+ transition: 'opacity 0.3s ease',
},
'&[data-is-desktop="true"]::after': {
- content: 'unset',
+ animation: `${fadeIn} 0.8s linear`,
+ // content: 'unset',
+ background:
+ // 'linear-gradient(180deg, rgba(0,0,0,0.8) 0%, rgba(0,0,0,0) 99.58%)',
+ 'linear-gradient(180deg, rgba(0,0,0,0.9) 0%, rgba(0,0,0,0) 80%)',
+ },
+ '&[data-is-window="true"][data-is-desktop="true"]::after': {
+ opacity: 0,
},
},
},
diff --git a/packages/frontend/core/src/components/affine/onboarding/switch-widgets/block.tsx b/packages/frontend/core/src/components/affine/onboarding/switch-widgets/block.tsx
index 93c1aa234d..d564a6df8b 100644
--- a/packages/frontend/core/src/components/affine/onboarding/switch-widgets/block.tsx
+++ b/packages/frontend/core/src/components/affine/onboarding/switch-widgets/block.tsx
@@ -47,7 +47,7 @@ export const OnboardingBlock = ({
const blockStyles = {
...baseStyles,
...style,
- ...customStyle?.[mode],
+ ...customStyle?.[mode === 'page' ? 'page' : 'edgeless'],
} as CSSProperties;
return (
@@ -58,7 +58,7 @@ export const OnboardingBlock = ({
}}
className={onboardingBlock}
data-mode={mode}
- data-bg-mode={bg && mode === 'edgeless'}
+ data-bg-mode={bg && mode !== 'page'}
data-invisible={mode === 'page' && edgelessOnly}
>
{children}
diff --git a/packages/frontend/core/src/components/affine/onboarding/switch-widgets/style.css.tsx b/packages/frontend/core/src/components/affine/onboarding/switch-widgets/style.css.tsx
index d01bccc2ae..7337e95ab0 100644
--- a/packages/frontend/core/src/components/affine/onboarding/switch-widgets/style.css.tsx
+++ b/packages/frontend/core/src/components/affine/onboarding/switch-widgets/style.css.tsx
@@ -109,7 +109,7 @@ export const onboardingBlock = style([
'&:last-child': {
marginBottom: 0,
},
- '&[data-mode="edgeless"]': {
+ '&[data-mode="edgeless"], &[data-mode="well-done"]': {
transition: `all ${onboardingVars.block.transition} var(--enter-delay)`,
},
'&[data-mode="page"]': {
diff --git a/packages/frontend/core/src/components/affine/onboarding/types.ts b/packages/frontend/core/src/components/affine/onboarding/types.ts
index eb749c858c..bff4f53169 100644
--- a/packages/frontend/core/src/components/affine/onboarding/types.ts
+++ b/packages/frontend/core/src/components/affine/onboarding/types.ts
@@ -3,7 +3,7 @@ import type { PropsWithChildren, ReactNode } from 'react';
export type OnboardingStep = 'enter' | 'unfold' | 'edgeless-switch';
export type ArticleId = '0' | '1' | '2' | '3' | '4';
-export type EdgelessSwitchMode = 'edgeless' | 'page';
+export type EdgelessSwitchMode = 'edgeless' | 'page' | 'well-done';
/**
* Paper enter animation options
@@ -77,10 +77,7 @@ export interface OnboardingBlockOption extends PropsWithChildren {
style?: CSSProperties;
/** customize style for different mode */
- customStyle?: {
- page?: CSSProperties;
- edgeless?: CSSProperties;
- };
+ customStyle?: Partial
>;
/** attach a sub block to current block */
sub?: OnboardingBlockOption;