Mistral Chat optimized & customizable for wide screens

Mistral Chat website interface is reworked to offer a cleaner and comfortable experience on desktop, with visual adjustments that adapt to your needs.

이 스크립트를 설치하려면 Tampermonkey, Greasemonkey 또는 Violentmonkey와 같은 확장 프로그램이 필요합니다.

이 스크립트를 설치하려면 Tampermonkey와 같은 확장 프로그램을 설치해야 합니다.

이 스크립트를 설치하려면 Tampermonkey 또는 Violentmonkey와 같은 확장 프로그램이 필요합니다.

이 스크립트를 설치하려면 Tampermonkey 또는 Userscripts와 같은 확장 프로그램이 필요합니다.

이 스크립트를 설치하려면 Tampermonkey와 같은 확장 프로그램이 필요합니다.

이 스크립트를 설치하려면 유저 스크립트 관리자 확장 프로그램이 필요합니다.

(이미 유저 스크립트 관리자가 설치되어 있습니다. 설치를 진행합니다!)

이 스타일을 설치하려면 Stylus와 같은 확장 프로그램이 필요합니다.

이 스타일을 설치하려면 Stylus와 같은 확장 프로그램이 필요합니다.

이 스타일을 설치하려면 Stylus와 같은 확장 프로그램이 필요합니다.

이 스타일을 설치하려면 유저 스타일 관리자 확장 프로그램이 필요합니다.

이 스타일을 설치하려면 유저 스타일 관리자 확장 프로그램이 필요합니다.

이 스타일을 설치하려면 유저 스타일 관리자 확장 프로그램이 필요합니다.

(이미 유저 스타일 관리자가 설치되어 있습니다. 설치를 진행합니다!)

/* ==UserStyle==
@name           Mistral Chat optimized & customizable for wide screens
@description    Mistral Chat website interface is reworked to offer a cleaner and comfortable experience on desktop, with visual adjustments that adapt to your needs.
@version        1.0.24
@author         BreatFR (https://breat.fr)
@namespace      https://breat.fr
@homepageURL    https://usercssjs.breat.fr/m/mistral-chat
@supportURL     https://discord.gg/W7FKesJ9aG
@license        AGPL-3.0-or-later; https://www.gnu.org/licenses/agpl-3.0.txt
@preprocessor   stylus

@var    checkbox    chatmode                "Chat mode"                             1
@var    checkbox    avatar                  "Custom avatar for us"                  0
@var    text        avatarurl               "Custom avatar URL"                     "URL between quotes"
@var    checkbox    cmmistralavatar         "Custom Mistral avatar"                 0
@var    text        cmmistralavatarurl      "Custom Mistral avatar URL"             "URL between quotes"
@var    text        cmmistralavatarsize     "Custom Mistral avatar size"            calc(100vh - 64px - 124px - 3em)
@var    text        cmmistralavatarcorner   "Custom Mistral avatar corner"          50%
@var    text        fontsize                "Custom font size"                      1.2rem
@var    checkbox    hidepro                 "Hide pro"                              1
@var    checkbox    widemode                "Wide mode"                             1
==/UserStyle== */

/* ==Credits==
Website         https://breat.fr
Bluesky			https://bsky.app/profile/breatfroff.bsky.social
facebook        https://www.facebook.com/breatfroff
mastodon        https://mastodon.social/@breat_fr
telegram        https://t.me/breatfr
vk              https://vk.com/breatfroff
X (twitter)     https://x.com/breatfroff
==/Credits== */

/* ==Support==
brave Creators  https://publishers.basicattentiontoken.org/c/breatfr
Buy me a coffee https://buymeacoffee.com/breatfr
ko-fi           https://ko-fi.com/breatfr
PayPal          https://paypal.me/breat
==/Support== */

@-moz-document domain("chat.mistral.ai") {
    /* Mistral Chat */
    /* Versions */
    :root {
        --themeversion: 'Theme v1.0.24 by BreatFR (https://breat.fr)';
        --install: ' usercssjs.breat.fr/m/mistral-chat';
		--help: ' discord.gg/W7FKesJ9aG';
        --support1: ' ko-fi.com/breatfr ';
        --support2: ' paypal.me/breat';
    }

	@media screen and (min-width: 900px) {
		body::after,
		body::before {
			background: linear-gradient(88.55deg, rgb(253, 73, 2) 22.43%, rgb(254, 206, 0) 92.28%);
            background-clip: text;
            color: transparent;
			display: block;
            font-family: inherit;
            font-size: 1.2rem;
			line-height: calc(64px / 2);
            pointer-events: none;
            position: absolute;
            text-align: center;
			top: 0;
			transition: left .5s ease;
            width: auto;
            white-space: pre-line;
            z-index: 9999;
		}
        html:has([data-state="collapsed"] > div > [data-sidebar="sidebar"]) body::after {
            content: var(--themeversion) '\A Help: ' url("https://code.breat.fr/share/images/icons/discord.png") var(--help);
			left: 20%;
        }
        html:has([data-state="expanded"] > div > [data-sidebar="sidebar"]) body::after {
            content: var(--themeversion) '\A Help: ' url("https://code.breat.fr/share/images/icons/discord.png") var(--help);
			left: 25%;
        }
		body::before {
            content: 'Install & Infos: ' url("https://code.breat.fr/share/images/icons/breat.fr.png") var(--install) '\A Support me: ' url("https://code.breat.fr/share/images/icons/ko-fi.png") var(--support1) ' · ' url("https://code.breat.fr/share/images/icons/paypal.png") var(--support2);
            right: 15%;
        }
    }

    body {
		height: 100vh;
        max-height: 100vh;
        overflow: hidden;
    }

    /* Textarea focused */
    body:has(.ProseMirror:focus) {
        [class="relative w-full overflow-hidden rounded-[12px] bg-card transition-colors duration-300 ease-in-out"] {
            border-radius: calc(var(--radius) + 4px);
            box-shadow: rgba(255, 149, 0, 0.4) -2px -2px 2px 2px,
                        rgba(255, 149, 0, 0.4) -2px 2px 2px 2px,
                        rgba(255, 69, 0, 0.4) 2px -2px 2px 2px,
                        rgba(255, 69, 0, 0.4) 2px 2px 2px 2px;
        }
    }

    /* Custom font size */
    [data-message-author-role="user"],
	[data-message-part-type="answer"],
    code,
    textarea,
    .max-w-screen-md:has(textarea) button {
        font-size: fontsize !important;
        line-height: 1.5 !important;
    }
    textarea.py-2 {
        min-height: max-content !important;
    }

    if avatar {
        [class="flex w-full flex-row items-center justify-start gap-x-4"] > div:nth-of-type(1) {
            background: url(avatarurl) no-repeat center center / cover;
            border-radius: 50%;
			color: transparent;
            content: "";
            display: inline-block;
            height: 32px;
            width: 32px;
        }
    }

    if cmmistralavatar {
        /* Avatar new chat */
        [class="absolute bottom-[65%] flex w-full justify-center desktop-mac:drag"] {
            bottom: auto;
            max-width: 100%;
            top: 0px;
        }
        [class="absolute bottom-[65%] flex w-full justify-center desktop-mac:drag"] {
            height: auto;
            margin: 0;
            max-height: calc(100vh - 64px - 163.56px - .5rem) !important;
            overflow: hidden;
            position: absolute;
        }
        [class="absolute bottom-[65%] flex w-full justify-center desktop-mac:drag"] svg {
            aspect-ratio: 1 / 1;
            background: url(cmmistralavatarurl) no-repeat center center;
            background-size: cover;
            border-radius: cmmistralavatarcorner;
            height: 0;
            margin: 0 auto;
            padding-left: cmmistralavatarsize;
            padding-top: cmmistralavatarsize;
            width: 0;
        }
        /* Textarea new chat */
        [class="absolute flex w-full max-w-(--breakpoint-md) flex-col px-2"] {
            bottom: 5em !important;
            top: auto !important;
        }

		/* Avatar menu */
		[class="flex h-8 w-8 shrink-0 items-center justify-center overflow-hidden rounded-sm bg-state-brand"] {
			aspect-ratio: 1 / 1;
            background: url(cmmistralavatarurl) no-repeat center center;
            background-size: cover;
            border-radius: cmmistralavatarcorner;
            height: 0;
            margin: 0 auto;
            padding-left: 32px;
            padding-top: 32px;
            width: 0;
		}
		[class*="flex aspect-square items-center justify-center rounded-sm text-xs font-semibold size-8 bg-brand-100/60 dark:bg-brand-900/60 text-brand-600"] > svg {
			display: none;
		}

		/* Avatar in textarea */
		[class="flex items-center justify-center bg-transparent"] {
			aspect-ratio: 1 / 1;
            background: url(cmmistralavatarurl) no-repeat center center / cover;
            border-radius: var(--radius-md);
            height: 0;
            padding-left: 36px;
            padding-top: 36px;
            width: 0;
        }

        /* Avatar in chat */
		[class="flex items-center justify-center bg-brand-500"] {
			background-color: transparent;
		}
        [class="flex items-center justify-center bg-brand-500"] {
            aspect-ratio: 1 / 1;
            background: url(cmmistralavatarurl) no-repeat center center / cover;
            border-radius: var(--radius-md);
            height: 0;
            padding-left: 20px;
            padding-top: 20px;
            width: 0;
        }
    }

    if chatmode {
        [data-message-author-role="assistant"],
 		[data-message-author-role="user"] {
            max-width: 80%;
        }
		[data-message-author-role="user"] {
			margin-left: auto;
		}
		[data-message-author-role="user"] [class="flex flex-shrink-1 flex-row flex-wrap items-start gap-2 pb-1"] {
			justify-content: space-evenly;
		}
        code[style*="white-space: pre"],
        code[style*="white-space:pre"] {
            white-space: break-spaces !important;
        }
    }

    if hidepro {
        [data-sidebar="menu"] > li:nth-of-type(3) {
            display: none;
        }
    }

    if widemode {
		data-radix-popper-content-wrapper > div {
			width: 100% !important;
		}
        .max-w-\\(--breakpoint-md\\) {
            max-width: 98%;
        }
        .max-h-\\[300px\\]:has(textarea) {
            max-height: 50vh !important;
        }
        .max-w-screen-md:has(textarea) {
            padding: 1em 1.75em;
        }

        /* Avatars */
        .h-7 {
            height: 32px;
        }
        .w-7 {
            width: 32px;
        }

        body:has(iframe[sandbox="allow-scripts allow-same-origin"]) {
            .cm-content {
                flex-shrink: 1;
            }
            .cm-line {
                white-space: wrap;
                width: 100% !important;
            }
        }

        /* Generated images */
        [class="group flex w-full gap-3"] > div:nth-of-type(2) p:has(img) {
            margin-left: auto;
            margin-right: auto;
        }

        /* Textarea box */
        [class="relative overflow-hidden mb-2 min-h-10 w-full"] {
            margin-bottom: 0 !important;
        }

        /* Scroll down icon */
        button:has(svg.lucide-arrow-down) {
            height: 40px;
            width: 40px;
        }
        svg.lucide-arrow-down path {
            stroke: rgb(255, 69, 0);
        }

        /* Small space between date and edit button */
        [aria-label="Edit question"] {
            margin-left: 1em !important;
        }

        /* Search box */
        div[role="dialog"][style="pointer-events: auto;"] {
            max-height: 90%;
            max-width: 90%;
        }
		[class="flex flex-col md:flex-row h-full max-h-[82vh] w-full max-w-[52rem] overflow-hidden"] {
			max-height: 100%;
			max-width: 100%;
		}

        /* Documentation et contact */
        [class="fixed right-3 bottom-3 z-40 hidden gap-2 sm:flex"],
        [class="fixed right-3 bottom-3 z-40 hidden gap-2 md:flex"],
        [class="fixed right-3 bottom-3 z-40 hidden gap-2 lg:flex"] {
            left: calc(var(--spacing)*3);
            right: auto;
        }

		[class="absolute flex w-full max-w-(--breakpoint-md) flex-col px-2"] {
			bottom: 2em !important;
			justify-content: flex-end;
			padding-right: 1.5em;
			top: auto !important;
		}

    }
}

@-moz-document domain("console.mistral.ai") {
    /* Mistral Console */
    button[class*="flex w-full items-center gap-3 rounded px-3 py-2"] > div:nth-of-type(1),
    .user-initials {
        background: transparent !important;
        color: transparent;
    }
    button[class*="flex w-full items-center gap-3 rounded px-3 py-2"] > div:nth-of-type(1)::before,
    .user-initials::before {
        background: url(avatarurl) no-repeat center center / cover;
        border-radius: 50%;
        content: "";
        display: inline-block;
        height: 32px;
        width: 32px;
    }
}