Skip to content

Commit 8d11af5

Browse files
authored
Merge pull request #2932 from Sigma-8214/master
Update website Command Box
2 parents 91e45d9 + 1a84bf3 commit 8d11af5

File tree

3 files changed

+28
-22
lines changed

3 files changed

+28
-22
lines changed

www/index.html

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@
3535
<path d="M18 20h2v3c0 1-1 2-2 2H2c-.998 0-2-1-2-2V5c0-.911.755-1.667 1.667-1.667h5A3.323 3.323 0 0110 0a3.323 3.323 0 013.333 3.333h5C19.245 3.333 20 4.09 20 5v8.333h-2V9H2v14h16v-3zM3 7h14c0-.911-.793-1.667-1.75-1.667H13.5c-.957 0-1.75-.755-1.75-1.666C11.75 2.755 10.957 2 10 2s-1.75.755-1.75 1.667c0 .911-.793 1.666-1.75 1.666H4.75C3.793 5.333 3 6.09 3 7z"></path><path d="M4 19h6v2H4zM12 11H4v2h8zM4 17h4v-2H4zM15 15v-3l-4.5 4.5L15 21v-3l8.027-.032L23 15z"></path>
3636
</svg>
3737
</div>
38-
<div id="copy-status-message-unix" class="copy-button-text"></div>
38+
<div id="copy-status-message-unix" class="copy-button-text">Copied!</div>
3939
</button>
4040
</div>
4141
<p class="other-platforms-help">You appear to be running Unix. If not, <a class="default-platform-button" href="#">display all supported installers</a>.</p>
@@ -56,7 +56,7 @@
5656
<path d="M18 20h2v3c0 1-1 2-2 2H2c-.998 0-2-1-2-2V5c0-.911.755-1.667 1.667-1.667h5A3.323 3.323 0 0110 0a3.323 3.323 0 013.333 3.333h5C19.245 3.333 20 4.09 20 5v8.333h-2V9H2v14h16v-3zM3 7h14c0-.911-.793-1.667-1.75-1.667H13.5c-.957 0-1.75-.755-1.75-1.666C11.75 2.755 10.957 2 10 2s-1.75.755-1.75 1.667c0 .911-.793 1.666-1.75 1.666H4.75C3.793 5.333 3 6.09 3 7z"></path><path d="M4 19h6v2H4zM12 11H4v2h8zM4 17h4v-2H4zM15 15v-3l-4.5 4.5L15 21v-3l8.027-.032L23 15z"></path>
5757
</svg>
5858
</div>
59-
<div id="copy-status-message-win32" class="copy-button-text"></div>
59+
<div id="copy-status-message-win32" class="copy-button-text">Copied!</div>
6060
</button>
6161
</div>
6262
<p class="other-platforms-help">You appear to be running Windows 32-bit. If not, <a class="default-platform-button" href="#">display all supported installers</a>.</p>
@@ -77,7 +77,7 @@
7777
<path d="M18 20h2v3c0 1-1 2-2 2H2c-.998 0-2-1-2-2V5c0-.911.755-1.667 1.667-1.667h5A3.323 3.323 0 0110 0a3.323 3.323 0 013.333 3.333h5C19.245 3.333 20 4.09 20 5v8.333h-2V9H2v14h16v-3zM3 7h14c0-.911-.793-1.667-1.75-1.667H13.5c-.957 0-1.75-.755-1.75-1.666C11.75 2.755 10.957 2 10 2s-1.75.755-1.75 1.667c0 .911-.793 1.666-1.75 1.666H4.75C3.793 5.333 3 6.09 3 7z"></path><path d="M4 19h6v2H4zM12 11H4v2h8zM4 17h4v-2H4zM15 15v-3l-4.5 4.5L15 21v-3l8.027-.032L23 15z"></path>
7878
</svg>
7979
</div>
80-
<div id="copy-status-message-win64" class="copy-button-text"></div>
80+
<div id="copy-status-message-win64" class="copy-button-text">Copied!</div>
8181
</button>
8282
</div>
8383
<p class="other-platforms-help">You appear to be running Windows 64-bit. If not, <a class="default-platform-button" href="#">display all supported installers</a>.</p>
@@ -111,7 +111,7 @@
111111
<path d="M18 20h2v3c0 1-1 2-2 2H2c-.998 0-2-1-2-2V5c0-.911.755-1.667 1.667-1.667h5A3.323 3.323 0 0110 0a3.323 3.323 0 013.333 3.333h5C19.245 3.333 20 4.09 20 5v8.333h-2V9H2v14h16v-3zM3 7h14c0-.911-.793-1.667-1.75-1.667H13.5c-.957 0-1.75-.755-1.75-1.666C11.75 2.755 10.957 2 10 2s-1.75.755-1.75 1.667c0 .911-.793 1.666-1.75 1.666H4.75C3.793 5.333 3 6.09 3 7z"></path><path d="M4 19h6v2H4zM12 11H4v2h8zM4 17h4v-2H4zM15 15v-3l-4.5 4.5L15 21v-3l8.027-.032L23 15z"></path>
112112
</svg>
113113
</div>
114-
<div id="copy-status-message-unknown" class="copy-button-text"></div>
114+
<div id="copy-status-message-unknown" class="copy-button-text">Copied!</div>
115115
</button>
116116
</div>
117117
</div>
@@ -150,7 +150,7 @@
150150
<path d="M18 20h2v3c0 1-1 2-2 2H2c-.998 0-2-1-2-2V5c0-.911.755-1.667 1.667-1.667h5A3.323 3.323 0 0110 0a3.323 3.323 0 013.333 3.333h5C19.245 3.333 20 4.09 20 5v8.333h-2V9H2v14h16v-3zM3 7h14c0-.911-.793-1.667-1.75-1.667H13.5c-.957 0-1.75-.755-1.75-1.666C11.75 2.755 10.957 2 10 2s-1.75.755-1.75 1.667c0 .911-.793 1.666-1.75 1.666H4.75C3.793 5.333 3 6.09 3 7z"></path><path d="M4 19h6v2H4zM12 11H4v2h8zM4 17h4v-2H4zM15 15v-3l-4.5 4.5L15 21v-3l8.027-.032L23 15z"></path>
151151
</svg>
152152
</div>
153-
<div id="copy-status-message-default" class="copy-button-text"></div>
153+
<div id="copy-status-message-default" class="copy-button-text">Copied!</div>
154154
</button>
155155
</div>
156156
</div>

www/rustup.css

Lines changed: 18 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -124,10 +124,11 @@ hr {
124124
color: white;
125125
padding: 1rem 1rem 1rem 0;
126126
width: 45rem;
127+
height: auto;
127128
text-align: center;
128-
border-radius: 3px;
129+
border-radius: 3px 0 0 3px;
129130
box-shadow: inset 0px 0px 20px 0px #333333;
130-
overflow: auto;
131+
overflow: hidden;
131132
font-size: 0.6em;
132133
white-space: nowrap;
133134
height: 26px;
@@ -149,28 +150,39 @@ hr {
149150
#platform-instructions-default button.copy-button,
150151
#platform-instructions-unknown button.copy-button {
151152
height: 58px;
152-
margin: 1px;
153-
padding-right: 5px;
154-
border-radius: 3px;
153+
margin: 0;
154+
padding: 0 5px 0 5px;
155+
border-radius: 0 3px 3px 0;
156+
border-left-width: 0px;
157+
border-left-style: solid;
155158
}
156159

157160
#platform-instructions-unix div.copy-icon,
158161
#platform-instructions-win32 div.copy-icon,
159162
#platform-instructions-win64 div.copy-icon,
160163
#platform-instructions-default div.copy-icon,
161164
#platform-instructions-unknown div.copy-icon {
162-
margin-top: 12px;
165+
position: relative;
166+
width: fit-content;
167+
height: fit-content;
168+
top: 50%;
169+
left: 50%;
170+
transform: translate(-50%, -50%);
163171
}
164172

165173
#platform-instructions-unix div.copy-button-text,
166174
#platform-instructions-win32 div.copy-button-text,
167175
#platform-instructions-win64 div.copy-button-text,
168176
#platform-instructions-default div.copy-button-text,
169177
#platform-instructions-unknown div.copy-button-text {
178+
transition: opacity 0.2s ease-in-out;
179+
opacity: 0;
170180
font-size: 10px;
171181
color: green;
172182
width: 41px;
173183
height: 15px;
184+
position: relative;
185+
top: 5px;
174186
}
175187

176188
#platform-instructions-win32 a.windows-download,

www/rustup.js

Lines changed: 5 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -167,20 +167,14 @@ function fill_in_bug_report_values() {
167167
nav_app.textContent = navigator.appVersion;
168168
}
169169

170-
function clear_copy_status_message(id) {
171-
document.getElementById(id).innerText = '';
172-
}
173-
174170
function process_copy_button_click(id) {
175171
try {
176-
navigator.clipboard.writeText(rustup_install_command).then(function() {
177-
document.getElementById(id).innerText = 'Copied!';
178-
});
179-
setTimeout(function () {
180-
clear_copy_status_message(id);
181-
}, 5000);
172+
navigator.clipboard.writeText(rustup_install_command).then(() =>
173+
document.getElementById(id).style.opacity = '1');
174+
175+
setTimeout(() => document.getElementById(id).style.opacity = '0', 3000);
182176
} catch (e) {
183-
console.log('Hit a snag when copying to clipboard:', e);
177+
console.log('Hit a snag when copying to clipboard: ', e);
184178
}
185179
}
186180

0 commit comments

Comments
 (0)