Skip to content

Commit e9162da

Browse files
Merge new 404 design into main (#57)
* Initial rebranding styles Changed header and footer background color for both light and dark modes * Initial rebranding styles * Fixing styles The headings should no longer be underlined and cards should now show have black as font color in dark mode * Fixes in links The links and titles should now show properly in cards for both dark and light modes * Rebranding styles This commit includes multiple changes for the rebranding styles, like changing some colors. * The right content bar should now be sticky to the page, making it always available with no need to scroll to the top * Collapse and Expand all buttons has been added for the left navbar * The GCX code component should now take all the entire height from the body space on the website. * The code blocks should no longer have bold font * New 404 docs design This commit includes the new content and style applied to the antora 404 page. * Update 404.hbs This update includes the relative paths used on the live server * Update 404.hbs Changed location to /en/home * 404 footer fix The footer for the 404 page should now be fixed at the bottom of the device * 404 Fixes Fixed 404 design for mobile and error on console fixed * Update 404.hbs Testing permissions * Update 404.hbs Fixed relative paths on 404 page --------- Co-authored-by: Kenni Martínez <[email protected]>
1 parent 002e9cd commit e9162da

File tree

4 files changed

+79
-7
lines changed

4 files changed

+79
-7
lines changed

gcx/gulpfile.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ const bundleJSsrc = () =>
3939

4040
// Bundle a site.js for the 404 error page, excluding 01-nav.js
4141
const bundleJS404 = () =>{
42-
return src(['styles/src/js/*.js','!styles/src/js/01-nav.js'])
42+
return src(['styles/src/js/*.js','!styles/src/js/01-nav.js', '!styles/src/js/08-gcx-helios.js'])
4343
.pipe(concat('site404.js'))
4444
.pipe(dest('build/js'));
4545
}

gcx/styles/src/css/helios-gcx-body.css

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -227,3 +227,8 @@ main > .content {
227227
}
228228
}
229229

230+
@media screen and (max-width: 767px) {
231+
article.doc .center{
232+
max-width: 100%!important;
233+
}
234+
}

gcx/styles/src/css/helios-gcx-footer.css

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,3 @@ footer .container-fluid {
1919
.copyright-line {
2020
font-weight: bold;
2121
}
22-
23-
.wh_footer.notFound{
24-
position: fixed;
25-
}
26-

gcx/styles/src/layouts/404.hbs

Lines changed: 73 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,10 @@
66
<link href="https://fonts.googleapis.com/icon?family=Material+Icons" rel="stylesheet">
77
<link rel="stylesheet" href="/en/home/assets/css/site.css">
88
<title>Oops! We can't find that page {{#with site.title}} :: {{this}}{{/with}}</title>
9+
<meta name="viewport" content="width=device-width, initial-scale=1.0">
910
</head>
1011

11-
<body class="status-404">
12+
<body class="article status-404">
1213
<header class="header">
1314
<nav class="navbar">
1415
<div class="navbar-brand">
@@ -166,5 +167,76 @@
166167
root.classList.add('dark-mode');
167168
}
168169
}();
170+
171+
function isMobile () {
172+
// eslint-disable-next-line no-undef
173+
if (sessionStorage.desktop) return false
174+
// eslint-disable-next-line no-undef
175+
else if (localStorage.mobile) return true
176+
// eslint-disable-next-line max-len
177+
var mobile = ['iphone', 'ipad', 'android', 'blackberry', 'nokia', 'opera mini', 'windows mobile', 'windows phone', 'iemobile']
178+
for (var i in mobile) { if (navigator.userAgent.toLowerCase().indexOf(mobile[i].toLowerCase()) > 0) return true }
179+
return false
180+
}
181+
182+
window.addEventListener('DOMContentLoaded', (event) => {
183+
var theme = window.localStorage.getItem('theme')
184+
185+
var path = window.location.pathname
186+
var page = path.split('/').pop()
187+
var name = page.replace('.html', '')
188+
console.log(name)
189+
const sidebar = document.querySelector('.sidebar')
190+
const col = document.getElementById('collapse')
191+
var checkbox = document.getElementById('switch')
192+
if (theme) {
193+
checkbox.checked = true
194+
} else {
195+
checkbox.checked = false
196+
}
197+
198+
if (name === 'landing' && !isMobile()) {
199+
col.checked = true
200+
sidebar.classList.add('small-container')
201+
}
202+
203+
var elements = document.body.getElementsByTagName('pre')
204+
for (var i = 0; i < elements.length; i++) {
205+
for (const child of elements[i].children) {
206+
if (child.tagName === 'CODE') {
207+
elements[i].classList.add('has-code')
208+
}
209+
}
210+
}
211+
212+
document.addEventListener('click', function (event) {
213+
//No es un clic en el sidebar
214+
//if (!event.target.matches('li[data-depth="1"]') && !event.target.matches('.switch')) return;
215+
/* if (event.target.closest('li.nav-item.toggler')) {
216+
console.log(event.target)
217+
event.target.closest('li.nav-item.toggler').classList.toggle('is-active')
218+
}
219+
/*if ((event.target.matches('span.nav-text') ||
220+
event.target.matches('button.nav-item-toggle')) &&
221+
(event.target.offsetParent.matches('li[data-depth="1"]') ||
222+
event.target.offsetParent.matches('li[data-depth="0"]'))) {
223+
event.target.offsetParent.classList.toggle('is-active');
224+
}
225+
if (event.target.matches('li[data-depth="1"]') ||
226+
event.target.matches('li[data-depth="0"]')) {
227+
event.target.classList.toggle('is-active');
228+
}*/
229+
if (event.target.matches('.switch')) {
230+
var root = document.getElementsByTagName('html')[0]
231+
if (event.target.checked) {
232+
window.localStorage.setItem('theme', 'dark')
233+
root.classList.add('dark-mode')
234+
} else {
235+
window.localStorage.removeItem('theme')
236+
root.classList.remove('dark-mode')
237+
}
238+
}
239+
}, false)
240+
})
169241
</script>
170242
</body>

0 commit comments

Comments
 (0)