Skip to content
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
55 changes: 55 additions & 0 deletions app/components/OptionCard.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
<script setup>
import { useTheme } from "vuetify"

const theme = useTheme()
const primaryColor = computed(() => theme.current.value.colors.primary)

defineProps({
title: { type: String, default: "" },
width: { type: [Number, String], default: 320 },
maxHeight: { type: [Number, String], default: 500 },
})
</script>
<template>
<v-card
@click.stop
:title="title"
class="option-card rounded-xl border-thin elevation-24"
:width="width"
:max-height="maxHeight"
:ripple="false"
theme="dark"
>
<v-card-text class="pa-5">
<slot />
</v-card-text>
<v-card-actions v-if="$slots.actions" class="justify-center pb-4">
<slot name="actions" />
</v-card-actions>
</v-card>
</template>

<style scoped>
.option-card {
background-color: rgba(30, 30, 30, 0.85) !important;
backdrop-filter: blur(20px);
-webkit-backdrop-filter: blur(20px);
border-color: rgba(255, 255, 255, 0.15) !important;
}

::v-deep(.v-list-item:hover) {
background-color: rgba(255, 255, 255, 0.1);
}

::v-deep(.v-slider-track__fill),
::v-deep(.v-selection-control--dirty .v-switch__track) {
background-color: v-bind(primaryColor) !important;
}

::v-deep(.v-btn) {
border-radius: 8px;
text-transform: none;
font-weight: 500;
letter-spacing: normal;
}
</style>
116 changes: 46 additions & 70 deletions app/components/Screenshot.vue
Original file line number Diff line number Diff line change
@@ -1,65 +1,3 @@
<template>
<v-sheet
v-if="props.show_dialog"
:width="props.width + 'px'"
class="screenshot_menu"
border="md"
>
<v-card class="bg-primary pa-0">
<v-card-title>
<h3 class="mt-4">Take a screenshot</h3>
</v-card-title>
<v-card-text class="pa-0">
<v-container>
<v-row>
<v-col cols="8" class="py-0">
<v-text-field v-model="filename" label="File name"></v-text-field>
</v-col>
<v-col cols="4" class="py-0">
<v-select
v-model="output_extension"
:items="output_extensions"
label="Extension"
required
/>
</v-col>
</v-row>

<v-row>
<v-col cols="12" class="py-0">
<v-switch
v-model="include_background"
:disabled="output_extension !== 'png'"
label="Include background"
inset
></v-switch>
</v-col>
</v-row>
</v-container>
</v-card-text>
<v-card-actions justify-center>
<v-btn
variant="outlined"
color="white"
text
@click="emit('close')"
class="ml-8 mb-4"
>Close</v-btn
>
<v-btn
variant="outlined"
class="mb-4"
:disabled="!filename || !output_extension"
color="white"
text
@click="takeScreenshot()"
>Screenshot</v-btn
>
</v-card-actions>
</v-card>
</v-sheet>
</template>

<script setup>
import fileDownload from "js-file-download"
import viewer_schemas from "@geode/opengeodeweb-viewer/opengeodeweb_viewer_schemas.json"
Expand Down Expand Up @@ -107,12 +45,50 @@
}
})
</script>
<template>
<OptionCard
v-if="props.show_dialog"
title="Take a screenshot"
:width="props.width"
class="position-absolute"
style="z-index: 2; top: 90px; right: 55px"
>
<v-container>
<v-row>
<v-col cols="8" class="py-0">
<v-text-field v-model="filename" label="File name"></v-text-field>
</v-col>
<v-col cols="4" class="py-0">
<v-select
v-model="output_extension"
:items="output_extensions"
label="Extension"
required
/>
</v-col>
</v-row>

<style scoped>
.screenshot_menu {
position: absolute;
z-index: 2;
top: 90px;
right: 55px;
}
</style>
<v-row>
<v-col cols="12" class="py-0">
<v-switch
v-model="include_background"
:disabled="output_extension !== 'png'"
label="Include background"
inset
></v-switch>
</v-col>
</v-row>
</v-container>

<template #actions>
<v-btn variant="text" color="white" @click="emit('close')">Close</v-btn>
<v-btn
variant="outlined"
:disabled="!filename || !output_extension"
color="white"
@click="takeScreenshot()"
>Screenshot</v-btn
>
</template>
</OptionCard>
</template>
103 changes: 41 additions & 62 deletions app/components/Viewer/ContextMenuItem.vue
Original file line number Diff line number Diff line change
@@ -1,50 +1,3 @@
<template>
<v-sheet class="menu-item-container transition-swing" color="transparent">
<v-tooltip
:location="props.itemProps.tooltip_location"
:origin="props.itemProps.tooltip_origin"
>
<template v-slot:activator="{ props: tooltipProps }">
<v-btn
icon
:active="is_active"
@click.stop="toggleOptions"
v-bind="tooltipProps"
class="menu-btn bg-white border"
elevation="2"
>
<v-img :src="btn_image" height="28" width="28" />
</v-btn>
</template>
<span>{{ props.tooltip }}</span>
</v-tooltip>

<v-sheet
v-if="is_active"
ref="optionsRef"
class="menu-options d-flex align-center pa-0"
:class="optionsClass"
:style="optionsStyle"
color="transparent"
@click.stop
>
<v-card
@click.stop
:title="props.tooltip"
class="options-card rounded-xl border-thin elevation-24"
width="320"
:max-height="maxCardHeight"
:ripple="false"
theme="dark"
>
<v-card-text class="pa-5">
<slot name="options" />
</v-card-text>
</v-card>
</v-sheet>
</v-sheet>
</template>

<script setup>
import { useTheme } from "vuetify"
import { useMenuStore } from "@ogw_front/stores/menu"
Expand Down Expand Up @@ -103,6 +56,46 @@

const toggleOptions = () => menuStore.toggleItemOptions(props.index)
</script>
<template>
<v-sheet class="menu-item-container transition-swing" color="transparent">
<v-tooltip
:location="props.itemProps.tooltip_location"
:origin="props.itemProps.tooltip_origin"
>
<template v-slot:activator="{ props: tooltipProps }">
<v-btn
icon
:active="is_active"
@click.stop="toggleOptions"
v-bind="tooltipProps"
class="menu-btn bg-white border"
elevation="2"
>
<v-img :src="btn_image" height="28" width="28" />
</v-btn>
</template>
<span>{{ props.tooltip }}</span>
</v-tooltip>

<v-sheet
v-if="is_active"
ref="optionsRef"
class="menu-options d-flex align-center pa-0"
:class="optionsClass"
:style="optionsStyle"
color="transparent"
@click.stop
>
<OptionCard
:title="props.tooltip"
width="320"
:max-height="maxCardHeight"
>
<slot name="options" />
</OptionCard>
</v-sheet>
</v-sheet>
</template>

<style scoped>
.menu-item-container {
Expand Down Expand Up @@ -146,22 +139,8 @@
.options-right {
left: 60px;
}

.options-left {
right: 60px;
}

.options-card {
background-color: rgba(30, 30, 30, 0.85) !important;
backdrop-filter: blur(20px);
-webkit-backdrop-filter: blur(20px);
border-color: rgba(255, 255, 255, 0.15) !important;
}

::v-deep(.v-list-item:hover) {
background-color: rgba(255, 255, 255, 0.1);
}
::v-deep(.v-slider-track__fill),
::v-deep(.v-selection-control--dirty .v-switch__track) {
background-color: v-bind(primaryColor) !important;
}
</style>
Loading
Loading