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

Move gallery to common and CSS tweaks #112

Merged
merged 3 commits into from
Jun 20, 2023
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
169 changes: 85 additions & 84 deletions m101-supernova/src/Gallery.vue → common/src/components/Gallery.vue
Original file line number Diff line number Diff line change
Expand Up @@ -193,115 +193,116 @@ export default defineComponent({

</script>

<style scoped lang="less">
.blurred {
background: transparent;
box-shadow: 0 4px 30px rgba(0, 0, 0, 0.1);
backdrop-filter: blur(6px);
}

<style lang="less">
.gallery-root {
transition-property: height, width;
transition: 0.5s ease-out;
}

.gallery {
border-radius: 5px;
border: 1px solid white;
display: flex;
flex-direction: column;
overflow-y: auto;
max-height: var(--gallery-max-height);
width: min(calc(var(--gallery-width)), calc(100%));
.blurred {
background: transparent;
box-shadow: 0 4px 30px rgba(0, 0, 0, 0.1);
backdrop-filter: blur(6px);
}

.gallery {
border-radius: 5px;
border: 1px solid white;
display: flex;
flex-direction: column;
overflow-y: auto;
max-height: var(--gallery-max-height);
width: min(calc(var(--gallery-width)), calc(100%));

// Better way to do this?
// Better way to do this?
position: fixed;
left: 50%;
transform: translateX(-50%);
}
}

.noselect {
user-select: none;
-webkit-user-select: none;
-ms-user-select: none;
}
.noselect {
user-select: none;
-webkit-user-select: none;
-ms-user-select: none;
}

.gallery-header {
position: relative;
display: flex;
justify-content: center;
}
.gallery-header {
position: relative;
display: flex;
justify-content: center;
}

.gallery-title {
font-size: 16pt;
}
.gallery-title {
font-size: 16pt;
}

.gallery-close {
position: absolute;
right: 3px;
cursor: pointer;
}
.gallery-close {
position: absolute;
right: 3px;
cursor: pointer;
}

.gallery-content {
display: grid;
grid-template-columns: repeat(var(--column-count), minmax(100px, 1fr));
column-gap: 10px;
row-gap: 5px;
padding: 5px
}
.gallery-content {
display: grid;
grid-template-columns: repeat(var(--column-count), minmax(100px, 1fr));
column-gap: 10px;
row-gap: 5px;
padding: 5px
}

.default-activator {
border-radius: 3px;
border: solid 1px white;
position: relative;
height: fit-content;
width: fit-content;
display: flex;
flex-direction: column;
cursor: pointer;

img {
padding: 5px;
.default-activator {
border-radius: 3px;
border: solid 1px white;
position: relative;
height: fit-content;
width: fit-content;
display: flex;
flex-direction: column;
cursor: pointer;

img {
padding: 5px;
border-radius: 3px;
}
}
}

.default-activator-title {
margin: auto;
}
.default-activator-title {
margin: auto;
}

.gallery-item {
border-radius: 3px;
border: 1px solid white;
height: 100%;
display: flex;
flex-direction: column;
cursor: pointer;

img {
margin-left: auto;
margin-right: auto;
.gallery-item {
border-radius: 3px;
}
border: 1px solid white;
height: 100%;
display: flex;
flex-direction: column;
cursor: pointer;

img {
margin-left: auto;
margin-right: auto;
border-radius: 3px;
}

span {
flex-grow: 1;
display: inline-grid;
align-items: center;
text-align: center;
span {
flex-grow: 1;
display: inline-grid;
align-items: center;
text-align: center;
}
}
}

.selected {
border: 1px solid var(--selected-color);
.selected {
border: 1px solid var(--selected-color);

span {
color: var(--selected-color);
span {
color: var(--selected-color);
}
}

.place-name {
font-size: 10pt;
}
}

.place-name {
font-size: 10pt;
}
</style>

10 changes: 5 additions & 5 deletions common/src/components/IconButton.vue
Original file line number Diff line number Diff line change
Expand Up @@ -120,13 +120,13 @@ export default defineComponent({
color: var(--focus-color);
border-color: var(--focus-color);
}
}

.active {
box-shadow: 0px 0px 10px 3px var(--color);
&.active {
box-shadow: 0px 0px 10px 3px var(--color);

&:focus {
box-shadow: 0px 0px 10px 3px var(--focus-color);
&:focus {
box-shadow: 0px 0px 10px 3px var(--focus-color);
}
}
}
</style>
4 changes: 2 additions & 2 deletions common/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,13 @@ import { KeyboardControlSettings } from "./keyboard";
import MiniDSBase from "./components/MiniDSBase";
import IconButton from "./components/IconButton.vue";
import { BackgroundImageset, skyBackgroundImagesets } from "./background";
//import Gallery from "./components/Gallery.vue";
import Gallery from "./components/Gallery.vue";

export {
BackgroundImageset,
KeyboardControlSettings,
MiniDSBase,
//Gallery,
Gallery,
IconButton,
skyBackgroundImagesets
};
11 changes: 11 additions & 0 deletions common/vue.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,17 @@ module.exports = defineConfig({
return opts;
});
}

// Keep the very big WWT engine external
config.externals({
'@wwtelescope/engine': {
'amd': '@wwtelescope/engine', // typeof define === 'function' && define.amd
'commonjs2': '@wwtelescope/engine', // typeof exports === 'object' && typeof module === 'object'
'commonjs': '@wwtelescope/engine', // typeof exports === 'object'
'root': 'wwtlib' // none of the above: browser mode using global variables
}
});

},

// TODO: For some reason we're having trouble loading chunks
Expand Down
3 changes: 1 addition & 2 deletions m101-supernova/src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,7 @@ import d3Scatter from "./d3-scatter.vue";
import ConstellationIcon from "./ConstellationIcon.vue";
import { IconButton } from "@minids/common";

import Gallery from "./Gallery.vue";
// import { Gallery } from "@minids/common";
import { Gallery } from "@minids/common";

import "./polyfills";

Expand Down