diff --git a/website/www/site/assets/js/shuffle-elements.js b/website/www/site/assets/js/shuffle-elements.js new file mode 100644 index 0000000000000..2e5c4bc06dcd8 --- /dev/null +++ b/website/www/site/assets/js/shuffle-elements.js @@ -0,0 +1,25 @@ +// Licensed under the Apache License, Version 2.0 (the 'License'); you may not +// use this file except in compliance with the License. You may obtain a copy of +// the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an 'AS IS' BASIS, WITHOUT +// WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +// License for the specific language governing permissions and limitations under +// the License. + +$(document).ready(function() { + const logos = document.querySelector(".case-study-list--additional"); + const temp = logos.cloneNode(true); + let i = temp.children.length + 1; + + while( i-- > 0 ) { + temp.appendChild( temp.children[Math.random() * i |0] ); + } + + logos.parentNode.replaceChild(temp, logos); + + document.querySelector(".case-study-list--additional").style.visibility = "visible"; +}); diff --git a/website/www/site/assets/scss/_case_study.scss b/website/www/site/assets/scss/_case_study.scss index e1a570386cf8d..cd9e809b19971 100644 --- a/website/www/site/assets/scss/_case_study.scss +++ b/website/www/site/assets/scss/_case_study.scss @@ -44,6 +44,7 @@ } .case-study-list--additional { + visibility: hidden; @media (min-width: $mobile) and (max-width: $tablet) { justify-content: center; } diff --git a/website/www/site/layouts/case-studies/list.html b/website/www/site/layouts/case-studies/list.html index f966008238729..a67079bd06ad9 100644 --- a/website/www/site/layouts/case-studies/list.html +++ b/website/www/site/layouts/case-studies/list.html @@ -79,4 +79,8 @@

Also used by

+ +{{ $shuffle := resources.Get "js/shuffle-elements.js" | minify | fingerprint }} + + {{ end }}