feat: update looks of web app

This commit is contained in:
Damillora 2025-02-22 07:59:16 +00:00
parent 2ab5e10549
commit 8798596e91
7 changed files with 82 additions and 33 deletions

View File

@ -1,6 +1,15 @@
/* Write your global styles here, in SCSS syntax. Variables and mixins from the src/variables.scss file are available here without importing */ /* Write your global styles here, in SCSS syntax. Variables and mixins from the src/variables.scss file are available here without importing */
@use "../node_modules/bulma/sass";
// Path to Bulma's sass folder
@use "bulma/sass" with (
$family-primary: '"Nunito", sans-serif',
$primary: #00afcc,
);
// Import the Google Font
@import url("https://fonts.googleapis.com/css?family=Nunito:400,700");
// Others
.tile.is-multiline { .tile.is-multiline {
flex-wrap: wrap; flex-wrap: wrap;
} }
@ -9,6 +18,30 @@
white-space: pre-line; white-space: pre-line;
} }
.svelte-tags-input-matchs-parent { // Svelte Tags
#tags .svelte-tags-input-layout {
@extend .input;
padding: 0;
padding-top: var(--bulma-control-padding-vertical);
padding-right: var(--bulma-control-padding-horizontal);
padding-left: var(--bulma-control-padding-horizontal);
height: auto !important;
}
#tags .svelte-tags-input-layout:focus-within {
outline: 0;
}
#tags .svelte-tags-input {
padding: 0;
margin-top: 0;
margin-bottom: var(--bulma-control-padding-vertical);
}
#tags .svelte-tags-input-tag {
@extend .tag;
margin-top: 0;
margin-bottom: var(--bulma-control-padding-vertical);
margin-right: var(--bulma-control-padding-horizontal);
}
#tags .svelte-tags-input-matchs-parent{
z-index: 2000; z-index: 2000;
} }

View File

@ -57,7 +57,7 @@
<div class="navbar-item"> <div class="navbar-item">
<div class="buttons"> <div class="buttons">
<a href="/auth/register" class="button is-primary"> <a href="/auth/register" class="button is-primary">
<strong>Register</strong> Register
</a> </a>
<a href="/auth/login" class="button is-light"> <a href="/auth/login" class="button is-light">
Log in Log in

View File

@ -47,10 +47,10 @@
/> />
</div> </div>
</div> </div>
</div>
<div class="control"> <div class="control">
<button type="submit" class="button is-primary"> Search </button> <button type="submit" class="button is-primary"> Search </button>
</div> </div>
</div>
</form> </form>
</div> </div>
</div> </div>

View File

@ -1,9 +1,9 @@
<script lang="ts"> <script lang="ts">
import { run } from 'svelte/legacy'; import { run } from "svelte/legacy";
import { onMount } from "svelte"; import { onMount } from "svelte";
import { getPost, postDelete } from "$lib/api"; import { getPost, postDelete } from "$lib/api";
import { goto } from "$app/navigation"; import { afterNavigate, goto } from "$app/navigation";
import EditPostPanel from "$lib/components/panels/EditPostPanel.svelte"; import EditPostPanel from "$lib/components/panels/EditPostPanel.svelte";
import ViewPostPanel from "$lib/components/panels/ViewPostPanel.svelte"; import ViewPostPanel from "$lib/components/panels/ViewPostPanel.svelte";
@ -51,7 +51,7 @@
let imagePercentage = $state("0%"); let imagePercentage = $state("0%");
run(() => { afterNavigate(() => {
if (post) if (post)
imagePercentage = ((1000 * 100) / post.width).toFixed(0) + "%"; imagePercentage = ((1000 * 100) / post.width).toFixed(0) + "%";
}); });
@ -87,8 +87,7 @@
> >
<button <button
class="button" class="button"
onclick={toggleDeleteMenu} onclick={toggleDeleteMenu}>Cancel</button
>Cancel</button
> >
</div> </div>
</div> </div>

View File

@ -7,8 +7,9 @@
import queryString from "query-string"; import queryString from "query-string";
import Tags from "svelte-tags-input"; import Tags from "svelte-tags-input";
import { paginate } from "$lib/simple-pagination"; import { paginate } from "$lib/simple-pagination";
import { beforeNavigate, goto } from "$app/navigation"; import { afterNavigate, beforeNavigate, goto } from "$app/navigation";
import { page as currentPage } from '$app/stores'; import { page as currentPage } from '$app/stores';
import { onMount } from 'svelte';
let url = $derived($currentPage.url); let url = $derived($currentPage.url);
@ -16,7 +17,7 @@
let page = $state(1); let page = $state(1);
let totalPages = $state(1); let totalPages = $state(1);
let pagination = $state([]); let pagination: string[] = $state([]);
let posts = $state([]); let posts = $state([]);
let postCount = 0; let postCount = 0;
let tags = $state([]); let tags = $state([]);
@ -60,7 +61,7 @@
return list; return list;
}; };
run(() => { afterNavigate(() => {
tagQuery = url.searchParams.get('tags'); tagQuery = url.searchParams.get('tags');
if (tagQuery) { if (tagQuery) {
searchTerms = tagQuery.split(" "); searchTerms = tagQuery.split(" ");
@ -71,7 +72,7 @@
posts = []; posts = [];
page = 1; page = 1;
getData(); getData();
}); })
const onSearch = (e) => { const onSearch = (e) => {
e.preventDefault(); e.preventDefault();
if (searchTerms.length > 0) { if (searchTerms.length > 0) {
@ -95,6 +96,11 @@
<div class="columns is-multiline"> <div class="columns is-multiline">
<div class="column is-full"> <div class="column is-full">
<div class="block"> <div class="block">
</div>
</div>
<div class="column is-one-third">
<div class="panel is-primary">
<div class="panel-block column">
<form onsubmit={onSearch}> <form onsubmit={onSearch}>
<div class="field has-addons"> <div class="field has-addons">
<div class="control is-expanded"> <div class="control is-expanded">
@ -108,6 +114,7 @@
/> />
</div> </div>
</div> </div>
</div>
<div class="control"> <div class="control">
<button <button
type="submit" type="submit"
@ -116,11 +123,9 @@
Search Search
</button> </button>
</div> </div>
</div>
</form> </form>
</div> </div>
</div> </div>
<div class="column is-one-third">
{#if tagInfo} {#if tagInfo}
<div class="panel is-info"> <div class="panel is-info">
<p class="panel-heading"> <p class="panel-heading">

View File

@ -2,6 +2,7 @@
import { run } from 'svelte/legacy'; import { run } from 'svelte/legacy';
import { getTags } from "$lib/api"; import { getTags } from "$lib/api";
import { afterNavigate } from '$app/navigation';
let tags = $state([]); let tags = $state([]);
@ -9,9 +10,10 @@
const data = await getTags(); const data = await getTags();
tags = data; tags = data;
}; };
run(() => {
afterNavigate(() => {
getData(); getData();
}); })
</script> </script>

View File

@ -11,4 +11,14 @@ export default defineConfig({
}, },
}, },
}, },
server: {
allowedHosts: ["5173.shinosawa.nanao.moe"],
proxy: {
// string shorthand:
// http://localhost:5173/foo
// -> http://localhost:4567/foo
'/api': 'http://localhost:5050',
'/data': 'https://booru.nanao.moe',
}
}
}); });