Skip to content

Commit

Permalink
[Website] add shuffle to logos (apache#23847)
Browse files Browse the repository at this point in the history
  • Loading branch information
bullet03 committed Oct 31, 2022
1 parent e808182 commit 68aee2f
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 0 deletions.
25 changes: 25 additions & 0 deletions website/www/site/assets/js/shuffle-elements.js
Original file line number Diff line number Diff line change
@@ -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";
});
1 change: 1 addition & 0 deletions website/www/site/assets/scss/_case_study.scss
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@
}

.case-study-list--additional {
visibility: hidden;
@media (min-width: $mobile) and (max-width: $tablet) {
justify-content: center;
}
Expand Down
4 changes: 4 additions & 0 deletions website/www/site/layouts/case-studies/list.html
Original file line number Diff line number Diff line change
Expand Up @@ -79,4 +79,8 @@ <h2 class="case-study-h2">Also used by</h2>
</a>
</div>
</div>

{{ $shuffle := resources.Get "js/shuffle-elements.js" | minify | fingerprint }}
<script type="text/javascript" src="{{ $shuffle.RelPermalink }}" defer></script>

{{ end }}

0 comments on commit 68aee2f

Please sign in to comment.