Anki/qt/aqt/data/web/css/toolbar.scss
Damien Elmes 9f55cf26fc
Switch to SvelteKit (#3077)
* Update to latest Node LTS

* Add sveltekit

* Split tslib into separate @generated and @tslib components

SvelteKit's path aliases don't support multiple locations, so our old
approach of using @tslib to refer to both ts/lib and out/ts/lib will no
longer work. Instead, all generated sources and their includes are
placed in a separate out/ts/generated folder, and imported via @generated
instead. This also allows us to generate .ts files, instead of needing
to output separate .d.ts and .js files.

* Switch package.json to module type

* Avoid usage of baseUrl

Incompatible with SvelteKit

* Move sass into ts; use relative links

SvelteKit's default sass support doesn't allow overriding loadPaths

* jest->vitest, graphs example working with yarn dev

* most pages working in dev mode

* Some fixes after rebasing

* Fix/silence some svelte-check errors

* Get image-occlusion working with Fabric types

* Post-rebase lock changes

* Editor is now checked

* SvelteKit build integrated into ninja

* Use the new SvelteKit entrypoint for pages like congrats/deck options/etc

* Run eslint once for ts/**; fix some tests

* Fix a bunch of issues introduced when rebasing over latest main

* Run eslint fix

* Fix remaining eslint+pylint issues; tests now all pass

* Fix some issues with a clean build

* Latest bufbuild no longer requires @__PURE__ hack

* Add a few missed dependencies

* Add yarn.bat to fix Windows build

* Fix pages failing to show when ANKI_API_PORT not defined

* Fix svelte-check and vitest on Windows

* Set node path in ./yarn

* Move svelte-kit output to ts/.svelte-kit

Sadly, I couldn't figure out a way to store it in out/ if out/ is
a symlink, as it breaks module resolution when SvelteKit is run.

* Allow HMR inside Anki

* Skip SvelteKit build when HMR is defined

* Fix some post-rebase issues

I should have done a normal merge instead.
2024-03-31 09:16:31 +01:00

158 lines
3.3 KiB
SCSS

/* Copyright: Ankitects Pty Ltd and contributors
* License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html */
@use "../../../../../ts/lib/sass/root-vars";
@use "../../../../../ts/lib/sass/vars" as *;
@use "../../../../../ts/lib/sass/elevation" as *;
@use "../../../../../ts/lib/sass/button-mixins" as button;
.header {
display: grid;
grid-template-columns: repeat(3, 1fr);
align-items: start;
align-content: space-between;
body:not(.fancy) & {
border-bottom: 1px solid var(--border-subtle);
}
}
.left-tray {
justify-self: start;
}
.right-tray {
justify-self: end;
}
.left-tray,
.right-tray {
align-self: start;
display: flex;
flex-direction: row;
align-items: start;
}
.toolbar {
justify-self: center;
white-space: nowrap;
.fancy & {
transition: all var(--transition) ease-in-out;
}
}
.hitem {
font-weight: bold;
padding: 5px 12px;
color: color(fg);
display: inline-block;
&:hover {
text-decoration: underline;
}
}
body {
margin: 0;
padding: 0;
-webkit-user-select: none;
overflow: hidden;
&:not(.fancy).hidden {
opacity: 0;
}
&.fancy {
margin-bottom: 5px;
&.hidden {
transform: translateY(-100vh);
}
transition: transform var(--transition) ease-in-out;
.toolbar {
overflow: hidden;
border-bottom-left-radius: prop(border-radius-medium);
border-bottom-right-radius: prop(border-radius-medium);
@include elevation(1, $opacity-boost: -0.1);
// glass effect
background: var(--canvas-glass);
backdrop-filter: blur(var(--blur));
}
// elevated state (deck browser, overview)
&:not(.flat) .toolbar {
background: var(--canvas-elevated);
@include elevation(1);
&:hover {
@include elevation(2);
}
}
&:not(.flat) .hitem {
@include button.base($border: false, $with-hover: false);
background: var(--canvas-glass);
border: 1px solid transparent;
}
.hitem {
text-decoration: none;
border: 1px solid transparent;
&:hover {
border: 1px solid var(--border-subtle);
}
&:active {
background: var(--canvas-inset);
}
&:first-child {
padding-left: 18px;
}
&:last-child {
padding-right: 18px;
}
}
}
}
* {
-webkit-user-drag: none;
}
.hitem:focus {
outline: 0;
}
@keyframes spin {
0% {
-webkit-transform: rotate(0deg);
}
100% {
-webkit-transform: rotate(360deg);
}
}
.spin {
width: 16px !important;
animation: spin;
animation-duration: 2s;
animation-iteration-count: infinite;
display: inline-block;
visibility: visible !important;
animation-timing-function: linear;
transition: all var(--transition) ease-in;
}
#sync-spinner {
height: 16px;
margin-bottom: -3px;
visibility: hidden;
width: 0;
}
.normal-sync {
color: color(state-new) !important;
}
.full-sync {
color: color(state-learn) !important;
}