Skip to content

Commit

Permalink
change figures to images. try custom js
Browse files Browse the repository at this point in the history
  • Loading branch information
jbaylies committed Jan 5, 2024
1 parent e805216 commit fc93a82
Show file tree
Hide file tree
Showing 11 changed files with 50 additions and 9 deletions.
38 changes: 38 additions & 0 deletions docs/_static/js/theme_switcher.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
const createThemeSwitcher = () => {
let btn = document.createElement('BUTTON');
btn.className = 'theme-switcher';
btn.id = 'themeSwitcher';
btn.innerHTML =
'<i id=themeMoon class="fa fa-moon-o"></i><i id=themeSun class="fa fa-sun-o"></i>';
document.body.appendChild(btn);

if (localStorage.getItem('theme') === 'dark') $('#themeMoon').hide(0);
else $('#themeSun').hide(0);
};

$(document).ready(() => {
createThemeSwitcher();
$('#themeSwitcher').click(switchTheme);

$('footer').html(
$('footer').html()
);
});

const switchTheme = () => {
if (localStorage.getItem('theme') === 'dark') {
localStorage.setItem('theme', 'light');
document.documentElement.setAttribute('data-theme', 'light');

$('#themeSun').fadeOut(400, () => {
$('#themeMoon').fadeIn(400);
});
} else {
localStorage.setItem('theme', 'dark');
document.documentElement.setAttribute('data-theme', 'dark');

$('#themeMoon').fadeOut(400, () => {
$('#themeSun').fadeIn(400);
});
}
};
3 changes: 3 additions & 0 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,9 @@
# or fully qualified paths (eg. https://...)
html_css_files = ['css/custom.css']

html_js_files = [
'js/theme_switcher.js']

# Custom sidebar templates, must be a dictionary that maps document names
# to template names.
#
Expand Down
2 changes: 1 addition & 1 deletion docs/content/bindings.rst
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ Controller Bindings
pcl.rst
deadzones.rst

.. figure:: media/bindings.png
.. image:: media/bindings.png
:width: 100%
:align: center
:alt: bindings window
2 changes: 1 addition & 1 deletion docs/content/deadzones.rst
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Deadzones
=========

.. figure:: media/deadzones.png
.. image:: media/deadzones.png
:width: 100%
:align: center
:alt: deadzones.png
Expand Down
2 changes: 1 addition & 1 deletion docs/content/io.rst
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Audio IO
========

.. figure:: media/io.png
.. image:: media/io.png
:width: 100%
:align: center
:alt: io.png
Expand Down
2 changes: 1 addition & 1 deletion docs/content/main.rst
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ SousaFX Main Window

This window displays SousaFX's signalflow.

.. figure:: media/main.gif
.. image:: media/main.gif
:align: center
:width: 100%
:alt: main.gif
Expand Down
2 changes: 1 addition & 1 deletion docs/content/midi.rst
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
MIDI Preferences
================

.. figure:: media/midi.png
.. image:: media/midi.png
:width: 100%
:align: center
:alt: midi
2 changes: 1 addition & 1 deletion docs/content/modparms.rst
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Modulation Parameters
=====================

.. figure:: media/LPFmod.png
.. image:: media/LPFmod.png
:width: 100%
:align: center
:alt: mod parms
2 changes: 1 addition & 1 deletion docs/content/pcl.rst
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Parameter Control Logic
=======================

.. figure:: media/param-control-logic.png
.. image:: media/param-control-logic.png
:width: 100%
:align: center
:alt: param-control-logic.png
2 changes: 1 addition & 1 deletion docs/content/purchase.rst
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ When you complete your purchase, a license key will be emailed to you ASAP (usua

Classroom licenses and discounted-to-commercial license upgrades are also offered. For these and any other license needs, please email sousastep@gmail.com

.. figure:: media/window-about-nolicense.png
.. image:: media/window-about-nolicense.png
:width: 90%
:align: center
:alt: window-about-nolicense.png
Expand Down
2 changes: 1 addition & 1 deletion docs/index.rst
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
SousaFX Documentation
=====================

.. figure:: content/media/synesthesia.gif
.. image:: content/media/synesthesia.gif
:width: 60%
:align: center
:alt: Work In Progress
Expand Down

0 comments on commit fc93a82

Please sign in to comment.