Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
N
Neos
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Locked Files
Issues
1
Issues
1
List
Boards
Labels
Service Desk
Milestones
Merge Requests
2
Merge Requests
2
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Security & Compliance
Security & Compliance
Dependency List
License Compliance
Packages
Packages
List
Container Registry
Analytics
Analytics
CI / CD
Code Review
Insights
Issues
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
MyCard
Neos
Commits
0b38898f
Commit
0b38898f
authored
Sep 24, 2023
by
Chunchi Che
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
optimize ipad
parent
bb528856
Pipeline
#23549
passed with stages
in 27 minutes and 24 seconds
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
20 additions
and
4 deletions
+20
-4
src/styles/core.scss
src/styles/core.scss
+8
-1
src/ui/Shared/css.ts
src/ui/Shared/css.ts
+12
-3
No files found.
src/styles/core.scss
View file @
0b38898f
...
...
@@ -7,7 +7,14 @@ html {
}
/* 在移动端上设置不同的字体大小 */
@media
only
screen
and
(
max-width
:
1280px
)
{
/* iPad */
@media
screen
and
(
max-width
:
1280px
)
{
html
{
font-size
:
14px
;
}
}
/* Mobile */
@media
screen
and
(
max-width
:
1000px
)
{
html
{
font-size
:
10px
;
}
...
...
src/ui/Shared/css.ts
View file @
0b38898f
...
...
@@ -2,7 +2,11 @@
type
CSSConfig
=
[
string
,
[
number
,
UNIT
]][];
// 以1280长度的viewpoint为基准进行缩放
const
VIEW_POINT_WIDTH_BASE
=
1280
;
const
VIEW_POINT_WIDTH_BASE_IPAD
=
1280
;
const
VIEW_POINT_WIDTH_BASE_MOBILE
=
1000
;
const
ZOOM_RATE_IPAD
=
0.7
;
const
ZOOM_RATE_MOBILE
=
0.5
;
/** 转为CSS变量: BOARD_ROTATE_Z -> --board-rotate-z */
const
toCssProperties
=
(
config
:
CSSConfig
)
=>
...
...
@@ -20,8 +24,13 @@ const toCssProperties = (config: CSSConfig) =>
.
reduce
((
acc
,
cur
)
=>
[...
acc
,
cur
],
[]
as
[
string
,
string
][]);
const
pxTransform
=
(
value
:
number
,
unit
:
UNIT
)
=>
{
if
(
unit
===
UNIT
.
PX
&&
window
.
innerWidth
<
VIEW_POINT_WIDTH_BASE
)
{
return
[
value
*
0.5
,
unit
];
if
(
unit
===
UNIT
.
PX
&&
window
.
innerWidth
<
VIEW_POINT_WIDTH_BASE_MOBILE
)
{
return
[
value
*
ZOOM_RATE_MOBILE
,
unit
];
}
else
if
(
unit
===
UNIT
.
PX
&&
window
.
innerWidth
<
VIEW_POINT_WIDTH_BASE_IPAD
)
{
return
[
value
*
ZOOM_RATE_IPAD
,
unit
];
}
else
{
return
[
value
,
unit
];
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment