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

Zoom in on real browser screenshot #3925

Merged
merged 9 commits into from
Nov 23, 2023
Merged
Show file tree
Hide file tree
Changes from 6 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
4 changes: 4 additions & 0 deletions src/assets/app.scss
Original file line number Diff line number Diff line change
Expand Up @@ -635,6 +635,10 @@ $shadow-box-padding: 20px;
}
}

.zoom-cursor {
cursor: zoom-in;
}

// Localization

@import "localization.scss";
52 changes: 52 additions & 0 deletions src/components/ScreenshotDialog.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
<template>
<div ref="modal" class="modal fade" tabindex="-1">
<div class="modal-dialog modal-xl modal-dialog-centered">
<div class="modal-content">
<div class="modal-header">
<h5 id="exampleModalLabel" class="modal-title">
adamhancock marked this conversation as resolved.
Show resolved Hide resolved
{{ $t("Browser Screenshot") }}
adamhancock marked this conversation as resolved.
Show resolved Hide resolved
</h5>
<button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close" />
</div>
<div class="modal-body"></div>
adamhancock marked this conversation as resolved.
Show resolved Hide resolved
<img :src="imageURL" alt="screenshot of the website">
</div>
</div>
</div>
</template>

<script lang="ts">
import { Modal } from "bootstrap";

export default {
props: {
imageURL: {
type: String,
required: true,
},
},
data() {
return {
modal: null,
};
},
mounted() {
this.modal = new Modal(this.$refs.modal);
},
methods: {
show() {
this.modal.show();
},
},
};
</script>

<style lang="scss" scoped>
@import "../assets/vars.scss";

.dark {
.modal-dialog .form-text, .modal-dialog p {
color: $dark-font-color;
}
}
</style>
15 changes: 13 additions & 2 deletions src/pages/Details.vue
Original file line number Diff line number Diff line change
Expand Up @@ -184,9 +184,10 @@
<!-- Screenshot -->
<div v-if="monitor.type === 'real-browser'" class="shadow-box">
<div class="row">
<div class="col-md-6">
<img :src="screenshotURL" alt style="width: 100%;">
<div class="col-md-6 zoom-cursor">
<img :src="screenshotURL" style="width: 100%;" alt="screenshot of the website" @click="showScreenshotDialog">
</div>
<ScreenshotDialog ref="screenshotDialog" :imageURL="screenshotURL" />
</div>
</div>

Expand Down Expand Up @@ -283,6 +284,7 @@ import "prismjs/components/prism-javascript";
import "prismjs/components/prism-css";
import { PrismEditor } from "vue-prism-editor";
import "vue-prism-editor/dist/prismeditor.min.css";
import ScreenshotDialog from "../components/ScreenshotDialog.vue";

export default {
components: {
Expand All @@ -297,6 +299,7 @@ export default {
Tag,
CertificateInfo,
PrismEditor,
ScreenshotDialog
},
data() {
return {
Expand Down Expand Up @@ -476,6 +479,14 @@ export default {
this.$refs.confirmDelete.show();
},

/**
* Show Screenshot Dialog
* @returns {void}
*/
showScreenshotDialog() {
this.$refs.screenshotDialog.show();
},

/**
* Show dialog to confirm clearing events
* @returns {void}
Expand Down
Loading