Skip to content

Commit a22d52c

Browse files
committed
Fixed blur animationthat crashed mobile devices
1 parent 4970ba4 commit a22d52c

File tree

7 files changed

+63
-15
lines changed

7 files changed

+63
-15
lines changed

components/common/Header.jsx

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,14 @@ const MenuTray = styled.div`
7575
display: none;
7676
}
7777
`;
78-
const MenuItems = styled.ul``;
78+
const MenuItems = styled.ul`
79+
@media only screen and (max-width: 767px) {
80+
opacity: 0;
81+
padding: 4px 24px 24px;
82+
transform: translate3d(0, -150px, 0);
83+
transition: transform 1s cubic-bezier(0.23, 1, 0.32, 1) 0.5s,opacity 0.7s cubic-bezier(0.23, 1, 0.32, 1) 0.2s;
84+
}
85+
`;
7986
const MenuItem = styled.li`
8087
margin-left: 24px;
8188
float: left;

components/common/Site.jsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,8 @@ const Site = ({ children }) => {
2929
getColorSchemeSetting,
3030
setColorScheme,
3131
getSystemColorScheme,
32-
windowDimensions
32+
windowDimensions,
33+
breakpoint: windowDimensions.breakpoint
3334
}}>
3435
<ThemeProvider theme={theme}>
3536
{children}

components/common/layout/Stack.jsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import spacing from "@/styles/spacing";
55
const StackWrap = styled.div`
66
display: flex;
77
flex-direction: ${({ $direction }) => ($direction === "vertical" ? `column` : `row`)}${({ $reverse }) => ($reverse ? `-reverse` : ``)};
8-
${({ $gap, theme }) =>
8+
${({ $gap }) =>
99
$gap !== undefined && $gap !== null && $gap !== false
1010
? `gap: ${Array.isArray($gap) ? spacing(...$gap) : spacing($gap)};`
1111
: ``}

components/pages/dev/layout.js

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,6 @@ export default function DevPage() {
7474
</Column>
7575
</Row>
7676
</Section>
77-
7877
<Section contained gutterBottom>
7978
<Row gap>
8079
<Column>
@@ -143,7 +142,7 @@ export default function DevPage() {
143142
</Row>
144143
</Section>
145144

146-
<Section>
145+
<Section contained gutterBottom>
147146
<Row gap>
148147
<Column>
149148
<Typography variant="headline-reduced">Offsets</Typography>
@@ -213,7 +212,7 @@ export default function DevPage() {
213212
</Row>
214213
</Section>
215214

216-
<Section>
215+
<Section contained gutterBottom>
217216
<Row gap>
218217
<Column>
219218
<Typography variant="headline-reduced">Auto Width</Typography>
@@ -248,7 +247,7 @@ export default function DevPage() {
248247
</Row>
249248
</Section>
250249

251-
<Section>
250+
<Section contained>
252251
<Row gap>
253252
<Column>
254253
<Typography variant="headline-reduced">Align</Typography>
@@ -279,7 +278,7 @@ export default function DevPage() {
279278
</Row>
280279
</Section>
281280

282-
<Section>
281+
<Section contained gutterBottom>
283282
<Row gap>
284283
<Column>
285284
<Typography variant="headline-reduced">Distribute</Typography>

components/pages/home/HeroImage.jsx

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ const SceneWrap = styled.div`
3838
animation: ${scaleBlurIn} 500ms 750ms cubic-bezier(0.0, 0.0, 0.2, 1);
3939
animation-fill-mode: both;
4040
transform-origin: bottom center;
41-
margin-top: 64px;
41+
margin-top: 6%;
4242
`;
4343
const ImageWrap = styled.div`
4444
position: relative;
@@ -64,8 +64,15 @@ const colorFlairPiece = css`
6464
left: 0;
6565
width: 200px;
6666
height: 200px;
67-
border-radius: 50%;
6867
filter: blur(100px);
68+
69+
@media ${mediaQueries.md} {
70+
width: 20vw;
71+
height: 20vw;
72+
filter: blur(10vw);
73+
}
74+
75+
border-radius: 50%;
6976
background: #4F95FF;
7077
transform-origin: bottom center;
7178
`;
@@ -125,8 +132,8 @@ const StyledHardwareLockup = styled(HardwareLockup)`
125132
`
126133

127134
const HeroImage = ({ percentage }) => {
128-
const { colorScheme = "light" } = useSite();
129-
const adjustedPercentage = (Math.min(Math.max(percentage, 1), 1.2) - 1) * 5;
135+
const { colorScheme = "light", breakpoint } = useSite();
136+
const adjustedPercentage = (Math.min(Math.max(percentage - ( breakpoint === 'xs' ? .2 : 0), 1), 1.2) - 1) * 5;
130137

131138
return (
132139
<SceneWrap>

styles/globals.css

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -54,9 +54,6 @@ body {
5454
html {
5555
height: 100%;
5656
}
57-
body {
58-
min-height: 100%;
59-
}
6057

6158
a {
6259
color: inherit;
@@ -331,12 +328,17 @@ html[data-color-scheme='dark'] {
331328
--material-filters: saturate(180%) blur(20px);
332329
}
333330

331+
#__next {
332+
display: contents;
333+
}
334+
334335
main {
335336
background: linear-gradient(
336337
to bottom,
337338
var(--dark) 0%,
338339
var(--fill-gray-secondary-alt) 100%
339340
);
341+
min-height: calc(100vh - 168px);
340342
}
341343

342344
main a {

yarn.lock

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -915,6 +915,17 @@ fast-deep-equal@^3.1.1, fast-deep-equal@^3.1.3:
915915
resolved "https://registry.yarnpkg.com/fast-deep-equal/-/fast-deep-equal-3.1.3.tgz#3a7d56b559d6cbc3eb512325244e619a65c6c525"
916916
integrity sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q==
917917

918+
fast-glob@^3.2.11:
919+
version "3.2.12"
920+
resolved "https://registry.yarnpkg.com/fast-glob/-/fast-glob-3.2.12.tgz#7f39ec99c2e6ab030337142da9e0c18f37afae80"
921+
integrity sha512-DVj4CQIYYow0BlaelwK1pHl5n5cRSJfM60UA0zK891sVInoPri2Ekj7+e1CT3/3qxXenpI+nBBmQAcJPJgaj4w==
922+
dependencies:
923+
"@nodelib/fs.stat" "^2.0.2"
924+
"@nodelib/fs.walk" "^1.2.3"
925+
glob-parent "^5.1.2"
926+
merge2 "^1.3.0"
927+
micromatch "^4.0.4"
928+
918929
fast-glob@^3.2.9:
919930
version "3.2.11"
920931
resolved "https://registry.yarnpkg.com/fast-glob/-/fast-glob-3.2.11.tgz#a1172ad95ceb8a16e20caa5c5e56480e5129c1d9"
@@ -1059,6 +1070,17 @@ globals@^13.6.0, globals@^13.9.0:
10591070
dependencies:
10601071
type-fest "^0.20.2"
10611072

1073+
globby@13.1.2:
1074+
version "13.1.2"
1075+
resolved "https://registry.yarnpkg.com/globby/-/globby-13.1.2.tgz#29047105582427ab6eca4f905200667b056da515"
1076+
integrity sha512-LKSDZXToac40u8Q1PQtZihbNdTYSNMuWe+K5l+oa6KgDzSvVrHXlJy40hUP522RjAIoNLJYBJi7ow+rbFpIhHQ==
1077+
dependencies:
1078+
dir-glob "^3.0.1"
1079+
fast-glob "^3.2.11"
1080+
ignore "^5.2.0"
1081+
merge2 "^1.4.1"
1082+
slash "^4.0.0"
1083+
10621084
globby@^11.0.4:
10631085
version "11.1.0"
10641086
resolved "https://registry.yarnpkg.com/globby/-/globby-11.1.0.tgz#bd4be98bb042f83d796f7e3811991fbe82a0d34b"
@@ -1585,6 +1607,11 @@ prelude-ls@^1.2.1:
15851607
resolved "https://registry.yarnpkg.com/prelude-ls/-/prelude-ls-1.2.1.tgz#debc6489d7a6e6b0e7611888cec880337d316396"
15861608
integrity sha512-vkcDPrRZo1QZLbn5RLGPpg/WmIQ65qoWWhcGKf/b5eplkkarX0m9z8ppCat4mlOqUsWpyNuYgO3VRyrYHSzX5g==
15871609

1610+
prettier@^2.5.1:
1611+
version "2.7.1"
1612+
resolved "https://registry.yarnpkg.com/prettier/-/prettier-2.7.1.tgz#e235806850d057f97bb08368a4f7d899f7760c64"
1613+
integrity sha512-ujppO+MkdPqoVINuDFDRLClm7D78qbDt0/NR+wp5FqEZOoTNAjPHWj17QRhu7geIHJfcNhRk1XVQmF8Bp3ye+g==
1614+
15881615
prop-types@^15.7.2, prop-types@^15.8.1:
15891616
version "15.8.1"
15901617
resolved "https://registry.yarnpkg.com/prop-types/-/prop-types-15.8.1.tgz#67d87bf1a694f48435cf332c24af10214a3140b5"
@@ -1748,6 +1775,11 @@ slash@^3.0.0:
17481775
resolved "https://registry.yarnpkg.com/slash/-/slash-3.0.0.tgz#6539be870c165adbd5240220dbe361f1bc4d4634"
17491776
integrity sha512-g9Q1haeby36OSStwb4ntCGGGaKsaVSjQ68fBxoQcutl5fS1vuY18H3wSt3jFyFtrkx+Kz0V1G85A4MyAdDMi2Q==
17501777

1778+
slash@^4.0.0:
1779+
version "4.0.0"
1780+
resolved "https://registry.yarnpkg.com/slash/-/slash-4.0.0.tgz#2422372176c4c6c5addb5e2ada885af984b396a7"
1781+
integrity sha512-3dOsAHXXUkQTpOYcoAxLIorMTp4gIQr5IW3iVb7A7lFIp0VHhnynm9izx6TssdrIcVIESAlVjtnO2K8bg+Coew==
1782+
17511783
source-map-js@^1.0.1:
17521784
version "1.0.2"
17531785
resolved "https://registry.yarnpkg.com/source-map-js/-/source-map-js-1.0.2.tgz#adbc361d9c62df380125e7f161f71c826f1e490c"

0 commit comments

Comments
 (0)