-
-
Notifications
You must be signed in to change notification settings - Fork 363
doc(Login): add microsoft login template #6162
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
Merged
Merged
Changes from all commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
38c46e0
Add transitional login page and update navigation menu
h2ls 735c26b
Refactor login UI for BootstrapBlazor integration
h2ls b0d7510
Update TransitionalLogin layout and styles
h2ls ab26bec
Merge branch 'main' into lee/TransitionalLogin
ArgoZhang bafb8d0
refactor: 重构模板名称
ArgoZhang 4e11414
refactor: 精简代码
ArgoZhang bbee2aa
doc: 代码格式化
ArgoZhang a2c6def
refactor: 增加移动端适配
ArgoZhang 4723a3d
doc: 更新打包内容
ArgoZhang 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 hidden or 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
92 changes: 92 additions & 0 deletions
92
src/BootstrapBlazor.Server/Components/Samples/Tutorials/LoginAndRegister/Template5.razor
This file contains hidden or 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 |
|---|---|---|
| @@ -0,0 +1,92 @@ | ||
| @page "/tutorials/template5" | ||
| @layout TutorialsLayout | ||
|
|
||
| <HeadContent> | ||
| <style> | ||
| .main:has(.background-image) { | ||
| height: calc(100vh - 56px - 175px); | ||
| } | ||
|
|
||
| @@media (min-width: 768px) { | ||
| .main:has(.background-image) { | ||
| height: calc(100vh - 50px); | ||
| } | ||
|
|
||
| .login-box { | ||
| width: 350px; | ||
| } | ||
| } | ||
| </style> | ||
| </HeadContent> | ||
|
|
||
| <div class="background-image"> | ||
| <div class="login-container"> | ||
| <div class="login-box animate-fade-in"> | ||
| <div class="header-row"> | ||
| @if (isEmailEntered) | ||
| { | ||
| <button @onclick="GoBack" aria-label="返回" class="back-button"> | ||
| <span> | ||
| <i class="fa-solid fa-arrow-left"></i> | ||
| </span> | ||
| </button> | ||
| } | ||
| <div class="logo-container"> | ||
| <h1 class="blazor-text">BootstrapBlazor</h1> | ||
| </div> | ||
| </div> | ||
| @if (!isEmailEntered) | ||
| { | ||
| <h2>登录</h2> | ||
| <p class="subtitle">使用你的 BootstrapBlazor 帐户。</p> | ||
| <BootstrapInput type="email" class="input" placeholder="电子邮件或电话号码" @bind-Value="email" /> | ||
| <div class="error" hidden="@(!showEmailError)">请输入有效的电子邮件地址或电话号码</div> | ||
| <Button class="button" Color="Color.Primary" OnClick="OnEmailSubmit">下一步</Button> | ||
| <div class="links"> | ||
| <a href="#">忘记用户名?</a> | ||
| </div> | ||
| <div class="small"> | ||
| 不熟悉 BootstrapBlazor?<a href="/">去看文档</a> | ||
| </div> | ||
| } | ||
| else | ||
| { | ||
| <h2>输入你的密码</h2> | ||
| <p class="email-display">@email</p> | ||
| <BootstrapInput type="password" class="input" placeholder="密码" @bind-Value="password" /> | ||
| <div class="links"> | ||
| <a href="#">忘记了密码?</a> | ||
| </div> | ||
| <Button class="button" Color="Color.Primary">下一步</Button> | ||
| <div class="links"> | ||
| <a href="#">其他登录方法</a> | ||
| </div> | ||
| } | ||
| </div> | ||
| </div> | ||
| </div> | ||
|
|
||
| @code { | ||
| private bool isEmailEntered = false; | ||
| private string email = ""; | ||
| private string password = ""; | ||
| private bool showEmailError = false; | ||
|
|
||
| private void OnEmailSubmit() | ||
| { | ||
| if (string.IsNullOrWhiteSpace(email)) | ||
| { | ||
| showEmailError = true; | ||
| } | ||
| else | ||
| { | ||
| showEmailError = false; | ||
| isEmailEntered = true; | ||
| } | ||
| } | ||
|
|
||
| private void GoBack() | ||
| { | ||
| isEmailEntered = false; | ||
| } | ||
| } |
162 changes: 162 additions & 0 deletions
162
src/BootstrapBlazor.Server/Components/Samples/Tutorials/LoginAndRegister/Template5.razor.css
This file contains hidden or 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 |
|---|---|---|
| @@ -0,0 +1,162 @@ | ||
| .background-image { | ||
| background-image: url('https://logincdn.msauth.net/shared/5/js/../images/fluent_web_light_57fee22710b04cebe1d5.svg'); | ||
| background-repeat: no-repeat; | ||
| background-size: cover; | ||
| background-position: center; | ||
| width: 100%; | ||
| height: 100%; | ||
| } | ||
|
|
||
| .login-container { | ||
| display: flex; | ||
| justify-content: center; | ||
| align-items: center; | ||
| height: 100%; | ||
| } | ||
|
|
||
| .login-box { | ||
| background: white; | ||
| padding: 40px; | ||
| border-radius: 10px; | ||
| box-shadow: 0 4px 20px rgba(0,0,0,0.1); | ||
| width: auto; | ||
| font-family: "Segoe UI", sans-serif; | ||
| text-align: left; | ||
| position: relative; | ||
| box-sizing: content-box !important; | ||
| } | ||
|
|
||
| ::deep .input { | ||
| width: 100%; | ||
| padding: 10px; | ||
| margin: 12px 0; | ||
| border: 1px solid #ccc; | ||
| border-radius: 4px; | ||
| } | ||
|
|
||
| .header-row { | ||
| display: flex; | ||
| align-items: center; | ||
| justify-content: center; | ||
| position: relative; | ||
| height: 40px; | ||
| margin-bottom: 20px; | ||
| } | ||
|
|
||
| .back-button { | ||
| position: absolute; | ||
| left: 0; | ||
| background: transparent; | ||
| border: none; | ||
| padding: 0; | ||
| cursor: pointer; | ||
| width: 40px; | ||
| height: 40px; | ||
| display: flex; | ||
| align-items: center; | ||
| justify-content: center; | ||
| } | ||
|
|
||
| .blazor-text { | ||
| font-family: Arial, sans-serif; | ||
| font-size: 2rem; | ||
| font-weight: bold; | ||
| text-align: center; | ||
| background: linear-gradient(to right, #8e44ad, #e84393); | ||
| -webkit-background-clip: text; | ||
| -webkit-text-fill-color: transparent; | ||
| } | ||
|
|
||
| .logo-container { | ||
| margin: 0 auto; | ||
| } | ||
|
|
||
| .logo { | ||
| height: 28px; | ||
| } | ||
|
|
||
| ::deep .button { | ||
| width: 100%; | ||
| padding: 10px; | ||
| background-color: #0078d4; | ||
| color: white; | ||
| border: none; | ||
| border-radius: 4px; | ||
| font-weight: bold; | ||
| margin-top: 10px; | ||
| cursor: pointer; | ||
| transition: background-color 0.3s ease; | ||
| } | ||
|
|
||
| .button:hover { | ||
| background-color: #005a9e; | ||
| } | ||
|
|
||
| .links { | ||
| margin-top: 10px; | ||
| font-size: 14px; | ||
| } | ||
|
|
||
| .links a { | ||
| color: #0066cc; | ||
| text-decoration: none; | ||
| } | ||
|
|
||
| .links a:hover { | ||
| text-decoration: underline; | ||
| } | ||
|
|
||
| .small { | ||
| font-size: 12px; | ||
| color: #666; | ||
| margin-top: 10px; | ||
| } | ||
|
|
||
| .email-display { | ||
| font-size: 14px; | ||
| color: #333; | ||
| margin-bottom: 10px; | ||
| } | ||
|
|
||
| .error { | ||
| color: red; | ||
| font-size: 13px; | ||
| } | ||
|
|
||
| .lang-switch { | ||
| position: absolute; | ||
| top: 10px; | ||
| right: 10px; | ||
| } | ||
|
|
||
| .animate-fade-in { | ||
| animation: fadeIn 0.5s ease-in-out; | ||
| } | ||
|
|
||
| @keyframes fadeIn { | ||
| 0% { | ||
| opacity: 0; | ||
| transform: translateY(20px); | ||
| } | ||
|
|
||
| 100% { | ||
| opacity: 1; | ||
| transform: translateY(0); | ||
| } | ||
| } | ||
|
|
||
| .animate-fade-out { | ||
| animation: fadeOut 0.5s ease-in-out forwards; | ||
| } | ||
|
|
||
| @keyframes fadeOut { | ||
| 0% { | ||
| opacity: 1; | ||
| transform: translateY(0); | ||
| } | ||
|
|
||
| 100% { | ||
| opacity: 0; | ||
| transform: translateY(-20px); | ||
| } | ||
| } |
This file contains hidden or 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
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.
Uh oh!
There was an error while loading. Please reload this page.