(design) delete min-height

This commit is contained in:
kakkokari-gtyih 2023-04-06 09:11:35 +09:00
parent 67d24ab548
commit e4762b4b85
4 changed files with 58 additions and 37 deletions

View File

@ -11,6 +11,7 @@ import { url } from '@/config';
import { popout as popout_ } from '@/scripts/popout'; import { popout as popout_ } from '@/scripts/popout';
import { i18n } from '@/i18n'; import { i18n } from '@/i18n';
import { useRouter } from '@/router'; import { useRouter } from '@/router';
import { MenuItem } from '@/types/menu';
const props = withDefaults(defineProps<{ const props = withDefaults(defineProps<{
to: string; to: string;
@ -33,37 +34,60 @@ const active = $computed(() => {
return resolved.route.name === router.currentRoute.value.name; return resolved.route.name === router.currentRoute.value.name;
}); });
function onContextmenu(ev) { function onContextmenu(ev : Event) {
const selection = window.getSelection(); const selection = window.getSelection();
if (selection && selection.toString() !== '') return; if ((selection && selection.toString() !== '')) return;
os.contextMenu([{
type: 'label', let contextMenuItem: MenuItem[] = [];
text: props.to,
}, { if (router.currentRoute.value.name?.toLowerCase().includes("embed")) {
icon: 'ti ti-app-window', contextMenuItem = [{
text: i18n.ts.openInWindow, type: 'label',
action: () => { text: props.to,
os.pageWindow(props.to); }, {
}, icon: 'ti ti-external-link',
}, { text: i18n.ts.openInNewTab,
icon: 'ti ti-player-eject', action: () => {
text: i18n.ts.showInPage, window.open(props.to, '_blank');
action: () => { },
router.push(props.to, 'forcePage'); }, {
}, icon: 'ti ti-link',
}, null, { text: i18n.ts.copyLink,
icon: 'ti ti-external-link', action: () => {
text: i18n.ts.openInNewTab, copyToClipboard(`${url}${props.to}`);
action: () => { },
window.open(props.to, '_blank'); }];
}, } else {
}, { contextMenuItem = [{
icon: 'ti ti-link', type: 'label',
text: i18n.ts.copyLink, text: props.to,
action: () => { }, {
copyToClipboard(`${url}${props.to}`); icon: 'ti ti-app-window',
}, text: i18n.ts.openInWindow,
}], ev); action: () => {
os.pageWindow(props.to);
},
}, {
icon: 'ti ti-player-eject',
text: i18n.ts.showInPage,
action: () => {
router.push(props.to, 'forcePage');
},
}, null, {
icon: 'ti ti-external-link',
text: i18n.ts.openInNewTab,
action: () => {
window.open(props.to, '_blank');
},
}, {
icon: 'ti ti-link',
text: i18n.ts.copyLink,
action: () => {
copyToClipboard(`${url}${props.to}`);
},
}];
}
os.contextMenu(contextMenuItem, ev);
} }
function openWindow() { function openWindow() {

View File

@ -93,7 +93,9 @@ definePageMetadata(computed(() => note ? {
} }
.fcuexfpr { .fcuexfpr {
background: var(--bg); border-radius: var(--radius);
border: 1px solid var(--divider);
background: var(--panel);
> .note { > .note {
height: 100%; height: 100%;

View File

@ -20,7 +20,7 @@ export function getEmbedCode(props: {
if (src !== undefined) { if (src !== undefined) {
const id = uuid(); const id = uuid();
return `<iframe src="${src}" title="Misskey Note" style="border:none; width:100%; max-width: 650px; min-height: 300px;" data-msky-embed="${id}"></iframe> return `<iframe src="${src}" title="Misskey Embed" style="border:none; width:100%; max-width: 650px; min-height: 300px;" data-msky-embed="${id}"></iframe>
<script src="https://cdn.jsdelivr.net/npm/iframe-resizer@4.3.6/js/iframeResizer.min.js" integrity="sha256-86F9vrEnnd2apFWVo5sNxArab6T8L048fPPkYONBDHY=" crossorigin="anonymous"></script> <script src="https://cdn.jsdelivr.net/npm/iframe-resizer@4.3.6/js/iframeResizer.min.js" integrity="sha256-86F9vrEnnd2apFWVo5sNxArab6T8L048fPPkYONBDHY=" crossorigin="anonymous"></script>
<script>iFrameResize({}, 'iframe[data-msky-embed="${id}"]');</script>`; <script>iFrameResize({}, 'iframe[data-msky-embed="${id}"]');</script>`;
} }

View File

@ -31,17 +31,12 @@ provideMetadataReceiver((info) => {
document.documentElement.style.backgroundColor = "transparent"; document.documentElement.style.backgroundColor = "transparent";
document.documentElement.style.maxWidth = "650px"; document.documentElement.style.maxWidth = "650px";
document.documentElement.style.minHeight = "300px";
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
.mk-app { .mk-app {
max-width: 650px; max-width: 650px;
min-width: 0; min-width: 0;
min-height: 300px;
overflow: hidden;
border-radius: var(--radius);
border: 1px solid var(--divider);
box-sizing: border-box; box-sizing: border-box;
background-color: transparent; background-color: transparent;
} }