Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
G
GraceTemplate
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
front-end
GraceTemplate
Commits
b81ab1c0
Commit
b81ab1c0
authored
Sep 03, 2024
by
haiyoucuv
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
更改
parent
1919d9de
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
3 additions
and
5 deletions
+3
-5
App.tsx
src/App.tsx
+2
-0
checkwebp.ts
src/utils/checkwebp.ts
+1
-5
No files found.
src/App.tsx
View file @
b81ab1c0
...
@@ -3,6 +3,8 @@ import { observer } from "mobx-react";
...
@@ -3,6 +3,8 @@ import { observer } from "mobx-react";
import
{
createRoot
}
from
"react-dom/client"
;
import
{
createRoot
}
from
"react-dom/client"
;
import
store
from
"./store/store"
;
import
store
from
"./store/store"
;
import
"./utils/checkwebp"
;
import
'@csstools/normalize.css'
;
import
'@csstools/normalize.css'
;
import
'./App.less'
import
'./App.less'
...
...
src/utils/checkwebp.
j
s
→
src/utils/checkwebp.
t
s
View file @
b81ab1c0
...
@@ -4,11 +4,8 @@
...
@@ -4,11 +4,8 @@
* 不支持 CDN ?x-oss-process=image/quality,Q_80
* 不支持 CDN ?x-oss-process=image/quality,Q_80
*/
*/
(
function
()
{
(
function
()
{
let
urlArr
=
[];
let
lowAdr
=
false
;
let
flag
=
false
,
lowAdr
=
false
;
const
ua
=
navigator
.
userAgent
.
toLowerCase
()
const
ua
=
navigator
.
userAgent
.
toLowerCase
()
const
isAndroid
=
ua
.
indexOf
(
'android'
)
>
-
1
||
ua
.
indexOf
(
'adr'
)
>
-
1
;
const
isAndroid
=
ua
.
indexOf
(
'android'
)
>
-
1
||
ua
.
indexOf
(
'adr'
)
>
-
1
;
if
(
isAndroid
)
{
if
(
isAndroid
)
{
...
@@ -29,7 +26,6 @@
...
@@ -29,7 +26,6 @@
}
}
}
}
img
.
onerror
=
function
()
{
img
.
onerror
=
function
()
{
flag
=
true
localStorage
.
isWebp
=
''
localStorage
.
isWebp
=
''
}
}
img
.
src
=
'data:image/webp;base64,UklGRiQAAABXRUJQVlA4IBgAAAAwAQCdASoBAAEAAwA0JaQAA3AA/vuUAAA='
img
.
src
=
'data:image/webp;base64,UklGRiQAAABXRUJQVlA4IBgAAAAwAQCdASoBAAEAAwA0JaQAA3AA/vuUAAA='
...
...
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