🎨 Major UI update

This commit is contained in:
Liyas Thomas
2019-09-17 13:43:12 +05:30
parent 945da8bf92
commit 42411038e4
8 changed files with 149 additions and 181 deletions

View File

@@ -20,6 +20,7 @@ $responsiveWidth: 720px;
::placeholder { ::placeholder {
color: var(--fg-color); color: var(--fg-color);
opacity: 0.3;
} }
* { * {
@@ -91,7 +92,7 @@ button {
justify-content: center; justify-content: center;
margin: 4px; margin: 4px;
padding: 8px 16px; padding: 8px 16px;
border-radius: 4px; border-radius: 8px;
background-color: var(--ac-color); background-color: var(--ac-color);
color: var(--act-color); color: var(--act-color);
font-weight: 700; font-weight: 700;
@@ -108,14 +109,13 @@ button {
&.icon { &.icon {
background-color: var(--bg-color); background-color: var(--bg-color);
color: var(--ac-color); color: var(--fg-color);
fill: var(--ac-color); fill: var(--fg-color);
} }
&:not([disabled]):hover, &:not([disabled]):hover,
&:not(.disabled):focus { &:not(.disabled):focus {
background-color: var(--bg-color); background-color: var(--bg-color);
box-shadow: inset 0 0 0 2px var(--ac-color);
color: var(--ac-color); color: var(--ac-color);
fill: var(--ac-color); fill: var(--ac-color);
} }
@@ -123,8 +123,9 @@ button {
fieldset { fieldset {
margin: 16px 0; margin: 16px 0;
border: 2px solid var(--fg-color); border: 1px solid var(--brd-color);
border-radius: 4px; border-radius: 8px;
background-color: var(--bg-color);
} }
legend { legend {
@@ -138,74 +139,38 @@ fieldset pre code {
resize: vertical; resize: vertical;
} }
fieldset.blue {
border-color: #57b5f9;
}
fieldset.blue legend { fieldset.blue legend {
color: #57b5f9; color: #57b5f9;
} }
fieldset.gray {
border-color: #bcc2cd;
}
fieldset.gray legend { fieldset.gray legend {
color: #bcc2cd; color: #bcc2cd;
} }
fieldset.green {
border-color: #50fa7b;
}
fieldset.green legend { fieldset.green legend {
color: #50fa7b; color: #50fa7b;
} }
fieldset.cyan {
border-color: #8be9fd;
}
fieldset.cyan legend { fieldset.cyan legend {
color: #8be9fd; color: #8be9fd;
} }
fieldset.purple {
border-color: #bd93f9;
}
fieldset.purple legend { fieldset.purple legend {
color: #bd93f9; color: #bd93f9;
} }
fieldset.orange {
border-color: #ffb86c;
}
fieldset.orange legend { fieldset.orange legend {
color: #ffb86c; color: #ffb86c;
} }
fieldset.pink {
border-color: #ff79c6;
}
fieldset.pink legend { fieldset.pink legend {
color: #ff79c6; color: #ff79c6;
} }
fieldset.red {
border-color: #ff5555;
}
fieldset.red legend { fieldset.red legend {
color: #ff5555; color: #ff5555;
} }
fieldset.yellow {
border-color: #f1fa8c;
}
fieldset.yellow legend { fieldset.yellow legend {
color: #f1fa8c; color: #f1fa8c;
} }
@@ -221,19 +186,19 @@ textarea,
pre { pre {
margin: 4px; margin: 4px;
padding: 8px; padding: 8px;
border-radius: 4px; border-radius: 8px;
width: calc(100% - 8px); width: calc(100% - 8px);
background-color: var(--bg-dark-color); background-color: var(--brd-color);
color: var(--fg-color); color: var(--fg-color);
font-size: 18px; font-size: 18px;
font-family: monospace; font-family: monospace;
transition: all 0.2s ease-in-out; transition: all 0.2s ease-in-out;
user-select: all; user-select: text;
&:not([readonly]):hover, &:not([readonly]):hover,
&:not([readonly]):focus { &:not([readonly]):focus {
background-color: var(--bg-color); background-color: var(--bg-color);
box-shadow: inset 0 0 0 2px var(--ac-color); box-shadow: inset 0 0 0 2px var(--fg-color);
} }
} }
@@ -247,7 +212,7 @@ code {
.hljs, .hljs,
.hljs-subst { .hljs-subst {
background-color: var(--bg-dark-color) !important; background-color: var(--brd-color) !important;
color: var(--fg-color) !important; color: var(--fg-color) !important;
} }
@@ -267,8 +232,8 @@ input[type="checkbox"] {
&:before { &:before {
content: "\2714"; content: "\2714";
border: 2px solid var(--fg-color); border: 1px solid var(--fg-color);
border-radius: 4px; border-radius: 8px;
display: inline-flex; display: inline-flex;
height: 16px; height: 16px;
width: 16px; width: 16px;
@@ -366,23 +331,23 @@ ol li {
} }
.info-response { .info-response {
background-color: #ffeb3b; color: #ffeb3b;
} }
.success-response { .success-response {
background-color: #4bb543; color: #4bb543;
} }
.redir-response { .redir-response {
background-color: #ff5722; color: #ff5722;
} }
.cl-error-response { .cl-error-response {
background-color: #a63232; color: #a63232;
} }
.sv-error-response { .sv-error-response {
background-color: #b71c1c; color: #b71c1c;
} }
.missing-data-response { .missing-data-response {
@@ -399,7 +364,7 @@ fieldset#history {
span { span {
position: absolute; position: absolute;
top: 44px; top: 12px;
right: 12px; right: 12px;
font-family: monospace, monospace; font-family: monospace, monospace;
} }
@@ -421,7 +386,7 @@ fieldset#history {
#response-details-wrapper { #response-details-wrapper {
position: relative; position: relative;
overflow: hidden; overflow: hidden;
border-radius: 4px; border-radius: 8px;
textarea { textarea {
margin: 0; margin: 0;
@@ -481,11 +446,12 @@ input[type="radio"] + label {
transition: all 0.2s ease; transition: all 0.2s ease;
&:hover { &:hover {
border-color: var(--err-color); border-color: var(--brd-color);
} }
} }
input[type="radio"]:checked + label { input[type="radio"]:checked + label {
color: var(--ac-color);
border-color: var(--ac-color); border-color: var(--ac-color);
} }

View File

@@ -7,17 +7,17 @@
// Dark is the default theme variant. // Dark is the default theme variant.
:root { :root {
--bg-dark-color: #44475a; --bg-dark-color: #1d1f27;
// Background color // Background color
--bg-color: #282a36; --bg-color: #282a36;
// Auto-complete color // Auto-complete color
--atc-color: #3C4556; --atc-color: #3C4556;
// Text color // Text color
--fg-color: #f8f8f2; --fg-color: #d0d1dc;
// Border color
--brd-color: #333545;
// Error color // Error color
--err-color: #3C4556; --err-color: #3C4556;
// Active color // Active color
--ac-color: #50fa7b; --ac-color: #50fa7b;
// Active text color // Active text color
@@ -32,10 +32,10 @@
--atc-color: #e1e4eb; --atc-color: #e1e4eb;
// Text color // Text color
--fg-color: #5d5d5f; --fg-color: #5d5d5f;
// Border color
--brd-color: #ccc;
// Error color // Error color
--err-color: invert(#3C4556, 1); --err-color: invert(#3C4556, 1);
// Active color // Active color
--ac-color: #57b5f9; --ac-color: #57b5f9;
// Active text color // Active text color

View File

@@ -2,43 +2,36 @@
<pw-section class="gray" label="History"> <pw-section class="gray" label="History">
<ul> <ul>
<li id="filter-history"> <li id="filter-history">
<label for="filter-history-input">Search</label> <input type="text" placeholder="search history" :readonly="history.length === 0 || isClearingHistory" v-model="filterText">
<input id="filter-history-input" type="text" placeholder="search history" :readonly="history.length === 0 || isClearingHistory" v-model="filterText">
</li> </li>
</ul> </ul>
<virtual-list class="virtual-list" :class="{filled: filteredHistory.length}" :size="89" :remain="Math.min(5, filteredHistory.length)"> <virtual-list class="virtual-list" :class="{filled: filteredHistory.length}" :size="54" :remain="Math.min(5, filteredHistory.length)">
<ul v-for="(entry, index) in filteredHistory" :key="index" class="entry"> <ul v-for="(entry, index) in filteredHistory" :key="index" class="entry">
<li> <li>
<label :for="'time#'+index">Time</label>
<input :id="'time#'+index" type="text" readonly :value="entry.time" :title="entry.date"> <input :id="'time#'+index" type="text" readonly :value="entry.time" :title="entry.date">
</li> </li>
<li class="method-list-item"> <li class="method-list-item">
<label :for="'time#'+index">Method</label>
<input :id="'method#'+index" type="text" readonly :value="entry.method" :class="findEntryStatus(entry).className" :style="{'--status-code': entry.status}"> <input :id="'method#'+index" type="text" readonly :value="entry.method" :class="findEntryStatus(entry).className" :style="{'--status-code': entry.status}">
<span class="entry-status-code">{{entry.status}}</span> <span class="entry-status-code" :class="findEntryStatus(entry).className" :style="{'--status-code': entry.status}">{{entry.status}}</span>
</li> </li>
<li> <li>
<label :for="'url#'+index">URL</label>
<input :id="'url#'+index" type="text" readonly :value="entry.url"> <input :id="'url#'+index" type="text" readonly :value="entry.url">
</li> </li>
<li> <li>
<label :for="'path#'+index">Path</label>
<input :id="'path#'+index" type="text" readonly :value="entry.path"> <input :id="'path#'+index" type="text" readonly :value="entry.path">
</li> </li>
<div class="show-on-small-screen"> <div class="show-on-small-screen">
<li> <li>
<label :for="'delete-button#'+index" class="hide-on-small-screen">&nbsp;</label>
<button class="icon" :id="'delete-button#'+index" :disabled="isClearingHistory" @click="deleteHistory(entry)"> <button class="icon" :id="'delete-button#'+index" :disabled="isClearingHistory" @click="deleteHistory(entry)">
<svg width="24" height="24" xmlns="http://www.w3.org/2000/svg" fill-rule="evenodd" clip-rule="evenodd"> <svg xmlns="http://www.w3.org/2000/svg" width="18" height="18" viewBox="0 0 24 24">
<path d="M19 24h-14c-1.104 0-2-.896-2-2v-17h-1v-2h6v-1.5c0-.827.673-1.5 1.5-1.5h5c.825 0 1.5.671 1.5 1.5v1.5h6v2h-1v17c0 1.104-.896 2-2 2zm0-19h-14v16.5c0 .276.224.5.5.5h13c.276 0 .5-.224.5-.5v-16.5zm-9 4c0-.552-.448-1-1-1s-1 .448-1 1v9c0 .552.448 1 1 1s1-.448 1-1v-9zm6 0c0-.552-.448-1-1-1s-1 .448-1 1v9c0 .552.448 1 1 1s1-.448 1-1v-9zm-2-7h-4v1h4v-1z"/> <path d="M5.633 22.031c1.135 1.313 3.735 1.969 6.334 1.969 2.601 0 5.199-.656 6.335-1.969.081-.404 3.698-18.468 3.698-18.882 0-2.473-7.338-3.149-10-3.149-4.992 0-10 1.242-10 3.144 0 .406 3.556 18.488 3.633 18.887zm6.418-16.884c-4.211 0-7.625-.746-7.625-1.667s3.414-1.667 7.625-1.667 7.624.746 7.624 1.667-3.413 1.667-7.624 1.667z"/>
</svg> </svg>
</button> </button>
</li> </li>
<li> <li>
<label :for="'use-button#'+index" class="hide-on-small-screen">&nbsp;</label>
<button class="icon" :id="'use-button#'+index" :disabled="isClearingHistory" @click="useHistory(entry)"> <button class="icon" :id="'use-button#'+index" :disabled="isClearingHistory" @click="useHistory(entry)">
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24"> <svg xmlns="http://www.w3.org/2000/svg" width="18" height="18" viewBox="0 0 24 24">
<path d="M14.078 7.061l2.861 2.862-10.799 10.798-3.584.723.724-3.585 10.798-10.798zm0-2.829l-12.64 12.64-1.438 7.128 7.127-1.438 12.642-12.64-5.691-5.69zm7.105 4.277l2.817-2.82-5.691-5.689-2.816 2.817 5.69 5.692z" /> <path d="M19.769 9.923l-12.642 12.639-7.127 1.438 1.438-7.128 12.641-12.64 5.69 5.691zm1.414-1.414l2.817-2.82-5.691-5.689-2.816 2.817 5.69 5.692z"/>
</svg> </svg>
</button> </button>
</li> </li>
@@ -52,16 +45,16 @@
</ul> </ul>
<ul> <ul>
<li v-if="!isClearingHistory"> <li v-if="!isClearingHistory">
<button id="clear-history-button" :disabled="history.length === 0" @click="enableHistoryClearing">Clear All</button> <button class="icon" id="clear-history-button" :disabled="history.length === 0" @click="enableHistoryClearing">Clear All</button>
</li> </li>
<li v-else> <li v-else>
<div class="flex-wrap"> <div class="flex-wrap">
<label for="clear-history-button">Are you sure?</label> <label for="clear-history-button">Are you sure?</label>
<div> <div>
<button id="confirm-clear-history-button" @click="clearHistory"> <button class="icon" id="confirm-clear-history-button" @click="clearHistory">
Yes Yes
</button> </button>
<button id="reject-clear-history-button" @click="disableHistoryClearing"> <button class="icon" id="reject-clear-history-button" @click="disableHistoryClearing">
No No
</button> </button>
</div> </div>
@@ -151,7 +144,7 @@
@media (max-width: 720px) { @media (max-width: 720px) {
.virtual-list.filled { .virtual-list.filled {
min-height: 380px; min-height: 200px;
} }
} }

View File

@@ -25,7 +25,7 @@
left: 0; left: 0;
width: 100%; width: 100%;
height: 100%; height: 100%;
background-color: rgba(0, 0, 0, 0.75); background-color: rgba(0, 0, 0, 0.5);
display: flex; display: flex;
align-items: center; align-items: center;
justify-content: center; justify-content: center;
@@ -48,8 +48,8 @@
padding: 12px; padding: 12px;
transition: all 0.2s ease; transition: all 0.2s ease;
background-color: var(--bg-color); background-color: var(--bg-color);
border: 2px solid var(--ac-color); border-radius: 8px;
border-radius: 4px; box-shadow: rgba(0, 0, 0, 0.5) 0px 16px 70px;
} }
/* /*

View File

@@ -15,7 +15,7 @@
padding: 8px 16px; padding: 8px 16px;
margin: 4px; margin: 4px;
background-color: rgba(93, 93, 93, 0.2); background-color: rgba(93, 93, 93, 0.2);
border-radius: 4px; border-radius: 8px;
cursor: pointer; cursor: pointer;
&.active { &.active {
@@ -65,4 +65,4 @@
} }
} }
} }
</script> </script>

View File

@@ -4,8 +4,7 @@
<div> <div>
<div class="slide-in"> <div class="slide-in">
<nuxt-link to="/"> <nuxt-link to="/">
<h1 class="logo"> <h1 class="logo"><logo alt="" style="height: 24px; margin-right: 16px"></logo>Postwoman</h1>
<logo alt="" style="height: 24px; margin-right: 16px" />Postwoman</h1>
</nuxt-link> </nuxt-link>
<h3>API request builder</h3> <h3>API request builder</h3>
</div> </div>
@@ -15,7 +14,7 @@
<nuxt-link to="/settings" aria-label="Settings"> <nuxt-link to="/settings" aria-label="Settings">
<!-- Settings cog --> <!-- Settings cog -->
<svg xmlns="http://www.w3.org/2000/svg" width="18" height="18" viewBox="0 0 24 24"> <svg xmlns="http://www.w3.org/2000/svg" width="18" height="18" viewBox="0 0 24 24">
<path d="M24 14.187v-4.374c-2.148-.766-2.726-.802-3.027-1.529-.303-.729.083-1.169 1.059-3.223l-3.093-3.093c-2.026.963-2.488 1.364-3.224 1.059-.727-.302-.768-.889-1.527-3.027h-4.375c-.764 2.144-.8 2.725-1.529 3.027-.752.313-1.203-.1-3.223-1.059l-3.093 3.093c.977 2.055 1.362 2.493 1.059 3.224-.302.727-.881.764-3.027 1.528v4.375c2.139.76 2.725.8 3.027 1.528.304.734-.081 1.167-1.059 3.223l3.093 3.093c1.999-.95 2.47-1.373 3.223-1.059.728.302.764.88 1.529 3.027h4.374c.758-2.131.799-2.723 1.537-3.031.745-.308 1.186.099 3.215 1.062l3.093-3.093c-.975-2.05-1.362-2.492-1.059-3.223.3-.726.88-.763 3.027-1.528zm-4.875.764c-.577 1.394-.068 2.458.488 3.578l-1.084 1.084c-1.093-.543-2.161-1.076-3.573-.49-1.396.581-1.79 1.693-2.188 2.877h-1.534c-.398-1.185-.791-2.297-2.183-2.875-1.419-.588-2.507-.045-3.579.488l-1.083-1.084c.557-1.118 1.066-2.18.487-3.58-.579-1.391-1.691-1.784-2.876-2.182v-1.533c1.185-.398 2.297-.791 2.875-2.184.578-1.394.068-2.459-.488-3.579l1.084-1.084c1.082.538 2.162 1.077 3.58.488 1.392-.577 1.785-1.69 2.183-2.875h1.534c.398 1.185.792 2.297 2.184 2.875 1.419.588 2.506.045 3.579-.488l1.084 1.084c-.556 1.121-1.065 2.187-.488 3.58.577 1.391 1.689 1.784 2.875 2.183v1.534c-1.188.398-2.302.791-2.877 2.183zm-7.125-5.951c1.654 0 3 1.346 3 3s-1.346 3-3 3-3-1.346-3-3 1.346-3 3-3zm0-2c-2.762 0-5 2.238-5 5s2.238 5 5 5 5-2.238 5-5-2.238-5-5-5z" /> <path d="M24 13.616v-3.232c-1.651-.587-2.694-.752-3.219-2.019v-.001c-.527-1.271.1-2.134.847-3.707l-2.285-2.285c-1.561.742-2.433 1.375-3.707.847h-.001c-1.269-.526-1.435-1.576-2.019-3.219h-3.232c-.582 1.635-.749 2.692-2.019 3.219h-.001c-1.271.528-2.132-.098-3.707-.847l-2.285 2.285c.745 1.568 1.375 2.434.847 3.707-.527 1.271-1.584 1.438-3.219 2.02v3.232c1.632.58 2.692.749 3.219 2.019.53 1.282-.114 2.166-.847 3.707l2.285 2.286c1.562-.743 2.434-1.375 3.707-.847h.001c1.27.526 1.436 1.579 2.019 3.219h3.232c.582-1.636.75-2.69 2.027-3.222h.001c1.262-.524 2.12.101 3.698.851l2.285-2.286c-.744-1.563-1.375-2.433-.848-3.706.527-1.271 1.588-1.44 3.221-2.021zm-12 2.384c-2.209 0-4-1.791-4-4s1.791-4 4-4 4 1.791 4 4-1.791 4-4 4z"/>
</svg> </svg>
</nuxt-link> </nuxt-link>
</nav> </nav>
@@ -105,7 +104,7 @@
right: 0; right: 0;
z-index: -1; z-index: -1;
background-color: var(--ac-color); background-color: var(--ac-color);
border-radius: 4px; border-radius: 8px;
margin: auto; margin: auto;
} }

View File

@@ -3,7 +3,9 @@
<pw-section class="yellow" label="Import" ref="import"> <pw-section class="yellow" label="Import" ref="import">
<ul> <ul>
<li> <li>
<button id="show-modal" @click="showModal = true">Import cURL</button> <button class="icon" id="show-modal" @click="showModal = true">
Import cURL
</button>
</li> </li>
</ul> </ul>
<pw-modal v-if="showModal" @close="showModal = false"> <pw-modal v-if="showModal" @close="showModal = false">
@@ -14,8 +16,8 @@
<h3 class="title">Import cURL</h3> <h3 class="title">Import cURL</h3>
<div> <div>
<button class="icon" @click="toggleModal"> <button class="icon" @click="toggleModal">
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24"> <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 24 24">
<path d="M23 20.168l-8.185-8.187 8.185-8.174-2.832-2.807-8.182 8.179-8.176-8.179-2.81 2.81 8.186 8.196-8.186 8.184 2.81 2.81 8.203-8.192 8.18 8.192z" /> <path d="M23.954 21.03l-9.184-9.095 9.092-9.174-2.832-2.807-9.09 9.179-9.176-9.088-2.81 2.81 9.186 9.105-9.095 9.184 2.81 2.81 9.112-9.192 9.18 9.1z"/>
</svg> </svg>
</button> </button>
</div> </div>
@@ -33,7 +35,9 @@
<div slot="footer"> <div slot="footer">
<ul> <ul>
<li> <li>
<button @click="handleImport">Import</button> <button class="icon" @click="handleImport">
Import
</button>
</li> </li>
</ul> </ul>
</div> </div>
@@ -65,20 +69,20 @@
<li> <li>
<label class="hide-on-small-screen" for="copyRequest">&nbsp;</label> <label class="hide-on-small-screen" for="copyRequest">&nbsp;</label>
<button class="icon" @click="copyRequest" id="copyRequest" ref="copyRequest" :disabled="!isValidURL"> <button class="icon" @click="copyRequest" id="copyRequest" ref="copyRequest" :disabled="!isValidURL">
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24"> <svg xmlns="http://www.w3.org/2000/svg" width="18" height="18" viewBox="0 0 24 24">
<path d="M22 6v16h-16v-16h16zm2-2h-20v20h20v-20zm-24 17v-21h21v2h-19v19h-2z" /> <path d="M19.647 15.247c-1.278 0-2.429.551-3.225 1.429l-7.788-3.846c.062-.343.079-.64.067-.942l8.058-4.231c.769.682 1.78 1.097 2.889 1.097 2.404-.001 4.352-1.949 4.352-4.353s-1.948-4.353-4.353-4.353-4.353 1.949-4.353 4.353c0 .18.012.356.033.53l-7.828 4.111c-.793-.829-1.908-1.347-3.146-1.347-2.405 0-4.353 1.949-4.353 4.353s1.948 4.353 4.353 4.353c1.013 0 1.943-.347 2.684-.927l8.26 4.078-.001.047c0 2.404 1.948 4.353 4.353 4.353s4.351-1.949 4.351-4.353-1.948-4.352-4.353-4.352z"/>
</svg> </svg>
<span>Share URL</span> <span>Permalink</span>
</button> </button>
</li> </li>
<li> <li>
<label class="hide-on-small-screen" for="code">&nbsp;</label> <label class="hide-on-small-screen" for="code">&nbsp;</label>
<button class="icon" id="code" v-on:click="isHidden = !isHidden" :disabled="!isValidURL"> <button class="icon" id="code" v-on:click="isHidden = !isHidden" :disabled="!isValidURL">
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" v-if="isHidden"> <svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" v-if="isHidden">
<path d="M12.015 7c4.751 0 8.063 3.012 9.504 4.636-1.401 1.837-4.713 5.364-9.504 5.364-4.42 0-7.93-3.536-9.478-5.407 1.493-1.647 4.817-4.593 9.478-4.593zm0-2c-7.569 0-12.015 6.551-12.015 6.551s4.835 7.449 12.015 7.449c7.733 0 11.985-7.449 11.985-7.449s-4.291-6.551-11.985-6.551zm-.015 5c1.103 0 2 .897 2 2s-.897 2-2 2-2-.897-2-2 .897-2 2-2zm0-2c-2.209 0-4 1.792-4 4 0 2.209 1.791 4 4 4s4-1.791 4-4c0-2.208-1.791-4-4-4z" /> <path d="M15 12c0 1.654-1.346 3-3 3s-3-1.346-3-3 1.346-3 3-3 3 1.346 3 3zm9-.449s-4.252 8.449-11.985 8.449c-7.18 0-12.015-8.449-12.015-8.449s4.446-7.551 12.015-7.551c7.694 0 11.985 7.551 11.985 7.551zm-7 .449c0-2.757-2.243-5-5-5s-5 2.243-5 5 2.243 5 5 5 5-2.243 5-5z"/>
</svg> </svg>
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" v-if="!isHidden"> <svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" v-if="!isHidden">
<path d="M19.604 2.562l-3.346 3.137c-1.27-.428-2.686-.699-4.243-.699-7.569 0-12.015 6.551-12.015 6.551s1.928 2.951 5.146 5.138l-2.911 2.909 1.414 1.414 17.37-17.035-1.415-1.415zm-6.016 5.779c-3.288-1.453-6.681 1.908-5.265 5.206l-1.726 1.707c-1.814-1.16-3.225-2.65-4.06-3.66 1.493-1.648 4.817-4.594 9.478-4.594.927 0 1.796.119 2.61.315l-1.037 1.026zm-2.883 7.431l5.09-4.993c1.017 3.111-2.003 6.067-5.09 4.993zm13.295-4.221s-4.252 7.449-11.985 7.449c-1.379 0-2.662-.291-3.851-.737l1.614-1.583c.715.193 1.458.32 2.237.32 4.791 0 8.104-3.527 9.504-5.364-.729-.822-1.956-1.99-3.587-2.952l1.489-1.46c2.982 1.9 4.579 4.327 4.579 4.327z" /> <path d="M11.885 14.988l3.104-3.098.011.11c0 1.654-1.346 3-3 3l-.115-.012zm8.048-8.032l-3.274 3.268c.212.554.341 1.149.341 1.776 0 2.757-2.243 5-5 5-.631 0-1.229-.13-1.785-.344l-2.377 2.372c1.276.588 2.671.972 4.177.972 7.733 0 11.985-8.449 11.985-8.449s-1.415-2.478-4.067-4.595zm1.431-3.536l-18.619 18.58-1.382-1.422 3.455-3.447c-3.022-2.45-4.818-5.58-4.818-5.58s4.446-7.551 12.015-7.551c1.825 0 3.456.426 4.886 1.075l3.081-3.075 1.382 1.42zm-13.751 10.922l1.519-1.515c-.077-.264-.132-.538-.132-.827 0-1.654 1.346-3 3-3 .291 0 .567.055.833.134l1.518-1.515c-.704-.382-1.496-.619-2.351-.619-2.757 0-5 2.243-5 5 0 .852.235 1.641.613 2.342z"/>
</svg> </svg>
<span>{{ isHidden ? 'Show Code' : 'Hide Code' }}</span> <span>{{ isHidden ? 'Show Code' : 'Hide Code' }}</span>
</button> </button>
@@ -89,8 +93,8 @@
<button :disabled="!isValidURL" @click="sendRequest" class="show" id="send" ref="sendButton"> <button :disabled="!isValidURL" @click="sendRequest" class="show" id="send" ref="sendButton">
Send <span id="hidden-message">Again</span> Send <span id="hidden-message">Again</span>
<span> <span>
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24"> <svg xmlns="http://www.w3.org/2000/svg" width="18" height="18" viewBox="0 0 24 24">
<path d="M0 12l11 3.1 7-8.1-8.156 5.672-4.312-1.202 15.362-7.68-3.974 14.57-3.75-3.339-2.17 2.925v-.769l-2-.56v7.383l4.473-6.031 4.527 4.031 6-22z" /> <path d="M24 0l-6 22-8.129-7.239 7.802-8.234-10.458 7.227-7.215-1.754 24-12zm-15 16.668v7.332l3.258-4.431-3.258-2.901z"/>
</svg> </svg>
</span> </span>
</button> </button>
@@ -114,8 +118,8 @@
<label for="generatedCode">Generated Code</label> <label for="generatedCode">Generated Code</label>
<div> <div>
<button class="icon" @click="copyRequestCode" id="copyRequestCode" ref="copyRequestCode"> <button class="icon" @click="copyRequestCode" id="copyRequestCode" ref="copyRequestCode">
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24"> <svg xmlns="http://www.w3.org/2000/svg" width="18" height="18" viewBox="0 0 24 24">
<path d="M22 6v16h-16v-16h16zm2-2h-20v20h20v-20zm-24 17v-21h21v2h-19v19h-2z" /> <path d="M19.647 15.247c-1.278 0-2.429.551-3.225 1.429l-7.788-3.846c.062-.343.079-.64.067-.942l8.058-4.231c.769.682 1.78 1.097 2.889 1.097 2.404-.001 4.352-1.949 4.352-4.353s-1.948-4.353-4.353-4.353-4.353 1.949-4.353 4.353c0 .18.012.356.033.53l-7.828 4.111c-.793-.829-1.908-1.347-3.146-1.347-2.405 0-4.353 1.949-4.353 4.353s1.948 4.353 4.353 4.353c1.013 0 1.943-.347 2.684-.927l8.26 4.078-.001.047c0 2.404 1.948 4.353 4.353 4.353s4.351-1.949 4.351-4.353-1.948-4.352-4.353-4.352z"/>
</svg> </svg>
<span>Copy</span> <span>Copy</span>
</button> </button>
@@ -140,19 +144,16 @@
<div v-if="!rawInput"> <div v-if="!rawInput">
<ul v-for="(param, index) in bodyParams" :key="index"> <ul v-for="(param, index) in bodyParams" :key="index">
<li> <li>
<label :for="'bparam'+index">Key {{index + 1}}</label> <input :placeholder="'Key '+(index+1)" :name="'bparam'+index" v-model="param.key" @keyup.prevent="setRouteQueryState" autofocus>
<input :id="'bparam'+index" :name="'bparam'+index" v-model="param.key" @keyup.prevent="setRouteQueryState" autofocus>
</li> </li>
<li> <li>
<label :for="'bvalue'+index">Value {{index + 1}}</label> <input :placeholder="'Value '+(index+1)" :id="'bvalue'+index" :name="'bvalue'+index" v-model="param.value" @keyup.prevent="setRouteQueryState">
<input :id="'bvalue'+index" :name="'bvalue'+index" v-model="param.value" @keyup.prevent="setRouteQueryState">
</li> </li>
<div> <div>
<li> <li>
<label class="hide-on-small-screen" for="delParam">&nbsp;</label>
<button class="icon" @click="removeRequestBodyParam(index)" id="delParam"> <button class="icon" @click="removeRequestBodyParam(index)" id="delParam">
<svg width="24" height="24" xmlns="http://www.w3.org/2000/svg" fill-rule="evenodd" clip-rule="evenodd"> <svg xmlns="http://www.w3.org/2000/svg" width="18" height="18" viewBox="0 0 24 24">
<path d="M19 24h-14c-1.104 0-2-.896-2-2v-17h-1v-2h6v-1.5c0-.827.673-1.5 1.5-1.5h5c.825 0 1.5.671 1.5 1.5v1.5h6v2h-1v17c0 1.104-.896 2-2 2zm0-19h-14v16.5c0 .276.224.5.5.5h13c.276 0 .5-.224.5-.5v-16.5zm-9 4c0-.552-.448-1-1-1s-1 .448-1 1v9c0 .552.448 1 1 1s1-.448 1-1v-9zm6 0c0-.552-.448-1-1-1s-1 .448-1 1v9c0 .552.448 1 1 1s1-.448 1-1v-9zm-2-7h-4v1h4v-1z" /> <path d="M5.633 22.031c1.135 1.313 3.735 1.969 6.334 1.969 2.601 0 5.199-.656 6.335-1.969.081-.404 3.698-18.468 3.698-18.882 0-2.473-7.338-3.149-10-3.149-4.992 0-10 1.242-10 3.144 0 .406 3.556 18.488 3.633 18.887zm6.418-16.884c-4.211 0-7.625-.746-7.625-1.667s3.414-1.667 7.625-1.667 7.624.746 7.624 1.667-3.413 1.667-7.624 1.667z"/>
</svg> </svg>
</button> </button>
</li> </li>
@@ -160,12 +161,17 @@
</ul> </ul>
<ul> <ul>
<li> <li>
<button @click="addRequestBodyParam" name="addrequest">Add New</button> <button class="icon" @click="addRequestBodyParam" name="addrequest">
<svg xmlns="http://www.w3.org/2000/svg" width="18" height="18" viewBox="0 0 24 24">
<path d="M24 9h-9v-9h-6v9h-9v6h9v9h6v-9h9z"/>
</svg>
<span>Add New</span>
</button>
</li> </li>
</ul> </ul>
<ul> <ul>
<li> <li>
<label for="reqParamList">Parameter List</label> <label for="reqParamList"></label>
<textarea id="reqParamList" readonly v-textarea-auto-height="rawRequestBody" v-model="rawRequestBody" placeholder="(add at least one parameter)" rows="1"></textarea> <textarea id="reqParamList" readonly v-textarea-auto-height="rawRequestBody" v-model="rawRequestBody" placeholder="(add at least one parameter)" rows="1"></textarea>
</li> </li>
</ul> </ul>
@@ -198,8 +204,8 @@
<label for="body">response</label> <label for="body">response</label>
<div> <div>
<button class="icon" @click="copyResponse" ref="copyResponse" v-if="response.body"> <button class="icon" @click="copyResponse" ref="copyResponse" v-if="response.body">
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24"> <svg xmlns="http://www.w3.org/2000/svg" width="18" height="18" viewBox="0 0 24 24">
<path d="M22 6v16h-16v-16h16zm2-2h-20v20h20v-20zm-24 17v-21h21v2h-19v19h-2z" /> <path d="M19.647 15.247c-1.278 0-2.429.551-3.225 1.429l-7.788-3.846c.062-.343.079-.64.067-.942l8.058-4.231c.769.682 1.78 1.097 2.889 1.097 2.404-.001 4.352-1.949 4.352-4.353s-1.948-4.353-4.353-4.353-4.353 1.949-4.353 4.353c0 .18.012.356.033.53l-7.828 4.111c-.793-.829-1.908-1.347-3.146-1.347-2.405 0-4.353 1.949-4.353 4.353s1.948 4.353 4.353 4.353c1.013 0 1.943-.347 2.684-.927l8.26 4.078-.001.047c0 2.404 1.948 4.353 4.353 4.353s4.351-1.949 4.351-4.353-1.948-4.352-4.353-4.352z"/>
</svg> </svg>
<span>Copy</span> <span>Copy</span>
</button> </button>
@@ -227,7 +233,7 @@
<input id="tab-one" type="radio" name="grp" checked="checked"> <input id="tab-one" type="radio" name="grp" checked="checked">
<label for="tab-one">Authentication</label> <label for="tab-one">Authentication</label>
<div class="tab"> <div class="tab">
<pw-section class="green" label="Authentication"> <pw-section class="cyan" label="Authentication">
<ul> <ul>
<li> <li>
<label for="auth">Authentication Type</label> <label for="auth">Authentication Type</label>
@@ -240,22 +246,19 @@
</ul> </ul>
<ul v-if="auth === 'Basic'"> <ul v-if="auth === 'Basic'">
<li> <li>
<label for="http_basic_user">User</label> <input placeholder="User" name="http_basic_user" v-model="httpUser">
<input id="http_basic_user" name="http_basic_user" v-model="httpUser">
</li> </li>
<li> <li>
<label for="http_basic_passwd">Password</label> <input placeholder="Password" name="http_basic_passwd" :type="passwordFieldType" v-model="httpPassword">
<input id="http_basic_passwd" name="http_basic_passwd" :type="passwordFieldType" v-model="httpPassword">
</li> </li>
<div> <div>
<li> <li>
<label class="hide-on-small-screen" for="switchVisibility">&nbsp;</label>
<button class="icon" id="switchVisibility" ref="switchVisibility" @click="switchVisibility"> <button class="icon" id="switchVisibility" ref="switchVisibility" @click="switchVisibility">
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" v-if="passwordFieldType === 'text'"> <svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" v-if="passwordFieldType === 'text'">
<path d="M12.015 7c4.751 0 8.063 3.012 9.504 4.636-1.401 1.837-4.713 5.364-9.504 5.364-4.42 0-7.93-3.536-9.478-5.407 1.493-1.647 4.817-4.593 9.478-4.593zm0-2c-7.569 0-12.015 6.551-12.015 6.551s4.835 7.449 12.015 7.449c7.733 0 11.985-7.449 11.985-7.449s-4.291-6.551-11.985-6.551zm-.015 5c1.103 0 2 .897 2 2s-.897 2-2 2-2-.897-2-2 .897-2 2-2zm0-2c-2.209 0-4 1.792-4 4 0 2.209 1.791 4 4 4s4-1.791 4-4c0-2.208-1.791-4-4-4z" /> <path d="M15 12c0 1.654-1.346 3-3 3s-3-1.346-3-3 1.346-3 3-3 3 1.346 3 3zm9-.449s-4.252 8.449-11.985 8.449c-7.18 0-12.015-8.449-12.015-8.449s4.446-7.551 12.015-7.551c7.694 0 11.985 7.551 11.985 7.551zm-7 .449c0-2.757-2.243-5-5-5s-5 2.243-5 5 2.243 5 5 5 5-2.243 5-5z"/>
</svg> </svg>
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" v-if="passwordFieldType !== 'text'"> <svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" v-if="passwordFieldType !== 'text'">
<path d="M19.604 2.562l-3.346 3.137c-1.27-.428-2.686-.699-4.243-.699-7.569 0-12.015 6.551-12.015 6.551s1.928 2.951 5.146 5.138l-2.911 2.909 1.414 1.414 17.37-17.035-1.415-1.415zm-6.016 5.779c-3.288-1.453-6.681 1.908-5.265 5.206l-1.726 1.707c-1.814-1.16-3.225-2.65-4.06-3.66 1.493-1.648 4.817-4.594 9.478-4.594.927 0 1.796.119 2.61.315l-1.037 1.026zm-2.883 7.431l5.09-4.993c1.017 3.111-2.003 6.067-5.09 4.993zm13.295-4.221s-4.252 7.449-11.985 7.449c-1.379 0-2.662-.291-3.851-.737l1.614-1.583c.715.193 1.458.32 2.237.32 4.791 0 8.104-3.527 9.504-5.364-.729-.822-1.956-1.99-3.587-2.952l1.489-1.46c2.982 1.9 4.579 4.327 4.579 4.327z" /> <path d="M11.885 14.988l3.104-3.098.011.11c0 1.654-1.346 3-3 3l-.115-.012zm8.048-8.032l-3.274 3.268c.212.554.341 1.149.341 1.776 0 2.757-2.243 5-5 5-.631 0-1.229-.13-1.785-.344l-2.377 2.372c1.276.588 2.671.972 4.177.972 7.733 0 11.985-8.449 11.985-8.449s-1.415-2.478-4.067-4.595zm1.431-3.536l-18.619 18.58-1.382-1.422 3.455-3.447c-3.022-2.45-4.818-5.58-4.818-5.58s4.446-7.551 12.015-7.551c1.825 0 3.456.426 4.886 1.075l3.081-3.075 1.382 1.42zm-13.751 10.922l1.519-1.515c-.077-.264-.132-.538-.132-.827 0-1.654 1.346-3 3-3 .291 0 .567.055.833.134l1.518-1.515c-.704-.382-1.496-.619-2.351-.619-2.757 0-5 2.243-5 5 0 .852.235 1.641.613 2.342z"/>
</svg> </svg>
</button> </button>
</li> </li>
@@ -263,8 +266,7 @@
</ul> </ul>
<ul v-if="auth === 'Bearer Token'"> <ul v-if="auth === 'Bearer Token'">
<li> <li>
<label for="bearer_token">Token</label> <input placeholder="Token" name="bearer_token" v-model="bearerToken">
<input id="bearer_token" name="bearer_token" v-model="bearerToken">
</li> </li>
</ul> </ul>
</pw-section> </pw-section>
@@ -273,21 +275,24 @@
<label for="tab-two">Headers</label> <label for="tab-two">Headers</label>
<div class="tab"> <div class="tab">
<pw-section class="orange" label="Headers"> <pw-section class="orange" label="Headers">
<ul>
<li>
<label for="headerList">Header List</label>
<textarea id="headerList" readonly v-textarea-auto-height="headerString" v-model="headerString" placeholder="(add at least one header)" rows="1"></textarea>
</li>
</ul>
<ul v-for="(header, index) in headers" :key="index"> <ul v-for="(header, index) in headers" :key="index">
<li> <li>
<label :for="'header'+index">Header {{index + 1}}</label> <input :placeholder="'Header '+(index+1)" :name="'header'+index" v-model="header.key" @keyup.prevent="setRouteQueryState" autofocus>
<input :id="'header'+index" :name="'header'+index" v-model="header.key" @keyup.prevent="setRouteQueryState" autofocus>
</li> </li>
<li> <li>
<label :for="'value'+index">Value {{index + 1}}</label> <input :placeholder="'Value '+(index+1)" :name="'value'+index" v-model="header.value" @keyup.prevent="setRouteQueryState">
<input :id="'value'+index" :name="'value'+index" v-model="header.value" @keyup.prevent="setRouteQueryState">
</li> </li>
<div> <div>
<li> <li>
<label class="hide-on-small-screen" for="header">&nbsp;</label>
<button class="icon" @click="removeRequestHeader(index)" id="header"> <button class="icon" @click="removeRequestHeader(index)" id="header">
<svg width="24" height="24" xmlns="http://www.w3.org/2000/svg" fill-rule="evenodd" clip-rule="evenodd"> <svg xmlns="http://www.w3.org/2000/svg" width="18" height="18" viewBox="0 0 24 24">
<path d="M19 24h-14c-1.104 0-2-.896-2-2v-17h-1v-2h6v-1.5c0-.827.673-1.5 1.5-1.5h5c.825 0 1.5.671 1.5 1.5v1.5h6v2h-1v17c0 1.104-.896 2-2 2zm0-19h-14v16.5c0 .276.224.5.5.5h13c.276 0 .5-.224.5-.5v-16.5zm-9 4c0-.552-.448-1-1-1s-1 .448-1 1v9c0 .552.448 1 1 1s1-.448 1-1v-9zm6 0c0-.552-.448-1-1-1s-1 .448-1 1v9c0 .552.448 1 1 1s1-.448 1-1v-9zm-2-7h-4v1h4v-1z" /> <path d="M5.633 22.031c1.135 1.313 3.735 1.969 6.334 1.969 2.601 0 5.199-.656 6.335-1.969.081-.404 3.698-18.468 3.698-18.882 0-2.473-7.338-3.149-10-3.149-4.992 0-10 1.242-10 3.144 0 .406 3.556 18.488 3.633 18.887zm6.418-16.884c-4.211 0-7.625-.746-7.625-1.667s3.414-1.667 7.625-1.667 7.624.746 7.624 1.667-3.413 1.667-7.624 1.667z"/>
</svg> </svg>
</button> </button>
</li> </li>
@@ -295,13 +300,12 @@
</ul> </ul>
<ul> <ul>
<li> <li>
<button @click="addRequestHeader">Add New</button> <button class="icon" @click="addRequestHeader">
</li> <svg xmlns="http://www.w3.org/2000/svg" width="18" height="18" viewBox="0 0 24 24">
</ul> <path d="M24 9h-9v-9h-6v9h-9v6h9v9h6v-9h9z"/>
<ul> </svg>
<li> <span>Add New</span>
<label for="headerList">Header List</label> </button>
<textarea id="headerList" readonly v-textarea-auto-height="headerString" v-model="headerString" placeholder="(add at least one header)" rows="1"></textarea>
</li> </li>
</ul> </ul>
</pw-section> </pw-section>
@@ -310,21 +314,24 @@
<label for="tab-three">Parameters</label> <label for="tab-three">Parameters</label>
<div class="tab"> <div class="tab">
<pw-section class="pink" label="Parameters"> <pw-section class="pink" label="Parameters">
<ul>
<li>
<label for="paramList">Parameter List</label>
<textarea id="paramList" readonly v-textarea-auto-height="queryString" v-model="queryString" placeholder="(add at least one parameter)" rows="1"></textarea>
</li>
</ul>
<ul v-for="(param, index) in params" :key="index"> <ul v-for="(param, index) in params" :key="index">
<li> <li>
<label :for="'param'+index">Parameter {{index + 1}}</label> <input :placeholder="'Parameter '+(index+1)" :name="'param'+index" v-model="param.key" autofocus>
<input :id="'param'+index" :name="'param'+index" v-model="param.key" autofocus>
</li> </li>
<li> <li>
<label :for="'value'+index">Value {{index + 1}}</label> <input :placeholder="'Value '+(index+1)" :name="'value'+index" v-model="param.value">
<input :id="'value'+index" :name="'value'+index" v-model="param.value">
</li> </li>
<div> <div>
<li> <li>
<label class="hide-on-small-screen" for="param">&nbsp;</label>
<button class="icon" @click="removeRequestParam(index)" id="param"> <button class="icon" @click="removeRequestParam(index)" id="param">
<svg width="24" height="24" xmlns="http://www.w3.org/2000/svg" fill-rule="evenodd" clip-rule="evenodd"> <svg xmlns="http://www.w3.org/2000/svg" width="18" height="18" viewBox="0 0 24 24">
<path d="M19 24h-14c-1.104 0-2-.896-2-2v-17h-1v-2h6v-1.5c0-.827.673-1.5 1.5-1.5h5c.825 0 1.5.671 1.5 1.5v1.5h6v2h-1v17c0 1.104-.896 2-2 2zm0-19h-14v16.5c0 .276.224.5.5.5h13c.276 0 .5-.224.5-.5v-16.5zm-9 4c0-.552-.448-1-1-1s-1 .448-1 1v9c0 .552.448 1 1 1s1-.448 1-1v-9zm6 0c0-.552-.448-1-1-1s-1 .448-1 1v9c0 .552.448 1 1 1s1-.448 1-1v-9zm-2-7h-4v1h4v-1z" /> <path d="M5.633 22.031c1.135 1.313 3.735 1.969 6.334 1.969 2.601 0 5.199-.656 6.335-1.969.081-.404 3.698-18.468 3.698-18.882 0-2.473-7.338-3.149-10-3.149-4.992 0-10 1.242-10 3.144 0 .406 3.556 18.488 3.633 18.887zm6.418-16.884c-4.211 0-7.625-.746-7.625-1.667s3.414-1.667 7.625-1.667 7.624.746 7.624 1.667-3.413 1.667-7.624 1.667z"/>
</svg> </svg>
</button> </button>
</li> </li>
@@ -332,13 +339,12 @@
</ul> </ul>
<ul> <ul>
<li> <li>
<button @click="addRequestParam">Add New</button> <button class="icon" @click="addRequestParam">
</li> <svg xmlns="http://www.w3.org/2000/svg" width="18" height="18" viewBox="0 0 24 24">
</ul> <path d="M24 9h-9v-9h-6v9h-9v6h9v9h6v-9h9z"/>
<ul> </svg>
<li> <span>Add New</span>
<label for="paramList">Parameter List</label> </button>
<textarea id="paramList" readonly v-textarea-auto-height="queryString" v-model="queryString" placeholder="(add at least one parameter)" rows="1"></textarea>
</li> </li>
</ul> </ul>
</pw-section> </pw-section>
@@ -420,8 +426,8 @@
data() { data() {
return { return {
showModal: false, showModal: false,
copyButton: '<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24"><path d="M22 6v16h-16v-16h16zm2-2h-20v20h20v-20zm-24 17v-21h21v2h-19v19h-2z" /></svg>', copyButton: '<svg xmlns="http://www.w3.org/2000/svg" width="18" height="18" viewBox="0 0 24 24"><path d="M19.647 15.247c-1.278 0-2.429.551-3.225 1.429l-7.788-3.846c.062-.343.079-.64.067-.942l8.058-4.231c.769.682 1.78 1.097 2.889 1.097 2.404-.001 4.352-1.949 4.352-4.353s-1.948-4.353-4.353-4.353-4.353 1.949-4.353 4.353c0 .18.012.356.033.53l-7.828 4.111c-.793-.829-1.908-1.347-3.146-1.347-2.405 0-4.353 1.949-4.353 4.353s1.948 4.353 4.353 4.353c1.013 0 1.943-.347 2.684-.927l8.26 4.078-.001.047c0 2.404 1.948 4.353 4.353 4.353s4.351-1.949 4.351-4.353-1.948-4.352-4.353-4.352z"/></svg>',
copiedButton: '<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24"><path d="M22 2v20h-20v-20h20zm2-2h-24v24h24v-24zm-5.541 8.409l-1.422-1.409-7.021 7.183-3.08-2.937-1.395 1.435 4.5 4.319 8.418-8.591z"/></svg>', copiedButton: '<svg xmlns="http://www.w3.org/2000/svg" width="18" height="18" viewBox="0 0 24 24"><path d="M20.285 2l-11.285 11.567-5.286-5.011-3.714 3.716 9 8.728 15-15.285z"/></svg>',
method: 'GET', method: 'GET',
url: 'https://reqres.in', url: 'https://reqres.in',
auth: 'None', auth: 'None',
@@ -838,7 +844,7 @@
dummy.select(); dummy.select();
document.execCommand('copy'); document.execCommand('copy');
document.body.removeChild(dummy); document.body.removeChild(dummy);
setTimeout(() => this.$refs.copyRequest.innerHTML = this.copyButton + '<span>Share URL</span>', 1500) setTimeout(() => this.$refs.copyRequest.innerHTML = this.copyButton + '<span>Permalink</span>', 1500)
} }
}, },
copyRequestCode() { copyRequestCode() {

View File

@@ -6,20 +6,22 @@
<label for="url">URL</label> <label for="url">URL</label>
<input id="url" type="url" :class="{ error: !urlValid }" v-model="url" @keyup.enter="urlValid ? toggleConnection() : null"> <input id="url" type="url" :class="{ error: !urlValid }" v-model="url" @keyup.enter="urlValid ? toggleConnection() : null">
</li> </li>
<li> <div>
<label for="connect" class="hide-on-small-screen">&nbsp;</label> <li>
<button :disabled="!urlValid" id="connect" name="connect" @click="toggleConnection"> <label for="connect" class="hide-on-small-screen">&nbsp;</label>
{{ toggleConnectionVerb }} <button :disabled="!urlValid" id="connect" name="connect" @click="toggleConnection">
<span> {{ toggleConnectionVerb }}
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" v-if="!connectionState"> <span>
<path d="M21.921 2.081c2.771 2.772 2.771 7.269 0 10.042l-3.84 3.839-2.121-2.122 3.839-3.84c1.599-1.598 1.599-4.199-.001-5.797-1.598-1.599-4.199-1.599-5.797-.001l-3.84 3.839-2.121-2.121 3.84-3.839c2.771-2.773 7.267-2.773 10.041 0zm-8.082 13.879l-3.84 3.839c-1.598 1.6-4.199 1.599-5.799 0-1.598-1.598-1.598-4.2 0-5.797l3.84-3.84-2.121-2.121-3.84 3.84c-2.771 2.772-2.772 7.268 0 10.041 2.773 2.772 7.27 2.773 10.041 0l3.84-3.84-2.121-2.122z"/> <svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" v-if="connectionState">
</svg> <path d="M16 0l-3 9h9l-1.866 2h-14.4l10.266-11zm2.267 13h-14.4l-1.867 2h9l-3 9 10.267-11z"/>
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" v-if="connectionState"> </svg>
<path d="M14.9 19.143l-2.78 2.779c-2.771 2.772-7.268 2.772-10.041 0-2.772-2.773-2.771-7.269 0-10.041l2.779-2.779 2.121 2.121-2.779 2.779c-1.598 1.598-1.598 4.2 0 5.797 1.6 1.6 4.201 1.6 5.799 0l2.779-2.777 2.122 2.121zm-3.02-17.063l-2.779 2.779 2.121 2.121 2.78-2.779c1.598-1.598 4.199-1.598 5.795.001 1.602 1.598 1.602 4.199.004 5.797l-2.779 2.779 2.121 2.121 2.779-2.778c2.771-2.773 2.771-7.269 0-10.041-2.774-2.772-7.27-2.772-10.042 0zm-5.945-.795l1.44-.204.438 3.083-1.438.205-.44-3.084zm-4.855 6.09l.206-1.441 3.084.44-.206 1.44-3.084-.439zm4.793-2.521l-1.028 1.03-2.205-2.203 1.029-1.029 2.204 2.202zm12.191 17.86l-1.441.204-.438-3.083 1.439-.205.44 3.084zm4.856-6.09l-.207 1.441-3.084-.439.207-1.441 3.084.439zm-4.793 2.52l1.027-1.029 2.205 2.204-1.029 1.029-2.203-2.204z"/> <svg xmlns="http://www.w3.org/2000/svg" width="18" height="18" viewBox="0 0 24 24" v-if="!connectionState">
</svg> <path d="M8 24l3-9h-9l14-15-3 9h9l-14 15z"/>
</span> </svg>
</button> </span>
</li> </button>
</li>
</div>
</ul> </ul>
</pw-section> </pw-section>
<pw-section class="purple" label="Communication" id="response" ref="response"> <pw-section class="purple" label="Communication" id="response" ref="response">
@@ -39,17 +41,19 @@
<label for="message">Message</label> <label for="message">Message</label>
<input id="message" name="message" type="text" v-model="communication.input" :readonly="!connectionState" @keyup.enter="connectionState ? sendMessage() : null"> <input id="message" name="message" type="text" v-model="communication.input" :readonly="!connectionState" @keyup.enter="connectionState ? sendMessage() : null">
</li> </li>
<li> <div>
<label for="send" class="hide-on-small-screen">&nbsp;</label> <li>
<button id="send" name="send" :disabled="!connectionState" @click="sendMessage"> <label for="send" class="hide-on-small-screen">&nbsp;</label>
Send <button id="send" name="send" :disabled="!connectionState" @click="sendMessage">
<span> Send
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24"> <span>
<path d="M0 12l11 3.1 7-8.1-8.156 5.672-4.312-1.202 15.362-7.68-3.974 14.57-3.75-3.339-2.17 2.925v-.769l-2-.56v7.383l4.473-6.031 4.527 4.031 6-22z" /> <svg xmlns="http://www.w3.org/2000/svg" width="18" height="18" viewBox="0 0 24 24">
</svg> <path d="M24 0l-6 22-8.129-7.239 7.802-8.234-10.458 7.227-7.215-1.754 24-12zm-15 16.668v7.332l3.258-4.431-3.258-2.901z"/>
</span> </svg>
</button> </span>
</li> </button>
</li>
</div>
</ul> </ul>
</pw-section> </pw-section>
</div> </div>
@@ -59,7 +63,7 @@
margin: 4px; margin: 4px;
padding: 8px 16px; padding: 8px 16px;
width: calc(100% - 8px); width: calc(100% - 8px);
border-radius: 4px; border-radius: 8px;
background-color: var(--bg-dark-color); background-color: var(--bg-dark-color);
color: var(--fg-color); color: var(--fg-color);
height: 256px; height: 256px;