Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
R
rrpgLink_FrontEnd
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Locked Files
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
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
Kesaubeeire
rrpgLink_FrontEnd
Commits
cd9f3a4f
Commit
cd9f3a4f
authored
Oct 29, 2023
by
KesaubeEire
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat: windows chrome 滑动条消失, 不占用侧向空间.
parent
da2826ee
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
54 additions
and
0 deletions
+54
-0
src/App.svelte
src/App.svelte
+54
-0
No files found.
src/App.svelte
View file @
cd9f3a4f
...
@@ -144,6 +144,60 @@
...
@@ -144,6 +144,60 @@
// 2. 检测 darkreader 是否开启
// 2. 检测 darkreader 是否开启
const has_darkreader = document.querySelector('.darkreader');
const has_darkreader = document.querySelector('.darkreader');
if (has_darkreader) toast.push('检测到 dark reader, 建议关闭当前网站的 darkreader, 可点击导航栏的主题更改相应的主题', { initial: 0 });
if (has_darkreader) toast.push('检测到 dark reader, 建议关闭当前网站的 darkreader, 可点击导航栏的主题更改相应的主题', { initial: 0 });
// 3. 检测设备平台 - windows 加入滑动条消失
const UA = window.navigator.userAgent.toLowerCase();
const cssString = `
body {
overflow-y: scroll;
overflow-x: hidden;
width: 100%;
/* height: 100%; */
/* width: 100vw; */
/* height: 100vh; */
/* padding-right: 7px; */
}
/* 隐藏垂直滚动条 */
body::-webkit-scrollbar {
display: none;
/* 隐藏 Chrome、Safari 滚动条 */
}
body {
-ms-overflow-style: none;
/* 隐藏 IE/Edge 滚动条 */
scrollbar-width: none;
/* 隐藏 Firefox 滚动条 */
}
/* 隐藏水平滚动条 */
body::-webkit-scrollbar-horizontal {
display: none;
/* 隐藏 Chrome、Safari 水平滚动条 */
}
body::-webkit-scrollbar-thumb {
display: none;
/* 隐藏 Chrome、Safari 滚动条拇指 */
}`;
// toast.push(UA);
if (UA.includes('windows')) {
// 创建一个<style>元素
const styleElement = document.createElement('style');
styleElement.type = 'text/css';
// 将CSS样式字符串添加到<style>元素中
styleElement.appendChild(document.createTextNode(cssString));
// 将<style>元素添加到<body>元素中
document.body.appendChild(styleElement);
}
});
});
</script>
</script>
...
...
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