Skip to content

Commit

Permalink
Merge branch 'main' into add-modular-cameras-to-camera-page
Browse files Browse the repository at this point in the history
  • Loading branch information
sguequierre authored Sep 8, 2023
2 parents 34a937e + ee07bb2 commit 6b3e3a0
Show file tree
Hide file tree
Showing 7 changed files with 17 additions and 8 deletions.
8 changes: 5 additions & 3 deletions static/js/carousel.js → assets/js/carousel.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,10 @@ document.addEventListener('DOMContentLoaded', function() {
});
const scrolllength = carousel.querySelector('ul li:nth-child(2)').offsetLeft - carousel.querySelector('ul li:nth-child(1)').offsetLeft;
const nthchild = (Math.round((ele.scrollLeft/scrolllength)+1));
carousel.querySelector('ol li:nth-child('+nthchild+')').classList.add('selected');
carousel.querySelector('ul li:nth-child('+nthchild+')').classList.add('selected');
let ol_elem = carousel.querySelector('ol li:nth-child('+nthchild+')');
let ul_elem = carousel.querySelector('ul li:nth-child('+nthchild+')');
if (ol_elem) { ol_elem.classList.add('selected'); }
if (ul_elem) { ul_elem.classList.add('selected'); }
if(carousel.parentElement.parentElement.querySelector('.dynamictitle')) {
const title = carousel.querySelector('ul li:nth-child('+nthchild+') img').getAttribute('title');
if(title) carousel.parentElement.parentElement.querySelector('.dynamictitle').innerHTML = title;
Expand Down Expand Up @@ -97,7 +99,7 @@ document.addEventListener('DOMContentLoaded', function() {
}

// Add CSS to hide arrows when all elements visible
var styles = "@media (min-width:" + (slides.length * 100 + 400) "px) {#board-carousel { padding: 0 !important; }#board-carousel div.prev, #board-carousel div.next {visibility: hidden;}}"
var styles = "@media (min-width:" + (slides.length * 100 + 400) + "px) {#board-carousel { padding: 0 !important; }#board-carousel div.prev, #board-carousel div.next {visibility: hidden;}}"

var styleSheet = document.createElement("style")
styleSheet.innerText = styles
Expand Down
File renamed without changes.
2 changes: 0 additions & 2 deletions docs/_index.md
Original file line number Diff line number Diff line change
Expand Up @@ -216,5 +216,3 @@ sitemap:
{{< card link="/tutorials/projects/integrating-viam-with-openai/" class="yellow">}}
</div>
</div>

<script type="text/javascript" src="js/carousel-min.js"></script>
2 changes: 1 addition & 1 deletion docs/extend/modular-resources/examples/tflite-module.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ This code is for instructional purposes only, and is not intended for production

You can find the example files in the [Viam C++ SDK](https://github.com/viamrobotics/viam-cpp-sdk):

- [`example_mlmodelservice_tflite.cpp`](https://github.com/viamrobotics/viam-cpp-sdk/blob/main/src/viam/examples/modules/example_mlmodelservice_tflite.cpp) - an example module which provides the `MLModelService` modular resource capable of running any TensorFlow Lite model.
- [`example_mlmodelservice_tflite.cpp`](https://github.com/viamrobotics/viam-cpp-sdk/blob/main/src/viam/examples/modules/tflite/main.cpp) - an example module which provides the `MLModelService` modular resource capable of running any TensorFlow Lite model.
- [`example_audio_classification_client.cpp`](https://github.com/viamrobotics/viam-cpp-sdk/blob/main/src/viam/examples/mlmodel/example_audio_classification_client.cpp) - an example inference client which generates audio samples and invokes the `example_mlmodelservice_tflite` module to classify those samples using the [`yamnet/classification` TensorFlow Lite model](https://tfhub.dev/google/lite-model/yamnet/classification/tflite/1).

## Build the C++ SDK
Expand Down
5 changes: 4 additions & 1 deletion layouts/docs/tutorials.html
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,10 @@ <h4 class="alert-heading">Javascript</h4>
<script src="https://cdn.jsdelivr.net/npm/typesense-instantsearch-adapter@2/dist/typesense-instantsearch-adapter.min.js"></script>

<script src="https://cdn.jsdelivr.net/npm/[email protected]"></script>
<script src="../js/tutorials.js"></script>

{{ $jsTutorials := resources.Get "js/tutorials.js" }}
{{ $jsTutorials := $jsTutorials | minify }}
<script type="text/javascript" src="{{ $jsTutorials.RelPermalink }}" crossorigin="anonymous"></script>

</body>
</html>
7 changes: 7 additions & 0 deletions layouts/partials/scripts.html
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@

{{ $jsCarousel := resources.Get "js/carousel.js" }}
{{ $jsCarousel := $jsCarousel | minify }}
{{ if eq .Page.Title "Viam Documentation" }}
<script type="text/javascript" src="{{$jsCarousel.RelPermalink}}" crossorigin="anonymous"></script>
{{ end }}

<!-- START script for lazy loading -->
<script type="text/javascript" src="https://cdn.jsdelivr.net/npm/lozad/dist/lozad.min.js"></script>
{{ $jsLozad := resources.Get "js/lozad.js" }}
Expand Down
1 change: 0 additions & 1 deletion static/js/carousel-min.js

This file was deleted.

0 comments on commit 6b3e3a0

Please sign in to comment.