Skip to content

Commit

Permalink
chore: header icons
Browse files Browse the repository at this point in the history
  • Loading branch information
EasonLin0716 committed Jul 19, 2024
1 parent 208a748 commit 44c8288
Show file tree
Hide file tree
Showing 13 changed files with 182 additions and 115 deletions.
19 changes: 10 additions & 9 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
{
"editor.formatOnSave": true,
"editor.defaultFormatter": "esbenp.prettier-vscode",
"css.lint.validProperties": [
"composes"
],
"[css]": {
"editor.defaultFormatter": "vscode.css-language-features"
}
}
"editor.formatOnSave": true,
"editor.defaultFormatter": "esbenp.prettier-vscode",
"css.lint.validProperties": ["composes"],
"[css]": {
"editor.defaultFormatter": "vscode.css-language-features"
},
"[svelte]": {
"editor.defaultFormatter": "svelte.svelte-vscode"
}
}
1 change: 0 additions & 1 deletion dictionary-web-app/public/vite.svg

This file was deleted.

43 changes: 4 additions & 39 deletions dictionary-web-app/src/App.svelte
Original file line number Diff line number Diff line change
@@ -1,47 +1,12 @@
<script lang="ts">
import svelteLogo from './assets/svelte.svg'
import viteLogo from '/vite.svg'
import Counter from './lib/Counter.svelte'
import Header from './lib/Header.svelte';
import SearchInput from './lib/SearchInput.svelte';
</script>

<main>
<div>
<a href="https://vitejs.dev" target="_blank" rel="noreferrer">
<img src={viteLogo} class="logo" alt="Vite Logo" />
</a>
<a href="https://svelte.dev" target="_blank" rel="noreferrer">
<img src={svelteLogo} class="logo svelte" alt="Svelte Logo" />
</a>
</div>
<h1>Vite + Svelte</h1>

<div class="card">
<Counter />
</div>

<p>
Check out <a href="https://github.com/sveltejs/kit#readme" target="_blank" rel="noreferrer">SvelteKit</a>, the official Svelte app framework powered by Vite!
</p>

<p class="read-the-docs">
Click on the Vite and Svelte logos to learn more
</p>
<Header />
<SearchInput />
</main>

<style>
.logo {
height: 6em;
padding: 1.5em;
will-change: filter;
transition: filter 300ms;
}
.logo:hover {
filter: drop-shadow(0 0 2em #646cffaa);
}
.logo.svelte:hover {
filter: drop-shadow(0 0 2em #ff3e00aa);
}
.read-the-docs {
color: #888;
}
</style>
200 changes: 135 additions & 65 deletions dictionary-web-app/src/app.css
Original file line number Diff line number Diff line change
@@ -1,79 +1,149 @@
:root {
font-family: Inter, system-ui, Avenir, Helvetica, Arial, sans-serif;
line-height: 1.5;
font-weight: 400;

color-scheme: light dark;
color: rgba(255, 255, 255, 0.87);
background-color: #242424;

font-synthesis: none;
text-rendering: optimizeLegibility;
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
--black-100: #3a3a3a;
--black-200: #2d2d2d;
--black-300: #1f1f1f;
--black-400: #050505;
--white: #fff;
--gray-100: #f4f4f4;
--gray-200: #e9e9e9;
--gray-300: #757575;
--purple: #a445ed;
--red: #ff5252;
}

a {
font-weight: 500;
color: #646cff;
text-decoration: inherit;
html,
body,
div,
span,
applet,
object,
iframe,
h1,
h2,
h3,
h4,
h5,
h6,
p,
blockquote,
pre,
a,
abbr,
acronym,
address,
big,
cite,
code,
del,
dfn,
em,
img,
ins,
kbd,
q,
s,
samp,
small,
strike,
strong,
sub,
sup,
tt,
var,
b,
u,
i,
center,
dl,
dt,
dd,
ol,
ul,
li,
fieldset,
form,
label,
legend,
table,
caption,
tbody,
tfoot,
thead,
tr,
th,
td,
article,
aside,
canvas,
details,
embed,
figure,
figcaption,
footer,
header,
hgroup,
menu,
nav,
output,
ruby,
section,
summary,
time,
mark,
audio,
video {
margin: 0;
padding: 0;
border: 0;
font-size: 100%;
font: inherit;
vertical-align: baseline;
}
a:hover {
color: #535bf2;
/* HTML5 display-role reset for older browsers */
article,
aside,
details,
figcaption,
figure,
footer,
header,
hgroup,
menu,
nav,
section {
display: block;
}

body {
margin: 0;
display: flex;
place-items: center;
min-width: 320px;
min-height: 100vh;
line-height: 1;
}

h1 {
font-size: 3.2em;
line-height: 1.1;
ol,
ul {
list-style: none;
}

.card {
padding: 2em;
blockquote,
q {
quotes: none;
}

#app {
max-width: 1280px;
margin: 0 auto;
padding: 2rem;
text-align: center;
blockquote:before,
blockquote:after,
q:before,
q:after {
content: '';
content: none;
}
table {
border-collapse: collapse;
border-spacing: 0;
}

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;
background: none;
border: none;
cursor: pointer;
transition: border-color 0.25s;
outline: none;
padding: 0;
}
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;
background-color: #ffffff;
}
a:hover {
color: #747bff;
}
button {
background-color: #f9f9f9;
}
*,
*::before,
*::after {
box-sizing: border-box;
}
File renamed without changes
1 change: 0 additions & 1 deletion dictionary-web-app/src/assets/svelte.svg

This file was deleted.

21 changes: 21 additions & 0 deletions dictionary-web-app/src/lib/Header.svelte
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
<script lang="ts">
import logo from '../assets/logo.svg';
import iconArrowDown from '../assets/icon-arrow-down.svg';
import iconMoon from '../assets/icon-moon.svg';
</script>

<div class="header">
<div class="left">
<img src={logo} alt="logo" width="32" height="36.5" />
</div>
<div class="right">
<button class="font-toggler">
<img src={iconArrowDown} alt="arrow down icon" />
</button>
<button class="dark-mode-toggler">
<img src={iconMoon} alt="moon icon" />
</button>
</div>
</div>

<style></style>
12 changes: 12 additions & 0 deletions dictionary-web-app/src/lib/SearchInput.svelte
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
<script lang="ts">
import iconSearch from '../assets/icon-search.svg';
</script>

<div class="search-input">
<input type="text" placeholder="Search for a word" />
<button>
<img src={iconSearch} alt="search icon" />
</button>
</div>

<style></style>

0 comments on commit 44c8288

Please sign in to comment.