Skip to content
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:add daisyui lib #66

Merged
merged 5 commits into from
Mar 14, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1,201 changes: 1,199 additions & 2 deletions package-lock.json

Large diffs are not rendered by default.

6 changes: 5 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"version": "0.0.0",
"type": "module",
"scripts": {
"dev": "vite",
"dev": "vite --host",
"build": "vite build",
"preview": "vite preview",
"lint": "eslint --ext .js,.svelte src",
Expand All @@ -13,11 +13,15 @@
},
"devDependencies": {
"@sveltejs/vite-plugin-svelte": "^2.4.2",
"autoprefixer": "^10.4.18",
"daisyui": "^4.7.3",
"eslint": "^8.54.0",
"eslint-plugin-svelte": "^2.35.1",
"postcss-import": "^16.0.1",
"prettier": "^3.1.0",
"prettier-plugin-svelte": "^3.1.2",
"svelte": "^4.2.7",
"tailwindcss": "^3.4.1",
"vite": "^4.4.5"
},
"dependencies": {
Expand Down
8 changes: 8 additions & 0 deletions postcss.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
export default {
plugins: {
'postcss-import': {},
'tailwindcss/nesting': {},
tailwindcss: {},
autoprefixer: {},
}
}
Binary file added public/EMBASSY BT.TTF
Binary file not shown.
2 changes: 1 addition & 1 deletion src/App.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
</script>

<Router {routes} />
<body />

<!-- <ul>
<li><a href='#/'>home</a></li>
<li><a href="#/blog/123">blog</a></li>
Expand Down
35 changes: 14 additions & 21 deletions src/app.css
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
@tailwind base;
@tailwind components;
@tailwind utilities;

:root {
font-family: Inter, system-ui, Avenir, Helvetica, Arial, sans-serif;
line-height: 1.5;
Expand All @@ -19,11 +23,13 @@ a {
color: #646cff;
text-decoration: inherit;
}

a:hover {
color: #535bf2;
}

body {
padding-top: 5%;
margin: 0;
display: flex;
place-items: center;
Expand All @@ -40,33 +46,20 @@ h1 {
padding: 2em;
}

.logo {
font-family: EMBASSY BT;
font-size: 2.5rem;
}

#app {
background-color: #bdbdbd;
width: 100%;
max-width: 1280px;
max-width: 2000px;
margin: 0 auto;
padding: 2rem;
padding: 0.3rem;
text-align: center;
}

button {
border-radius: 8px;
border: 1px solid transparent;
padding: 0.6em 1.2em;
font-size: 1em;
font-weight: 500;
font-family: inherit;
background-color: #1a1a1a;
cursor: pointer;
transition: border-color 0.25s;
}
button:hover {
border-color: #646cff;
}
button:focus,
button:focus-visible {
outline: 4px auto -webkit-focus-ring-color;
}

@media (prefers-color-scheme: light) {
:root {
color: #213547;
Expand Down
8 changes: 4 additions & 4 deletions src/routes/doorPage.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,12 @@
</video>

<div>
<h1>
<span class="highlighted"> LIPS </span> -A lightweight information portal system
<h1 class="mt-300 mb-50">
<span class="highlighted"> lips </span> -A lightweight information portal system
</h1>
<button on:click={handleLogin}> About us </button>
<button class="btn" on:click={handleLogin}> About us </button>
{#if currentpath == "/"}
<button on:click={handleLogin}> Log in </button>
<button class="btn" on:click={handleLogin}> Log in </button>
{/if}
</div>

Expand Down
57 changes: 32 additions & 25 deletions src/routes/login.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,7 @@
alert("用戶名或密碼錯誤");
}
}
function handleRegister() {
push("/register");
}

let currentpath = "";

const unsubscribe = location.subscribe(($location) => {
Expand All @@ -35,25 +33,34 @@
onDestroy(unsubscribe);
</script>

<h1>Login</h1>

{#if currentpath == "/login"}
<form on:submit|preventDefault={handleLogin}>
<div class="content-box">
<div class="item-box">
<input type="email" bind:value={usereamil} placeholder="Email" />
</div>
<div class="item-box">
<input type="password" bind:value={password} placeholder="Password" />
</div>
</div>
<button type="submit">登录</button>
</form>
<button on:click={handleRegister}> 注册 </button>
{/if}

<style>
h1 {
text-align: center;
}
</style>
<div class="flex items-center h-screen">
<div class="w-1/2 bg-base-300 p-10">
<h1 class="mb-5">Login</h1>
{#if currentpath == "/login"}
<form on:submit|preventDefault={handleLogin}>
<div class="flex flex-col space-y-4 items-center">
<div>
<input
class="input input-bordered w-full max-w-xs"
type="email"
bind:value={usereamil}
placeholder="Email"
/>
</div>
<div>
<input
class="input input-bordered w-full max-w-xs"
type="password"
bind:value={password}
placeholder="Password"
/>
</div>
<div class="flex flex-row space-x-10">
<button class="btn btn-wide btn-primary" type="submit">登录</button>
</div>
</div>
</form>
<div>New to lips?<a href="/#/register">Create a account</a></div>
{/if}
</div>
</div>
Loading
Loading