Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
libai
/
sf
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Members
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
68e8d95d
authored
6 years ago
by
qiaomu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
测试
parent
3043e5ba
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
16 additions
and
2 deletions
sudoke/index.html
sudoke/js/fsize.js
sudoke/index.html
View file @
68e8d95d
...
...
@@ -10,14 +10,14 @@
<title>
附加功能
</title>
<link
rel=
"stylesheet"
href=
"css/weui.min.css"
>
<script
type=
"text/javascript"
src=
"js/fsize.js"
></script>
<script
type=
"text/javascript"
src=
"js/jquery.min.js"
></script>
</head>
<body>
<h2
class=
"title"
>
附加功能
</h2>
<div
class=
"box"
>
<div
class=
"cont"
>
<a
href=
""
>
<a
href=
"
javascript:clearcache()
"
>
<img
class=
"svg"
src=
"img/clear.svg"
alt=
""
>
<span>
清理用户缓存
</span>
</a>
...
...
This diff is collapsed.
Click to expand it.
sudoke/js/fsize.js
0 → 100644
View file @
68e8d95d
/*function setRemFontSize(baseSize, baseWidth) {
var baseSize = baseSize || 37.5,
baseWidth = baseWidth || 375,
clientWidth = document.documentElement.clientWidth <= 480 ? document.documentElement.clientWidth : 480;
document.getElementsByTagName('html')[0].style.fontSize = clientWidth * baseSize / baseWidth + 'px'
}
setRemFontSize();
window.addEventListener("resize", function() {
setTimeout(function() {
setRemFontSize();
}, 200)
});*/
!
function
(
e
,
t
){
function
i
(){
var
t
=
n
.
getBoundingClientRect
().
width
;
t
/
m
>
540
&&
(
t
=
540
*
m
);
var
i
=
t
/
10
;
n
.
style
.
fontSize
=
i
+
"px"
,
d
.
rem
=
e
.
rem
=
i
}
var
a
,
r
=
e
.
document
,
n
=
r
.
documentElement
,
o
=
r
.
querySelector
(
'meta[name="viewport"]'
),
l
=
r
.
querySelector
(
'meta[name="flexible"]'
),
m
=
0
,
s
=
0
,
d
=
t
.
flexible
||
(
t
.
flexible
=
{});
if
(
o
){
console
.
warn
(
"将根据已有的meta标签来设置缩放比例"
);
var
p
=
o
.
getAttribute
(
"content"
).
match
(
/initial
\-
scale=
([\d\.]
+
)
/
);
p
&&
(
s
=
parseFloat
(
p
[
1
]),
m
=
parseInt
(
1
/
s
))}
else
if
(
l
){
var
c
=
l
.
getAttribute
(
"content"
);
if
(
c
){
var
u
=
c
.
match
(
/initial
\-
dpr=
([\d\.]
+
)
/
),
f
=
c
.
match
(
/maximum
\-
dpr=
([\d\.]
+
)
/
);
u
&&
(
m
=
parseFloat
(
u
[
1
]),
s
=
parseFloat
((
1
/
m
).
toFixed
(
2
))),
f
&&
(
m
=
parseFloat
(
f
[
1
]),
s
=
parseFloat
((
1
/
m
).
toFixed
(
2
)))}}
if
(
!
m
&&!
s
){
var
v
=
(
e
.
navigator
.
appVersion
.
match
(
/android/gi
),
e
.
navigator
.
appVersion
.
match
(
/iphone/gi
)),
h
=
e
.
devicePixelRatio
;
m
=
v
?
h
>=
3
&&
(
!
m
||
m
>=
3
)?
3
:
h
>=
2
&&
(
!
m
||
m
>=
2
)?
2
:
1
:
1
,
s
=
1
/
m
}
if
(
n
.
setAttribute
(
"data-dpr"
,
m
),
!
o
)
if
(
o
=
r
.
createElement
(
"meta"
),
o
.
setAttribute
(
"name"
,
"viewport"
),
o
.
setAttribute
(
"content"
,
"initial-scale="
+
s
+
", maximum-scale="
+
s
+
", minimum-scale="
+
s
+
", user-scalable=no"
),
n
.
firstElementChild
)
n
.
firstElementChild
.
appendChild
(
o
);
else
{
var
x
=
r
.
createElement
(
"div"
);
x
.
appendChild
(
o
),
r
.
write
(
x
.
innerHTML
)}
e
.
addEventListener
(
"resize"
,
function
(){
clearTimeout
(
a
),
a
=
setTimeout
(
i
,
300
)},
!
1
),
e
.
addEventListener
(
"pageshow"
,
function
(
e
){
e
.
persisted
&&
(
clearTimeout
(
a
),
a
=
setTimeout
(
i
,
300
))},
!
1
),
"complete"
===
r
.
readyState
?
r
.
body
.
style
.
fontSize
=
12
*
m
+
"px"
:
r
.
addEventListener
(
"DOMContentLoaded"
,
function
(
e
){
r
.
body
.
style
.
fontSize
=
12
*
m
+
"px"
},
!
1
),
i
(),
d
.
dpr
=
e
.
dpr
=
m
,
d
.
refreshRem
=
i
,
d
.
rem2px
=
function
(
e
){
var
t
=
parseFloat
(
e
)
*
this
.
rem
;
return
"string"
==
typeof
e
&&
e
.
match
(
/rem$/
)
&&
(
t
+=
"px"
),
t
},
d
.
px2rem
=
function
(
e
){
var
t
=
parseFloat
(
e
)
/
this
.
rem
;
return
"string"
==
typeof
e
&&
e
.
match
(
/px$/
)
&&
(
t
+=
"rem"
),
t
}}(
window
,
window
.
lib
||
(
window
.
lib
=
{}));
\ No newline at end of file
This diff is collapsed.
Click to expand it.
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