mirror of
https://github.com/GraphiteEditor/Graphite.git
synced 2026-09-16 23:08:05 +08:00
Major CSS improvements to layout at small screen sizes. By adding min-width: 0 and min-height: 0 on the nested display: flex structure, widgets no longer coerce the whole layout into large-scale resizing. Scrollbars are now used to allow correct overflowing of the tab bar (fixes #177), Document Panel options bar, and tool shelf. Improvements to responsive resizing are also included for viewing the UI correctly on mobile now. Additional small fixes to styling of widget colors and corner roundness. The ruler has been darkened one shade to improve text contrast and aesthetics.
249 lines
5.4 KiB
Vue
249 lines
5.4 KiB
Vue
<template>
|
|
<MainWindow />
|
|
<div class="unsupported-modal-backdrop" v-if="showUnsupportedModal">
|
|
<div class="unsupported-modal">
|
|
<h2>Your browser currently doesn't support Graphite</h2>
|
|
<p>Unfortunately, some features won't work properly. Please upgrade to a modern browser such as Firefox, Chrome, Edge, or Safari version 15 or later.</p>
|
|
<p>
|
|
Your browser is missing support for the
|
|
<a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/BigInt64Array#browser_compatibility" target="_blank"><code>BigInt64Array</code></a> JavaScript
|
|
API which is required for using the editor. However, you can still explore the user interface.
|
|
</p>
|
|
<LayoutRow>
|
|
<button class="unsupported-modal-button" @click="closeModal()">I understand, let's just see the interface</button>
|
|
</LayoutRow>
|
|
</div>
|
|
</div>
|
|
</template>
|
|
|
|
<style lang="scss">
|
|
:root {
|
|
// Replace usage of `-rgb` variants with CSS color() function to calculate alpha when browsers support it
|
|
// See https://developer.mozilla.org/en-US/docs/Web/CSS/color_value/color() and https://caniuse.com/css-color-function
|
|
--color-0-black: #000;
|
|
--color-0-black-rgb: 0, 0, 0;
|
|
--color-1-nearblack: #111;
|
|
--color-1-nearblack-rgb: 17, 17, 17;
|
|
--color-2-mildblack: #222;
|
|
--color-2-mildblack-rgb: 34, 34, 34;
|
|
--color-3-darkgray: #333;
|
|
--color-3-darkgray-rgb: 51, 51, 51;
|
|
--color-4-dimgray: #444;
|
|
--color-4-dimgray-rgb: 68, 68, 68;
|
|
--color-5-dullgray: #555;
|
|
--color-5-dullgray-rgb: 85, 85, 85;
|
|
--color-6-lowergray: #666;
|
|
--color-6-lowergray-rgb: 102, 102, 102;
|
|
--color-7-middlegray: #777;
|
|
--color-7-middlegray-rgb: 109, 109, 109;
|
|
--color-8-uppergray: #888;
|
|
--color-8-uppergray-rgb: 136, 136, 136;
|
|
--color-9-palegray: #999;
|
|
--color-9-palegray-rgb: 153, 153, 153;
|
|
--color-a-softgray: #aaa;
|
|
--color-a-softgray-rgb: 170, 170, 170;
|
|
--color-b-lightgray: #bbb;
|
|
--color-b-lightgray-rgb: 187, 187, 187;
|
|
--color-c-brightgray: #ccc;
|
|
--color-c-brightgray-rgb: 204, 204, 204;
|
|
--color-d-mildwhite: #ddd;
|
|
--color-d-mildwhite-rgb: 221, 221, 221;
|
|
--color-e-nearwhite: #eee;
|
|
--color-e-nearwhite-rgb: 238, 238, 238;
|
|
--color-f-white: #fff;
|
|
--color-f-white-rgb: 255, 255, 255;
|
|
--color-accent: #3194d6;
|
|
--color-accent-rgb: 49, 148, 214;
|
|
--color-accent-hover: #49a5e2;
|
|
--color-accent-hover-rgb: 73, 165, 226;
|
|
--color-accent-disabled: #416277;
|
|
--color-accent-disabled-rgb: 65, 98, 119;
|
|
|
|
--color-data-raster: #e4bb72;
|
|
--color-data-raster-rgb: 228, 187, 114;
|
|
}
|
|
|
|
html,
|
|
body,
|
|
#app {
|
|
margin: 0;
|
|
height: 100%;
|
|
background: var(--color-2-mildblack);
|
|
user-select: none;
|
|
overscroll-behavior: none;
|
|
}
|
|
|
|
html,
|
|
body,
|
|
input,
|
|
textarea,
|
|
button {
|
|
font-family: "Source Sans Pro", Arial, sans-serif;
|
|
font-weight: 400;
|
|
font-size: 14px;
|
|
line-height: 1;
|
|
color: var(--color-e-nearwhite);
|
|
}
|
|
|
|
svg,
|
|
img {
|
|
display: block;
|
|
}
|
|
|
|
.scrollable,
|
|
.scrollable-x,
|
|
.scrollable-y {
|
|
// Standard
|
|
scrollbar-width: thin;
|
|
scrollbar-width: 6px;
|
|
scrollbar-gutter: 6px;
|
|
scrollbar-color: var(--color-5-dullgray) transparent;
|
|
|
|
&:not(:hover) {
|
|
scrollbar-width: none;
|
|
}
|
|
|
|
// WebKit
|
|
&::-webkit-scrollbar {
|
|
width: calc(2px + 6px + 2px);
|
|
height: calc(2px + 6px + 2px);
|
|
}
|
|
|
|
&:not(:hover)::-webkit-scrollbar {
|
|
width: 0;
|
|
height: 0;
|
|
}
|
|
|
|
&::-webkit-scrollbar-track {
|
|
box-shadow: inset 0 0 0 1px var(--color-5-dullgray);
|
|
border: 2px solid transparent;
|
|
border-radius: 10px;
|
|
|
|
&:hover {
|
|
box-shadow: inset 0 0 0 1px var(--color-6-lowergray);
|
|
}
|
|
}
|
|
|
|
&::-webkit-scrollbar-thumb {
|
|
background-clip: padding-box;
|
|
background-color: var(--color-5-dullgray);
|
|
border: 2px solid transparent;
|
|
border-radius: 10px;
|
|
margin: 2px;
|
|
|
|
&:hover {
|
|
background-color: var(--color-6-lowergray);
|
|
}
|
|
}
|
|
}
|
|
|
|
.scrollable {
|
|
// Standard
|
|
overflow: auto;
|
|
// WebKit
|
|
overflow: overlay;
|
|
}
|
|
|
|
.scrollable-x {
|
|
// Standard
|
|
overflow-x: auto;
|
|
// WebKit
|
|
overflow-x: overlay;
|
|
}
|
|
|
|
.scrollable-y {
|
|
// Standard
|
|
overflow-y: auto;
|
|
// WebKit
|
|
overflow-y: overlay;
|
|
}
|
|
|
|
// For placeholder messages (remove eventually)
|
|
.floating-menu {
|
|
h1,
|
|
h2,
|
|
h3,
|
|
h4,
|
|
h5,
|
|
h6,
|
|
p {
|
|
margin: 0;
|
|
}
|
|
|
|
p {
|
|
margin-top: 8px;
|
|
}
|
|
}
|
|
|
|
.unsupported-modal-backdrop {
|
|
background: rgba(255, 255, 255, 0.6);
|
|
position: absolute;
|
|
top: 0;
|
|
left: 0;
|
|
bottom: 0;
|
|
right: 0;
|
|
align-items: center;
|
|
justify-content: center;
|
|
display: flex;
|
|
}
|
|
.unsupported-modal {
|
|
background: var(--color-3-darkgray);
|
|
border-radius: 4px;
|
|
box-shadow: 2px 2px 5px 0 rgba(var(--color-0-black-rgb), 50%);
|
|
padding: 0 16px 16px 16px;
|
|
border: 1px solid var(--color-4-dimgray);
|
|
max-width: 500px;
|
|
|
|
& a {
|
|
color: var(--color-accent-hover);
|
|
}
|
|
}
|
|
.unsupported-modal-button {
|
|
flex: 1;
|
|
background: var(--color-1-nearblack);
|
|
border: 0 none;
|
|
padding: 12px;
|
|
border-radius: 2px;
|
|
|
|
&:hover {
|
|
background: var(--color-6-lowergray);
|
|
color: var(--color-f-white);
|
|
}
|
|
|
|
&:active {
|
|
background: var(--color-accent-hover);
|
|
color: var(--color-f-white);
|
|
}
|
|
}
|
|
</style>
|
|
|
|
<script lang="ts">
|
|
import { defineComponent } from "vue";
|
|
|
|
import dialog from "@/utilities/dialog";
|
|
import documents from "@/utilities/documents";
|
|
import fullscreen from "@/utilities/fullscreen";
|
|
|
|
import MainWindow from "@/components/window/MainWindow.vue";
|
|
import LayoutRow from "@/components/layout/LayoutRow.vue";
|
|
|
|
export default defineComponent({
|
|
provide: {
|
|
dialog,
|
|
documents,
|
|
fullscreen,
|
|
},
|
|
data() {
|
|
return {
|
|
showUnsupportedModal: !("BigInt64Array" in window),
|
|
};
|
|
},
|
|
methods: {
|
|
closeModal() {
|
|
this.showUnsupportedModal = false;
|
|
},
|
|
},
|
|
components: { MainWindow, LayoutRow },
|
|
});
|
|
</script>
|