Spaces:
Running
Running
File size: 6,522 Bytes
430354e | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 | <html>
<head>
<script type="module">
import { store as modelGateStore } from "/components/chat/model-gate-store.js";
</script>
</head>
<body>
<div x-data>
<template x-if="$store.modelGate">
<section class="model-gate" x-create="$store.modelGate.onCardCreate()">
<template x-if="$store.modelGate.connected">
<div class="model-gate-chip">
<x-icon aria-hidden="true" name="check_circle"></x-icon>
<span x-text="$store.modelGate.introText"></span>
</div>
</template>
<template x-if="!$store.modelGate.connected">
<div class="model-gate-body">
<p class="model-gate-intro" x-text="$store.modelGate.introText"></p>
<div class="model-gate-card">
<div class="model-gate-fork is-single" x-show="$store.modelGate.accountConnected">
<button type="button"
class="model-gate-option"
@click="$store.modelGate.openAdvancedModelConfiguration()">
<span class="model-gate-option-title">
<x-icon aria-hidden="true" name="tune"></x-icon>
<span>Choose models</span>
</span>
<span class="model-gate-option-sub">Select Main and Utility models</span>
</button>
</div>
<div class="model-gate-fork" x-show="!$store.modelGate.accountConnected">
<button type="button"
class="model-gate-option"
:class="{ selected: $store.modelGate.choice === 'cloud' }"
@click="$store.modelGate.openOnboarding('cloud')">
<span class="model-gate-option-title">
<x-icon aria-hidden="true" name="cloud"></x-icon>
<span>Cloud provider</span>
</span>
<span class="model-gate-option-sub">Connect with an API key</span>
</button>
<button type="button"
class="model-gate-option"
:class="{ selected: $store.modelGate.choice === 'account' }"
@click="$store.modelGate.openOnboarding('account')">
<span class="model-gate-option-title">
<x-icon aria-hidden="true" name="account_circle"></x-icon>
<span>AI account</span>
</span>
<span class="model-gate-option-sub">Codex, Copilot, Gemini, Grok</span>
</button>
<button type="button"
class="model-gate-option"
:class="{ selected: $store.modelGate.choice === 'local' }"
@click="$store.modelGate.openOnboarding('local')">
<span class="model-gate-option-title">
<x-icon aria-hidden="true" name="memory"></x-icon>
<span>Local model</span>
</span>
<span class="model-gate-option-sub">Runs on your machine</span>
</button>
</div>
</div>
<p class="model-gate-footnote">
<span>Your message sends automatically once a model is connected.</span>
<button type="button" @click="$store.modelGate.openAdvancedModelConfiguration()">Advanced model configuration</button>
</p>
</div>
</template>
</section>
</template>
</div>
<style>
.model-gate {
width: min(100%, 36rem);
color: var(--color-text);
font-family: var(--font-family-main, "Rubik", Arial, Helvetica, sans-serif);
}
.model-gate-body {
display: grid;
gap: 0.65rem;
container-type: inline-size;
}
.model-gate-intro {
margin: 0;
color: color-mix(in srgb, var(--color-text) 84%, transparent);
line-height: 1.45;
}
.model-gate-card {
display: grid;
gap: 0.75rem;
}
.model-gate-fork {
display: flex;
gap: 0.6rem;
}
.model-gate-fork .model-gate-option {
flex: 1 1 0;
min-width: 0;
}
@container (max-width: 30rem) {
.model-gate-fork {
flex-direction: column;
}
}
.model-gate-option {
border: 1px solid color-mix(in srgb, var(--color-border) 76%, transparent);
border-radius: 8px;
background: color-mix(in srgb, var(--color-background) 52%, transparent);
color: inherit;
font: inherit;
text-align: left;
cursor: pointer;
}
.model-gate-option {
display: grid;
gap: 0.25rem;
padding: 0.72rem;
}
.model-gate-option:hover,
.model-gate-option:focus-visible,
.model-gate-option.selected {
border-color: color-mix(in srgb, var(--color-border) 86%, var(--color-text) 14%);
background: color-mix(in srgb, var(--color-background-hover) 60%, var(--color-panel));
outline: none;
}
.model-gate-option-title {
display: inline-flex;
align-items: center;
gap: 0.4rem;
font-weight: 560;
}
.model-gate-option-title .material-symbols-outlined {
font-size: 1.15rem;
color: color-mix(in srgb, var(--color-text) 72%, transparent);
}
.model-gate-option-sub,
.model-gate-footnote {
color: color-mix(in srgb, var(--color-text) 58%, transparent);
font-size: 0.78rem;
line-height: 1.35;
}
.model-gate-footnote {
display: flex;
align-items: center;
justify-content: space-between;
gap: 0.7rem;
flex-wrap: wrap;
}
.model-gate-footnote button {
border: 0;
background: transparent;
color: color-mix(in srgb, #6f8cff 82%, var(--color-text));
font: inherit;
font-size: 0.8rem;
cursor: pointer;
padding: 0;
}
.model-gate-chip {
display: inline-flex;
align-items: center;
gap: 0.4rem;
border: 1px solid color-mix(in srgb, #7bc995 44%, var(--color-border));
border-radius: 999px;
padding: 0.35rem 0.65rem;
color: color-mix(in srgb, var(--color-text) 88%, #7bc995);
background: color-mix(in srgb, #7bc995 10%, var(--color-panel));
font-size: 0.84rem;
}
.model-gate-chip .material-symbols-outlined {
font-size: 1rem;
}
@media (max-width: 480px) {
.model-gate-fork {
flex-direction: column;
}
}
</style>
</body>
</html>
|