-
Notifications
You must be signed in to change notification settings - Fork 93
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Feat/桌面模式下图片预览支持滚轮缩放与鼠标拖放 #72
Merged
Merged
Changes from 6 commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
fa0b852
🆕 image preview support weel zoom and mouse drag on desktop
Memoyu ae3a714
🆕 image preview is realized through timmywil/panzoom.js
Memoyu fea1138
💄 调整预览图样式,恢复之前的行为
Memoyu f8aed41
🐛 安卓下图片预览返回键返回一次后无法再打开
Memoyu ab7b032
🚚 变更zoom js 文件夹路径
Memoyu b1e79b8
🆕 切换zoom组件以及恢复css
Memoyu 36e478f
🔥去除多余代码
Memoyu 6ac04f9
Remove unnecessary changes
Yu-Core File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,5 @@ | ||
using Microsoft.AspNetCore.Components; | ||
using SwashbucklerDiary.Rcl.Essentials; | ||
using SwashbucklerDiary.Rcl.Services; | ||
using SwashbucklerDiary.Shared; | ||
|
||
|
@@ -16,12 +17,8 @@ public partial class PreviewImageDialog : DialogComponentBase | |
[Inject] | ||
private ZoomJSModule Module { get; set; } = default!; | ||
|
||
[Parameter] | ||
public override bool Visible | ||
{ | ||
get => base.Visible; | ||
set => SetVisible(value); | ||
} | ||
[Inject] | ||
private IPlatformIntegration PlatformIntegration { get; set; } = default!; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 没有被使用 |
||
|
||
[Parameter] | ||
public string? Src { get; set; } | ||
|
@@ -35,19 +32,15 @@ protected async Task BeforeShowContent() | |
} | ||
} | ||
|
||
private async void SetVisible(bool value) | ||
protected override async Task InternalVisibleChanged(bool value) | ||
{ | ||
if (base.Visible == value) | ||
{ | ||
return; | ||
} | ||
await base.InternalVisibleChanged(value); | ||
await Module.Reset($"#{id}"); | ||
} | ||
|
||
base.Visible = value; | ||
if (!value && Module is not null && isInitialized) | ||
{ | ||
// Cannot be placed in BeforeShowContent, Because you will see the Reset animation | ||
await Module.Reset($"#{id}"); | ||
} | ||
private async Task HandleReset() | ||
{ | ||
await Module.Reset($"#{id}"); | ||
} | ||
|
||
private async Task SaveToLocal() | ||
|
3 changes: 2 additions & 1 deletion
3
src/SwashbucklerDiary.Rcl/Components/DialogComponents/PreviewImageDialog/ZoomJSModule.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -509,6 +509,7 @@ html { | |
object-fit: contain; | ||
} | ||
|
||
|
||
wc-waterfall > * { | ||
transition: all .2s; | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1 change: 1 addition & 0 deletions
1
src/SwashbucklerDiary.Rcl/wwwroot/npm/panzoom/9.4.3/panzoom.min.js
Large diffs are not rendered by default.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -55,7 +55,8 @@ | |
|
||
<link href="_content/Masa.Blazor/css/masa-blazor.min.css" rel="stylesheet"> | ||
|
||
<link href="_content/SwashbucklerDiary.Rcl/css/materialdesign/v7.2.96/css/materialdesignicons.min.css" rel="stylesheet"> | ||
<link href="_content/SwashbucklerDiary.Rcl/css/materialdesign/v7.2.96/css/materialdesignicons.min.css" | ||
rel="stylesheet"> | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 多余的换行 |
||
<link href="_content/SwashbucklerDiary.Rcl/css/material/icons.css" rel="stylesheet"> | ||
<link href="_content/SwashbucklerDiary.Rcl/npm/vditor/3.10.6/dist/index.css" rel="stylesheet" /> | ||
<link href="_content/SwashbucklerDiary.Rcl/npm/swiper/7.4.1/swiper-bundle.min.css" rel="stylesheet" /> | ||
|
@@ -96,7 +97,7 @@ | |
<script src="_content/Masa.Blazor/js/masa-blazor.js"></script> | ||
<script src="_content/SwashbucklerDiary.Rcl/npm/vditor/3.10.6/dist/index.min.js"></script> | ||
<script src="_content/SwashbucklerDiary.Rcl/npm/swiper/7.4.1/swiper-bundle.min.js"></script> | ||
<script src="_content/SwashbucklerDiary.Rcl/npm/zoom/zoom.min.js"></script> | ||
<script src="_content/SwashbucklerDiary.Rcl/npm/panzoom/9.4.3/panzoom.min.js"></script> | ||
<script src="_content/SwashbucklerDiary.Rcl/npm/html2canvas/1.4.1/dist/html2canvas.min.js"></script> | ||
<script src="_content/SwashbucklerDiary.Rcl/npm/wc-waterfall/0.1.3/dist/index.iife.min.js"></script> | ||
<script src="_content/SwashbucklerDiary.Rcl/npm/bettersearch/1.0.1/dist/index.umd.js"></script> | ||
|
@@ -130,4 +131,4 @@ | |
</script> | ||
</body> | ||
|
||
</html> | ||
</html> |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
图片预览一般都没有这个按钮,已经有双击重置的情况下,感觉没什么必要