Skip to content

Commit ce3241f

Browse files
committed
背景优化
1 parent 44bffcb commit ce3241f

File tree

4 files changed

+20
-2
lines changed

4 files changed

+20
-2
lines changed

apps/web/src/components/Bg.tsx

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
import { component$ } from "@builder.io/qwik";
2+
import _ from "lodash";
3+
4+
export default component$(()=>{
5+
return <div class="absolute bottom-0 left-0 right-0 w-full h-max z--1 of-hidden">
6+
<img src="https://web-assets.c5y.moe/B50/bg.png" class="h-max w-full" />
7+
<img src="https://web-assets.c5y.moe/B50/fish.png" class="absolute bottom-0 left-0 right-0 w-full h-max" style={{
8+
transform: `translateY(${_.random(-75, 50)}px) translateX(${_.random(-150, 50)}px) rotate(${_.random(-5, 5)}deg)`,
9+
}} />
10+
<img src="https://web-assets.c5y.moe/B50/overlay.png" class="absolute bottom-0 left-0 right-0 w-full h-max" />
11+
</div>
12+
})

apps/web/src/global.css

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ a {
66
body {
77
padding: 0;
88
margin: 0;
9-
background: url('https://web-assets.c5y.moe/B50.png') no-repeat bottom center;
9+
background: url('https://web-assets.c5y.moe/B502.png') no-repeat bottom center;
1010
background-size: 100% auto;
1111
font-family: Quicksand, "Noto Sans SC";
1212
position: relative;

apps/web/src/routes/layout.tsx

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,16 @@
11
import { component$, Slot } from '@builder.io/qwik';
22
import Footer from '~/components/Footer';
33
import 'virtual:uno.css';
4+
import { useLocation, useNavigate } from '@builder.io/qwik-city';
5+
import Bg from '~/components/Bg';
46

57
export default component$(() => {
8+
const location = useLocation();
9+
const isB50 = location.url.pathname.startsWith('/b50');
10+
611
return (
712
<>
13+
{isB50 && <Bg />}
814
<div style={{ minHeight: 'calc(100vh - 154px)' }}>
915
<Slot />
1016
</div>

packages/utils/src/getAssetUrl.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,5 +34,5 @@ export const getAssetUrl = (type: ASSET_TYPE, id: number | string) => {
3434
if (type === ASSET_TYPE.JacketPng) ext = 'png';
3535
if (type === ASSET_TYPE.ChuniJacketPng) ext = 'png';
3636

37-
return `https://maimai-assets.pages.dev/${type}/${id}.${ext}`;
37+
return `https://web-assets.c5y.moe/mai-assets/${type}/${id}.${ext}`;
3838
};

0 commit comments

Comments
 (0)