adds styling for header + downloaded fonts
This commit is contained in:
parent
02d3915223
commit
3697db9b7d
7
package-lock.json
generated
7
package-lock.json
generated
@ -13,7 +13,6 @@
|
||||
"@sveltejs/kit": "^2.0.0",
|
||||
"@sveltejs/vite-plugin-svelte": "^3.0.0",
|
||||
"@tauri-apps/cli": "^1.5.9",
|
||||
"sass": "^1.70.0",
|
||||
"svelte": "^4.2.7",
|
||||
"svelte-check": "^3.6.0",
|
||||
"tslib": "^2.4.1",
|
||||
@ -707,7 +706,9 @@
|
||||
"version": "4.3.4",
|
||||
"resolved": "https://registry.npmjs.org/immutable/-/immutable-4.3.4.tgz",
|
||||
"integrity": "sha512-fsXeu4J4i6WNWSikpI88v/PcVflZz+6kMhUfIwc5SY+poQRPnaf5V7qds6SUyUN3cVxEzuCab7QIoLOQ+DQ1wA==",
|
||||
"dev": true
|
||||
"dev": true,
|
||||
"optional": true,
|
||||
"peer": true
|
||||
},
|
||||
"node_modules/import-fresh": {
|
||||
"version": "3.3.0",
|
||||
@ -1184,6 +1185,8 @@
|
||||
"resolved": "https://registry.npmjs.org/sass/-/sass-1.70.0.tgz",
|
||||
"integrity": "sha512-uUxNQ3zAHeAx5nRFskBnrWzDUJrrvpCPD5FNAoRvTi0WwremlheES3tg+56PaVtCs5QDRX5CBLxxKMDJMEa1WQ==",
|
||||
"dev": true,
|
||||
"optional": true,
|
||||
"peer": true,
|
||||
"dependencies": {
|
||||
"chokidar": ">=3.0.0 <4.0.0",
|
||||
"immutable": "^4.0.0",
|
||||
|
@ -16,7 +16,6 @@
|
||||
"@sveltejs/kit": "^2.0.0",
|
||||
"@sveltejs/vite-plugin-svelte": "^3.0.0",
|
||||
"@tauri-apps/cli": "^1.5.9",
|
||||
"sass": "^1.70.0",
|
||||
"svelte": "^4.2.7",
|
||||
"svelte-check": "^3.6.0",
|
||||
"tslib": "^2.4.1",
|
||||
|
9
src/app.css
Normal file
9
src/app.css
Normal file
@ -0,0 +1,9 @@
|
||||
* {
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
body {
|
||||
background-color: var(--background);
|
||||
color: var(--foreground);
|
||||
}
|
@ -1,8 +0,0 @@
|
||||
* {
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
body {
|
||||
background-color: $background;
|
||||
}
|
@ -1,9 +1,11 @@
|
||||
<script lang="ts">
|
||||
import '../app.scss';
|
||||
import '../app.css';
|
||||
import Header from './Header.svelte';
|
||||
</script>
|
||||
|
||||
<svelte:head>
|
||||
<title>Library Manager</title>
|
||||
</svelte:head>
|
||||
|
||||
<Header />
|
||||
<slot />
|
||||
|
||||
<style>
|
||||
@import '../variables.css';
|
||||
</style>
|
||||
|
@ -1,4 +0,0 @@
|
||||
<h1>Welcome to SvelteKit</h1>
|
||||
<p>
|
||||
Visit <a href="https://kit.svelte.dev">kit.svelte.dev</a> to read the documentation
|
||||
</p>
|
61
src/routes/Header.svelte
Normal file
61
src/routes/Header.svelte
Normal file
@ -0,0 +1,61 @@
|
||||
<nav>
|
||||
<div class="title">Library Manager</div>
|
||||
<div class="items">
|
||||
<div></div>
|
||||
<!-- TODO: Switch icon between nf-md-view_list and nf-md-view_grid -->
|
||||
<div></div>
|
||||
<div></div>
|
||||
</div>
|
||||
</nav>
|
||||
|
||||
<style>
|
||||
nav {
|
||||
height: 80px;
|
||||
background-color: var(--dark-gray);
|
||||
display: flex;
|
||||
align-items: center;
|
||||
|
||||
& div {
|
||||
height: 100%;
|
||||
width: 50%;
|
||||
|
||||
padding: 0 20px;
|
||||
|
||||
display: flex;
|
||||
align-items: center;
|
||||
|
||||
user-select: none;
|
||||
-webkit-user-select: none;
|
||||
-ms-user-select: none;
|
||||
|
||||
&:hover {
|
||||
cursor: default;
|
||||
}
|
||||
|
||||
&.title {
|
||||
font-size: 40px;
|
||||
font-weight: bold;
|
||||
font-family: 'Oswald', sans-serif;
|
||||
}
|
||||
|
||||
&.items {
|
||||
font-family: 'NFSymbols', monospace;
|
||||
font-size: 20px;
|
||||
|
||||
justify-content: flex-end;
|
||||
|
||||
& div {
|
||||
width: auto;
|
||||
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
|
||||
&:last-child {
|
||||
padding-right: 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
34
src/variables.css
Normal file
34
src/variables.css
Normal file
@ -0,0 +1,34 @@
|
||||
:global(:root) {
|
||||
--background: #282828;
|
||||
--dark-red: #cc241d;
|
||||
--dark-green: #98971a;
|
||||
--dark-yellow: #d79921;
|
||||
--dark-blue: #458588;
|
||||
--dark-purple: #b16286;
|
||||
--dark-aqua: #689d6a;
|
||||
--dark-gray: #928374;
|
||||
|
||||
--foreground: #ebdbb2;
|
||||
--light-red: #fb4934;
|
||||
--light-green: #b8bb26;
|
||||
--light-yellow: #fabd2f;
|
||||
--light-blue: #83a598;
|
||||
--light-purple: #d3869b;
|
||||
--light-aqua: #8ec07c;
|
||||
--light-gray: #a89984;
|
||||
|
||||
--screen-sm-min: 576px;
|
||||
--screen-md-min: 768px;
|
||||
--screen-lg-min: 992px;
|
||||
--screen-xl-min: 1200px;
|
||||
}
|
||||
|
||||
@font-face {
|
||||
font-family: 'Oswald';
|
||||
src: url('/fonts/Oswald/Oswald-VariableFont_wght.ttf');
|
||||
}
|
||||
|
||||
@font-face {
|
||||
font-family: 'NFSymbols';
|
||||
src: url('/fonts/NFSymbols/SymbolsNerdFontMono-Regular.ttf');
|
||||
}
|
@ -1,52 +0,0 @@
|
||||
// Gruvbox colors.
|
||||
$background: #282828;
|
||||
$dark-red: #cc241d;
|
||||
$dark-green: #98971a;
|
||||
$dark-yellow: #d79921;
|
||||
$dark-blue: #458588;
|
||||
$dark-purple: #b16286;
|
||||
$dark-aqua: #689d6a;
|
||||
$dark-gray: #928374;
|
||||
|
||||
$foreground: #ebdbb2;
|
||||
$light-red: #fb4934;
|
||||
$light-green: #b8bb26;
|
||||
$light-yellow: #fabd2f;
|
||||
$light-blue: #83a598;
|
||||
$light-purple: #d3869b;
|
||||
$light-aqua: #8ec07c;
|
||||
$light-gray: #a89984;
|
||||
|
||||
// Screen size definitions.
|
||||
$screen-sm-min: 576px; // Small tablets and large smartphones (landscape).
|
||||
$screen-md-min: 768px; // Small tablets (portrait).
|
||||
$screen-lg-min: 992px; // Tablets and small desktops.
|
||||
$screen-xl-min: 1200px; // Large tablets and desktops.
|
||||
|
||||
// Small devices
|
||||
@mixin sm {
|
||||
@media (min-width: #{$screen-sm-min}) {
|
||||
@content;
|
||||
}
|
||||
}
|
||||
|
||||
// Medium devices
|
||||
@mixin md {
|
||||
@media (min-width: #{$screen-md-min}) {
|
||||
@content;
|
||||
}
|
||||
}
|
||||
|
||||
// Large devices
|
||||
@mixin lg {
|
||||
@media (min-width: #{$screen-lg-min}) {
|
||||
@content;
|
||||
}
|
||||
}
|
||||
|
||||
// Extra-large devices
|
||||
@mixin xl {
|
||||
@media (min-width: #{$screen-xl-min}) {
|
||||
@content;
|
||||
}
|
||||
}
|
21
static/fonts/NFSymbols/LICENSE
Normal file
21
static/fonts/NFSymbols/LICENSE
Normal file
@ -0,0 +1,21 @@
|
||||
The MIT License (MIT)
|
||||
|
||||
Copyright (c) 2014 Ryan L McIntyre
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
46
static/fonts/NFSymbols/README.md
Normal file
46
static/fonts/NFSymbols/README.md
Normal file
@ -0,0 +1,46 @@
|
||||
# Nerd Fonts
|
||||
|
||||
This is an archived font from the Nerd Fonts release v3.1.1.
|
||||
|
||||
For more information see:
|
||||
* https://github.com/ryanoasis/nerd-fonts/
|
||||
* https://github.com/ryanoasis/nerd-fonts/releases/latest/
|
||||
|
||||
# Symbols Only
|
||||
|
||||
This font contains (in the patched-fonts folder) all symbols and is intended to be used
|
||||
as fallback or together with fontconfig - so that you do not need to individually
|
||||
patch all the fonts. YMMV.
|
||||
|
||||
## Which font?
|
||||
|
||||
### TL;DR
|
||||
|
||||
* Pick your font family:
|
||||
* If you are limited to monospaced fonts (because of your terminal, etc) then pick a font with `Nerd Font Mono` (or `NFM`).
|
||||
* If you want to have bigger icons (usually around 1.5 normal letters wide) pick a font without `Mono` i.e. `Nerd Font` (or `NF`). Most terminals support this, but ymmv.
|
||||
* If you work in a proportional context (GUI elements or edit a presentation etc) pick a font with `Nerd Font Propo` (or `NFP`).
|
||||
|
||||
### Ligatures
|
||||
|
||||
Ligatures are generally preserved in the patched fonts.
|
||||
Nerd Fonts `v2.0.0` had no ligatures in the `Nerd Font Mono` fonts, this has been dropped with `v2.1.0`.
|
||||
If you have a ligature-aware terminal and don't want ligatures you can (usually) disable them in the terminal settings.
|
||||
|
||||
### Explanation
|
||||
|
||||
Once you narrow down your font choice of family (`Droid Sans`, `Inconsolata`, etc) and style (`bold`, `italic`, etc) you have 2 main choices:
|
||||
|
||||
#### `Option 1: Download already patched font`
|
||||
|
||||
* For a stable version download a font package from the [release page](https://github.com/ryanoasis/nerd-fonts/releases)
|
||||
* Or download the development version from the folders here
|
||||
|
||||
#### `Option 2: Patch your own font`
|
||||
|
||||
* Patch your own variations with the various options provided by the font patcher (i.e. not include all symbols for smaller font size)
|
||||
|
||||
For more information see: [The FAQ](https://github.com/ryanoasis/nerd-fonts/wiki/FAQ-and-Troubleshooting#which-font)
|
||||
|
||||
[SIL-RFN]:http://scripts.sil.org/cms/scripts/page.php?item_id=OFL_web_fonts_and_RFNs#14cbfd4a
|
||||
|
BIN
static/fonts/NFSymbols/SymbolsNerdFont-Regular.ttf
Normal file
BIN
static/fonts/NFSymbols/SymbolsNerdFont-Regular.ttf
Normal file
Binary file not shown.
BIN
static/fonts/NFSymbols/SymbolsNerdFontMono-Regular.ttf
Normal file
BIN
static/fonts/NFSymbols/SymbolsNerdFontMono-Regular.ttf
Normal file
Binary file not shown.
93
static/fonts/Oswald/OFL.txt
Normal file
93
static/fonts/Oswald/OFL.txt
Normal file
@ -0,0 +1,93 @@
|
||||
Copyright 2016 The Oswald Project Authors (https://github.com/googlefonts/OswaldFont)
|
||||
|
||||
This Font Software is licensed under the SIL Open Font License, Version 1.1.
|
||||
This license is copied below, and is also available with a FAQ at:
|
||||
http://scripts.sil.org/OFL
|
||||
|
||||
|
||||
-----------------------------------------------------------
|
||||
SIL OPEN FONT LICENSE Version 1.1 - 26 February 2007
|
||||
-----------------------------------------------------------
|
||||
|
||||
PREAMBLE
|
||||
The goals of the Open Font License (OFL) are to stimulate worldwide
|
||||
development of collaborative font projects, to support the font creation
|
||||
efforts of academic and linguistic communities, and to provide a free and
|
||||
open framework in which fonts may be shared and improved in partnership
|
||||
with others.
|
||||
|
||||
The OFL allows the licensed fonts to be used, studied, modified and
|
||||
redistributed freely as long as they are not sold by themselves. The
|
||||
fonts, including any derivative works, can be bundled, embedded,
|
||||
redistributed and/or sold with any software provided that any reserved
|
||||
names are not used by derivative works. The fonts and derivatives,
|
||||
however, cannot be released under any other type of license. The
|
||||
requirement for fonts to remain under this license does not apply
|
||||
to any document created using the fonts or their derivatives.
|
||||
|
||||
DEFINITIONS
|
||||
"Font Software" refers to the set of files released by the Copyright
|
||||
Holder(s) under this license and clearly marked as such. This may
|
||||
include source files, build scripts and documentation.
|
||||
|
||||
"Reserved Font Name" refers to any names specified as such after the
|
||||
copyright statement(s).
|
||||
|
||||
"Original Version" refers to the collection of Font Software components as
|
||||
distributed by the Copyright Holder(s).
|
||||
|
||||
"Modified Version" refers to any derivative made by adding to, deleting,
|
||||
or substituting -- in part or in whole -- any of the components of the
|
||||
Original Version, by changing formats or by porting the Font Software to a
|
||||
new environment.
|
||||
|
||||
"Author" refers to any designer, engineer, programmer, technical
|
||||
writer or other person who contributed to the Font Software.
|
||||
|
||||
PERMISSION & CONDITIONS
|
||||
Permission is hereby granted, free of charge, to any person obtaining
|
||||
a copy of the Font Software, to use, study, copy, merge, embed, modify,
|
||||
redistribute, and sell modified and unmodified copies of the Font
|
||||
Software, subject to the following conditions:
|
||||
|
||||
1) Neither the Font Software nor any of its individual components,
|
||||
in Original or Modified Versions, may be sold by itself.
|
||||
|
||||
2) Original or Modified Versions of the Font Software may be bundled,
|
||||
redistributed and/or sold with any software, provided that each copy
|
||||
contains the above copyright notice and this license. These can be
|
||||
included either as stand-alone text files, human-readable headers or
|
||||
in the appropriate machine-readable metadata fields within text or
|
||||
binary files as long as those fields can be easily viewed by the user.
|
||||
|
||||
3) No Modified Version of the Font Software may use the Reserved Font
|
||||
Name(s) unless explicit written permission is granted by the corresponding
|
||||
Copyright Holder. This restriction only applies to the primary font name as
|
||||
presented to the users.
|
||||
|
||||
4) The name(s) of the Copyright Holder(s) or the Author(s) of the Font
|
||||
Software shall not be used to promote, endorse or advertise any
|
||||
Modified Version, except to acknowledge the contribution(s) of the
|
||||
Copyright Holder(s) and the Author(s) or with their explicit written
|
||||
permission.
|
||||
|
||||
5) The Font Software, modified or unmodified, in part or in whole,
|
||||
must be distributed entirely under this license, and must not be
|
||||
distributed under any other license. The requirement for fonts to
|
||||
remain under this license does not apply to any document created
|
||||
using the Font Software.
|
||||
|
||||
TERMINATION
|
||||
This license becomes null and void if any of the above conditions are
|
||||
not met.
|
||||
|
||||
DISCLAIMER
|
||||
THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
||||
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF
|
||||
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT
|
||||
OF COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL THE
|
||||
COPYRIGHT HOLDER BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
|
||||
INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL
|
||||
DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
||||
FROM, OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM
|
||||
OTHER DEALINGS IN THE FONT SOFTWARE.
|
BIN
static/fonts/Oswald/Oswald-VariableFont_wght.ttf
Normal file
BIN
static/fonts/Oswald/Oswald-VariableFont_wght.ttf
Normal file
Binary file not shown.
68
static/fonts/Oswald/README.txt
Normal file
68
static/fonts/Oswald/README.txt
Normal file
@ -0,0 +1,68 @@
|
||||
Oswald Variable Font
|
||||
====================
|
||||
|
||||
This download contains Oswald as both a variable font and static fonts.
|
||||
|
||||
Oswald is a variable font with this axis:
|
||||
wght
|
||||
|
||||
This means all the styles are contained in a single file:
|
||||
Oswald-VariableFont_wght.ttf
|
||||
|
||||
If your app fully supports variable fonts, you can now pick intermediate styles
|
||||
that aren’t available as static fonts. Not all apps support variable fonts, and
|
||||
in those cases you can use the static font files for Oswald:
|
||||
static/Oswald-ExtraLight.ttf
|
||||
static/Oswald-Light.ttf
|
||||
static/Oswald-Regular.ttf
|
||||
static/Oswald-Medium.ttf
|
||||
static/Oswald-SemiBold.ttf
|
||||
static/Oswald-Bold.ttf
|
||||
|
||||
Get started
|
||||
-----------
|
||||
|
||||
1. Install the font files you want to use
|
||||
|
||||
2. Use your app's font picker to view the font family and all the
|
||||
available styles
|
||||
|
||||
Learn more about variable fonts
|
||||
-------------------------------
|
||||
|
||||
https://developers.google.com/web/fundamentals/design-and-ux/typography/variable-fonts
|
||||
https://variablefonts.typenetwork.com
|
||||
https://medium.com/variable-fonts
|
||||
|
||||
In desktop apps
|
||||
|
||||
https://theblog.adobe.com/can-variable-fonts-illustrator-cc
|
||||
https://helpx.adobe.com/nz/photoshop/using/fonts.html#variable_fonts
|
||||
|
||||
Online
|
||||
|
||||
https://developers.google.com/fonts/docs/getting_started
|
||||
https://developer.mozilla.org/en-US/docs/Web/CSS/CSS_Fonts/Variable_Fonts_Guide
|
||||
https://developer.microsoft.com/en-us/microsoft-edge/testdrive/demos/variable-fonts
|
||||
|
||||
Installing fonts
|
||||
|
||||
MacOS: https://support.apple.com/en-us/HT201749
|
||||
Linux: https://www.google.com/search?q=how+to+install+a+font+on+gnu%2Blinux
|
||||
Windows: https://support.microsoft.com/en-us/help/314960/how-to-install-or-remove-a-font-in-windows
|
||||
|
||||
Android Apps
|
||||
|
||||
https://developers.google.com/fonts/docs/android
|
||||
https://developer.android.com/guide/topics/ui/look-and-feel/downloadable-fonts
|
||||
|
||||
License
|
||||
-------
|
||||
Please read the full license text (OFL.txt) to understand the permissions,
|
||||
restrictions and requirements for usage, redistribution, and modification.
|
||||
|
||||
You can use them in your products & projects – print or digital,
|
||||
commercial or otherwise.
|
||||
|
||||
This isn't legal advice, please consider consulting a lawyer and see the full
|
||||
license for all details.
|
BIN
static/fonts/Oswald/static/Oswald-Bold.ttf
Normal file
BIN
static/fonts/Oswald/static/Oswald-Bold.ttf
Normal file
Binary file not shown.
BIN
static/fonts/Oswald/static/Oswald-ExtraLight.ttf
Normal file
BIN
static/fonts/Oswald/static/Oswald-ExtraLight.ttf
Normal file
Binary file not shown.
BIN
static/fonts/Oswald/static/Oswald-Light.ttf
Normal file
BIN
static/fonts/Oswald/static/Oswald-Light.ttf
Normal file
Binary file not shown.
BIN
static/fonts/Oswald/static/Oswald-Medium.ttf
Normal file
BIN
static/fonts/Oswald/static/Oswald-Medium.ttf
Normal file
Binary file not shown.
BIN
static/fonts/Oswald/static/Oswald-Regular.ttf
Normal file
BIN
static/fonts/Oswald/static/Oswald-Regular.ttf
Normal file
Binary file not shown.
BIN
static/fonts/Oswald/static/Oswald-SemiBold.ttf
Normal file
BIN
static/fonts/Oswald/static/Oswald-SemiBold.ttf
Normal file
Binary file not shown.
@ -3,11 +3,4 @@ import { defineConfig } from 'vite';
|
||||
|
||||
export default defineConfig({
|
||||
plugins: [sveltekit()],
|
||||
css: {
|
||||
preprocessorOptions: {
|
||||
scss: {
|
||||
additionalData: '@use "src/variables.scss" as *;',
|
||||
},
|
||||
},
|
||||
},
|
||||
});
|
||||
|
Loading…
x
Reference in New Issue
Block a user