Move to lucide icons
ci/woodpecker/push/build Pipeline was successful Details

This commit is contained in:
Melon 2022-12-06 13:47:06 +00:00
parent a0faae254d
commit f0acb16403
Signed by: melon
GPG Key ID: 6C9D970C50D26A25
3 changed files with 38 additions and 44 deletions

View File

@ -1,5 +1,5 @@
import {getEnv} from "~/utils/env"; import {getEnv} from "~/utils/env";
import {loginStore, type LoginStore} from "~/stores/login"; import {loginStore} from "~/stores/login";
import {get} from "svelte/store"; import {get} from "svelte/store";
export function URL() { export function URL() {
@ -15,6 +15,7 @@ export async function sendSessionRequest(path: string, opt: RequestInit) {
let headers = new Headers(opt.headers); let headers = new Headers(opt.headers);
setLoginHeaders(headers); setLoginHeaders(headers);
opt.headers = headers; opt.headers = headers;
console.log(path);
let z = await sendApiRequest(path, opt); let z = await sendApiRequest(path, opt);
// Auth error // Auth error
@ -30,7 +31,7 @@ export async function sendSessionRequest(path: string, opt: RequestInit) {
headers = new Headers(opt.headers); headers = new Headers(opt.headers);
setLoginHeaders(headers); setLoginHeaders(headers);
opt.headers = headers; opt.headers = headers;
z = await fetch(URL() + path, opt); z = await sendApiRequest(path, opt);
} }
} }
return z; return z;

View File

@ -1,4 +1,5 @@
<script lang="ts"> <script lang="ts">
import {CheckCircle, ExternalLink, Link2, Lock, Slash, XCircle} from "lucide-svelte";
import {onMount} from "svelte"; import {onMount} from "svelte";
import {navigate, useLocation} from "svelte-navigator"; import {navigate, useLocation} from "svelte-navigator";
import {getUser} from "~/api/login"; import {getUser} from "~/api/login";
@ -92,29 +93,32 @@
<ul> <ul>
{#if scopes} {#if scopes}
{#each scopes as scope} {#each scopes as scope}
<li>{scope.desc}</li> <li><CheckCircle size={24} />{scope.desc}</li>
{/each} {/each}
{/if} {/if}
<li data-fake>{fakeScope[Math.floor(Math.random() * fakeScope.length)]}</li> <li data-fake><XCircle size={24} />{fakeScope[Math.floor(Math.random() * fakeScope.length)]}</li>
</ul> </ul>
</div> </div>
<div class="oauth-details"> <div class="oauth-details">
<ul> <ul>
<li data-icon="link">Authorization will redirect to: <span class="oauth-domain">{app_domain}</span></li> <li><Link2 size={16} /> Authorization will redirect to: <span class="oauth-domain">{app_domain}</span></li>
<li data-icon="lock"> <li>
The <Lock size={16} />
{#if app.privacy} <div>
<a href={app.privacy} target="_blank" rel="noreferrer noopener nofollow">Privacy Policy</a> The
{:else} {#if app.privacy}
Privacy Policy <a href={app.privacy} target="_blank" rel="noreferrer noopener nofollow">Privacy Policy</a>
{/if} {:else}
and Privacy Policy
{#if app.terms} {/if}
<a href={app.terms} target="_blank" rel="noreferrer noopener nofollow">Terms of Service</a> and
{:else} {#if app.terms}
Terms of Service <a href={app.terms} target="_blank" rel="noreferrer noopener nofollow">Terms of Service</a>
{/if} {:else}
of {app.app_name}'s developer will apply Terms of Service
{/if}
of {app.app_name}'s developer will apply.
</div>
</li> </li>
</ul> </ul>
</div> </div>
@ -129,7 +133,6 @@
{/if} {/if}
<style lang="scss"> <style lang="scss">
@import "../../assets/material-symbols.scss";
@import "../../assets/panel.scss"; @import "../../assets/panel.scss";
.oauth-widget { .oauth-widget {
@ -160,30 +163,24 @@
> ul { > ul {
margin: 0; margin: 0;
padding-left: 24px;
> li { > li {
margin-top: 8px; margin-top: 8px;
position: relative; position: relative;
display: flex;
&::marker { &::marker {
content: ""; content: "";
} }
&::before { > :global(svg) {
@include mso; color: #66cc66;
font-size: 24px; margin-right: 16px;
line-height: 24px;
white-space: pre;
content: "check_circle";
position: absolute;
left: -32px;
top: -2px;
color: var(--primary-link);
} }
&[data-fake]::before { &[data-fake] > :global(svg) {
content: "cancel"; color: #cc6666;
color: #dd5555;
} }
} }
} }
@ -202,20 +199,14 @@
> li { > li {
margin-top: 8px; margin-top: 8px;
position: relative; position: relative;
display: flex;
&::marker { &::marker {
content: ""; content: "";
} }
&::before { > :global(svg) {
@include mso; margin-right: 16px;
font-size: 16px;
line-height: 16px;
white-space: pre;
content: attr(data-icon);
position: absolute;
left: -24px;
top: -2px;
} }
> .oauth-domain { > .oauth-domain {

View File

@ -96,6 +96,7 @@
user-select: none; user-select: none;
height: 100%; height: 100%;
padding: 0 16px; padding: 0 16px;
z-index: 9999;
> .dropdown-title { > .dropdown-title {
display: flex; display: flex;
@ -113,11 +114,11 @@
> .dropdown-floating { > .dropdown-floating {
z-index: 9998; z-index: 9998;
position: absolute; position: absolute;
top: 100%; top: -25px;
right: 0; right: 0;
background: var(--bg-panel-action);
width: 100%; width: 100%;
border-radius: 0 0 8px 8px; border-radius: 0 0 8px 8px;
padding-top: 75px;
-webkit-box-shadow: 0px 0px 10px 2px rgba(0, 0, 0, 0.5); -webkit-box-shadow: 0px 0px 10px 2px rgba(0, 0, 0, 0.5);
-moz-box-shadow: 0px 0px 10px 2px rgba(0, 0, 0, 0.5); -moz-box-shadow: 0px 0px 10px 2px rgba(0, 0, 0, 0.5);
@ -130,6 +131,7 @@
display: flex; display: flex;
flex-direction: column; flex-direction: column;
text-align: center; text-align: center;
background: var(--bg-panel-action);
> a { > a {
display: flex; display: flex;