Open-Source API Development Ecosystem • https://hoppscotch.io • Offline, On-Prem & Cloud • Web, Desktop & CLI • Open-Source Alternative to Postman, Insomnia
TypeScript apiapi-clientapi-restapi-testingdeveloper-toolsgraphqlhttphttp-clientpwarestrest-apispatestingtesting-toolstoolsvuevuejswebsocket
refactor(ui): better color schemes and empty states
liyasthomase60e8545a176
diff --git a/assets/scss/styles.scss b/assets/scss/styles.scssindex 5ccd57cab..f2a2976a4 100644--- a/assets/scss/styles.scss+++ b/assets/scss/styles.scss@@ -167,7 +167,7 @@ hr {@apply truncate;@apply rounded;@apply text-xs;- @apply font-semibold font-mono;+ @apply font-semibold;@apply border border-divider;@apply transition;@apply focus:(outline-none border-accent);diff --git a/assets/scss/themes.scss b/assets/scss/themes.scssindex 33e0869fa..c6fb51eea 100644--- a/assets/scss/themes.scss+++ b/assets/scss/themes.scss@@ -8,7 +8,7 @@// Background color--primary-color: theme("colors.true-gray.900");// Light Background color- --primary-light-color: theme("colors.true-gray.800");+ --primary-light-color: theme("colors.dark.600");// Dark Background color--primary-dark-color: theme("colors.dark.900");// Text color@@ -18,11 +18,11 @@// Dark Text color--secondary-dark-color: theme("colors.true-gray.100");// Border color- --divider-color: theme("colors.true-gray.700");+ --divider-color: theme("colors.true-gray.800");// Light Border color- --divider-light-color: theme("colors.dark.600");+ --divider-light-color: theme("colors.dark.500");// Dark Border color- --divider-dark-color: theme("colors.dark.200");+ --divider-dark-color: theme("colors.dark.300");// Error color--error-color: theme("colors.dark.800");// Tooltip color@@ -35,25 +35,25 @@// Background color--primary-color: theme("colors.white");// Light Background color- --primary-light-color: theme("colors.true-gray.50");+ --primary-light-color: theme("colors.blue-gray.50");// Dark Background color- --primary-dark-color: theme("colors.true-gray.100");+ --primary-dark-color: theme("colors.blue-gray.100");// Text color- --secondary-color: theme("colors.true-gray.600");+ --secondary-color: theme("colors.blue-gray.600");// Light Text color- --secondary-light-color: theme("colors.true-gray.500");+ --secondary-light-color: theme("colors.blue-gray.500");// Dark Text color- --secondary-dark-color: theme("colors.true-gray.800");+ --secondary-dark-color: theme("colors.blue-gray.700");// Border color- --divider-color: theme("colors.true-gray.200");+ --divider-color: theme("colors.blue-gray.200");// Light Border color- --divider-light-color: theme("colors.true-gray.100");+ --divider-light-color: theme("colors.blue-gray.100");// Dark Border color- --divider-dark-color: theme("colors.true-gray.300");+ --divider-dark-color: theme("colors.blue-gray.300");// Error color- --error-color: theme("colors.true-gray.700");+ --error-color: theme("colors.blue-gray.700");// Tooltip color- --tooltip-color: theme("colors.true-gray.800");+ --tooltip-color: theme("colors.blue-gray.800");// Editor theme--editor-theme: "textmate";}@@ -62,9 +62,9 @@// Background color--primary-color: theme("colors.dark.900");// Light Background color- --primary-light-color: theme("colors.dark.800");+ --primary-light-color: theme("colors.true-gray.900");// Dark Background color- --primary-dark-color: theme("colors.true-gray.900");+ --primary-dark-color: theme("colors.dark.800");// Text color--secondary-color: theme("colors.true-gray.400");// Light Text color@@ -74,9 +74,9 @@// Border color--divider-color: theme("colors.true-gray.800");// Light Border color- --divider-light-color: theme("colors.true-gray.900");+ --divider-light-color: theme("colors.dark.700");// Dark Border color- --divider-dark-color: theme("colors.dark.200");+ --divider-dark-color: theme("colors.dark.300");// Error color--error-color: theme("colors.dark.800");// Tooltip colordiff --git a/components/app/Shortcuts.vue b/components/app/Shortcuts.vueindex 8a39eafb1..063517ef4 100644--- a/components/app/Shortcuts.vue+++ b/components/app/Shortcuts.vue@@ -20,25 +20,14 @@<ButtonSecondary icon="close" @click.native="close()" /></div></div>- <div class="search-wrapper">+ <!-- <div class="search-wrapper"><inputv-model="filterText"type="search"- class="- bg-primaryLight- border-b border-dividerLight- flex- font-semibold font-mono- w-full- py-2- pr-2- pl-8- focus:outline-none- truncate- "+ class="bg-primaryLight border-b border-dividerLight flex font-semibold font-mono w-full py-2 pr-2 pl-8 focus:outline-none truncate":placeholder="$t('search')"/>- </div>+ </div> --><divclass="divide-y divide-dividerLight@@ -52,7 +41,7 @@:key="`map-${mapIndex}`"class="space-y-4 p-4">- <h5 class="font-bold text-secondaryDark text-base">+ <h5 class="font-bold text-secondaryDark text-sm">{{ map.section }}</h5><div@@ -66,7 +55,7 @@<spanv-for="(key, keyIndex) in shortcut.keys":key="`map-${mapIndex}-shortcut-${shortcutIndex}-key-${keyIndex}`"- class="bg-dividerLight rounded ml-1 py-1 px-2 inline-flex"+ class="shortcut-key">{{ key }}</span>@@ -78,7 +67,10 @@</template><script>-import { getPlatformSpecialKey } from "~/helpers/platformutils"+import {+ getPlatformSpecialKey,+ getPlatformAlternateKey,+} from "~/helpers/platformutils"export default {props: {@@ -92,19 +84,19 @@ export default {section: "General",shortcuts: [{- keys: [this.getSpecialKey(), "G"],+ keys: [getPlatformSpecialKey(), "G"],label: this.$t("send_request"),},{- keys: [this.getSpecialKey(), "S"],+ keys: [getPlatformSpecialKey(), "S"],label: this.$t("save_to_collections"),},{- keys: [this.getSpecialKey(), "K"],+ keys: [getPlatformSpecialKey(), "K"],label: this.$t("copy_request_link"),},{- keys: [this.getSpecialKey(), "I"],+ keys: [getPlatformSpecialKey(), "I"],label: this.$t("reset_request"),},],@@ -113,31 +105,31 @@ export default {section: "Request",shortcuts: [{- keys: ["Alt", "↑"],+ keys: [getPlatformAlternateKey(), "↑"],label: this.$t("select_next_method"),},{- keys: ["Alt", "↓"],+ keys: [getPlatformAlternateKey(), "↓"],label: this.$t("select_previous_method"),},{- keys: ["Alt", "G"],+ keys: [getPlatformAlternateKey(), "G"],label: this.$t("select_get_method"),},{- keys: ["Alt", "H"],+ keys: [getPlatformAlternateKey(), "H"],label: this.$t("select_head_method"),},{- keys: ["Alt", "P"],+ keys: [getPlatformAlternateKey(), "P"],label: this.$t("select_post_method"),},{- keys: ["Alt", "U"],+ keys: [getPlatformAlternateKey(), "U"],label: this.$t("select_put_method"),},{- keys: ["Alt", "X"],+ keys: [getPlatformAlternateKey(), "X"],label: this.$t("select_delete_method"),},],@@ -151,10 +143,20 @@ export default {},},methods: {- getSpecialKey: getPlatformSpecialKey,close() {this.$emit("close")},},}</script>++<style lang="scss" scoped>+.shortcut-key {+ @apply bg-dividerLight;+ @apply rounded;+ @apply ml-2;+ @apply py-1;+ @apply px-2;+ @apply inline-flex;+}+</style>diff --git a/components/collections/graphql/index.vue b/components/collections/graphql/index.vueindex 46035345b..a258d4ef1 100644--- a/components/collections/graphql/index.vue+++ b/components/collections/graphql/index.vue@@ -7,9 +7,8 @@class="flex flex-col top-8 z-10 sticky":class="{ 'bg-primary': !savingMode }">- <div class="search-wrapper">+ <div v-if="showCollActions" class="search-wrapper"><input- v-if="showCollActions"v-model="filterText"type="search":placeholder="$t('search')"diff --git a/components/collections/index.vue b/components/collections/index.vueindex 457491576..2d7521ffe 100644--- a/components/collections/index.vue+++ b/components/collections/index.vue@@ -7,9 +7,8 @@class="bg-primary rounded-t flex flex-col top-0 z-10 sticky":class="{ '!top-8': !saveRequest && !doc }">- <div class="search-wrapper">+ <div v-if="!saveRequest" class="search-wrapper"><input- v-if="!saveRequest"v-model="filterText"type="search":placeholder="$t('search')"diff --git a/components/docs/Request.vue b/components/docs/Request.vueindex 6c8cd403c..7421e7796 100644--- a/components/docs/Request.vue+++ b/components/docs/Request.vue@@ -137,7 +137,7 @@ export default {@apply p-4;@apply m-0;@apply text-secondaryLight;- @apply border-b border-dashed border-divider;+ @apply border-b border-divider;&:last-child {@apply border-b-0;diff --git a/components/environments/Edit.vue b/components/environments/Edit.vueindex f4dfc5fd7..ee6920197 100644--- a/components/environments/Edit.vue+++ b/components/environments/Edit.vue@@ -43,8 +43,8 @@v-for="(variable, index) in vars":key="`variable-${index}`"class="- divide-x divide-dashed divide-divider- border-b border-dashed border-divider+ divide-x divide-dividerLight+ border-b border-dividerLightflex":class="{ 'border-t': index == 0 }"diff --git a/components/firebase/Login.vue b/components/firebase/Login.vueindex c0ed2b23a..bac8709b8 100644--- a/components/firebase/Login.vue+++ b/components/firebase/Login.vue@@ -27,17 +27,17 @@/></div><div v-if="mode === 'email'" class="flex flex-col space-y-2">- <div class="flex items-center">- <label for="email" class="flex px-4 items-center">+ <div class="flex relative items-center">+ <label for="email" class="flex px-4 absolute items-center"><i class="opacity-75 material-icons">mail</i></label><inputid="email"v-model="form.email"- class="rounded flex outline-none flex-1 py-2 px-4"+ class="input !pl-12"type="email"name="email"- placeholder="enter your email"+ :placeholder="$t('email')"autocomplete="email"requiredspellcheck="false"@@ -62,7 +62,9 @@</div><div v-if="mode === 'email-sent'" class="flex flex-col px-4"><div class="flex flex-col max-w-md justify-center items-center">- <i class="text-accent text-4xl material-icons"> verified </i>+ <i class="text-accent material-icons !text-4xl">+ mark_email_unread+ </i><h3 class="font-bold my-2 text-center text-lg">{{ $t("we_sent_magic_link") }}</h3>diff --git a/components/http/BodyParameters.vue b/components/http/BodyParameters.vueindex ec5bd3f74..4d6fe675b 100644--- a/components/http/BodyParameters.vue+++ b/components/http/BodyParameters.vue@@ -28,11 +28,7 @@<divv-for="(param, index) in bodyParams":key="`param-${index}`"- class="- divide-x divide-dashed divide-divider- border-b border-dashed border-divider- flex- "+ class="divide-x divide-dividerLight border-b border-dividerLight flex":class="{ 'border-t': index == 0 }"><inputdiff --git a/components/http/Headers.vue b/components/http/Headers.vueindex 6c84f3618..770a4ac8a 100644--- a/components/http/Headers.vue+++ b/components/http/Headers.vue@@ -34,11 +34,7 @@<divv-for="(header, index) in headers$":key="`header-${index}`"- class="- divide-x divide-dashed divide-divider- border-b border-dashed border-divider- flex- "+ class="divide-x divide-dividerLight border-b border-dividerLight flex":class="{ 'border-t': index == 0 }"><SmartAutoComplete@@ -113,6 +109,15 @@/></div></div>+ <div+ v-if="headers$.length === 0"+ class="flex flex-col text-secondaryLight p-4 items-center justify-center"+ >+ <i class="opacity-75 pb-2 material-icons">post_add</i>+ <span class="text-center">+ {{ $t("headers_empty") }}+ </span>+ </div></AppSection></template>diff --git a/components/http/Parameters.vue b/components/http/Parameters.vueindex 820ffd5fa..dadd09965 100644--- a/components/http/Parameters.vue+++ b/components/http/Parameters.vue@@ -34,11 +34,7 @@<divv-for="(param, index) in params$":key="`param-${index}`"- class="- divide-x divide-dashed divide-divider- border-b border-dashed border-divider- flex- "+ class="divide-x divide-dividerLight border-b border-dividerLight flex":class="{ 'border-t': index == 0 }"><input@@ -121,6 +117,15 @@/></div></div>+ <div+ v-if="params$.length === 0"+ class="flex flex-col text-secondaryLight p-4 items-center justify-center"+ >+ <i class="opacity-75 pb-2 material-icons">post_add</i>+ <span class="text-center">+ {{ $t("parameters_empty") }}+ </span>+ </div></AppSection></template>diff --git a/components/realtime/Websocket.vue b/components/realtime/Websocket.vueindex 3a8cee05c..136c58662 100644--- a/components/realtime/Websocket.vue+++ b/components/realtime/Websocket.vue@@ -76,8 +76,8 @@v-for="(protocol, index) of protocols":key="`protocol-${index}`"class="- divide-x divide-dashed divide-divider- border-b border-dashed border-divider+ divide-x divide-dividerLight+ border-b border-dividerLightflex":class="{ 'border-t': index == 0 }"diff --git a/components/smart/AceEditor.vue b/components/smart/AceEditor.vueindex 08c9c69d2..7fb2adc59 100644--- a/components/smart/AceEditor.vue+++ b/components/smart/AceEditor.vue@@ -9,7 +9,6 @@flex flex-nowrapfont-monoflex-1- shadow-lgpy-1px-4bottom-0diff --git a/components/teams/Edit.vue b/components/teams/Edit.vueindex 1b5e2b65c..4aff70af1 100644--- a/components/teams/Edit.vue+++ b/components/teams/Edit.vue@@ -25,7 +25,7 @@:key="`member-${index}`"class="divide-y divide-dashed divide-divider- border-b border-dashed border-divider+ border-b border-dividermd:divide-x md:divide-y-0":class="{ 'border-t': index == 0 }"@@ -104,7 +104,7 @@:key="`member-${index}`"class="divide-y divide-dashed divide-divider- border-b border-dashed border-divider+ border-b border-dividermd:divide-x md:divide-y-0">diff --git a/helpers/platformutils.js b/helpers/platformutils.jsindex 8c285c1d5..0cc1d6917 100644--- a/helpers/platformutils.js+++ b/helpers/platformutils.js@@ -1,3 +1,7 @@export function getPlatformSpecialKey() {return /(Mac|iPhone|iPod|iPad)/i.test(navigator.platform) ? "⌘" : "Ctrl"}++export function getPlatformAlternateKey() {+ return /(Mac|iPhone|iPod|iPad)/i.test(navigator.platform) ? "⌥" : "Alt"+}diff --git a/lang/en-US.json b/lang/en-US.jsonindex 164a67734..15e371809 100644--- a/lang/en-US.json+++ b/lang/en-US.json@@ -165,7 +165,6 @@"log": "Log","no_url": "No URL","run": "Run",- "copy": "Copy Query","loading": "Loading...","fetching": "Fetching...","waiting_send_req": "Waiting to send request",@@ -192,10 +191,6 @@"import_json": "Import from JSON","download_file": "Download file","upload_file": "Upload file",- "copy": "Copy response",- "copy": "Copy code",- "copy": "Copy schema",- "copy": "Copy variables","use_request": "Use request","documentation": "Documentation","docs": "Docs",@@ -355,5 +350,7 @@"zen_mode": "Zen mode","notifications": "Notifications","connect_graphql_endpoint": "Connect to a GraphQL endpoint",- "copy": "Copy"+ "copy": "Copy",+ "parameters_empty": "Parameters are empty",+ "headers_empty": "Headers are empty"}diff --git a/pages/graphql.vue b/pages/graphql.vueindex f6dff6d99..ca4772d09 100644--- a/pages/graphql.vue+++ b/pages/graphql.vue@@ -193,8 +193,8 @@v-for="(header, index) in headers":key="`header-${index}`"class="- divide-x divide-dashed divide-divider- border-b border-dashed border-divider+ divide-x divide-dividerLight+ border-b border-dividerLightflex":class="{ 'border-t': index == 0 }"@@ -271,6 +271,21 @@/></div></div>+ <div+ v-if="headers.length === 0"+ class="+ flex flex-col+ text-secondaryLight+ p-4+ items-center+ justify-center+ "+ >+ <i class="opacity-75 pb-2 material-icons">post_add</i>+ <span class="text-center">+ {{ $t("headers_empty") }}+ </span>+ </div></AppSection></SmartTab></SmartTabs>