Skip to content

Commit

Permalink
added arrows
Browse files Browse the repository at this point in the history
  • Loading branch information
NOTMEE12 committed Jun 5, 2023
1 parent 8c4e685 commit 177598f
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 20 deletions.
12 changes: 7 additions & 5 deletions docs/reST/_static/sections.js
Original file line number Diff line number Diff line change
@@ -1,22 +1,24 @@
function toggleSectionVisibility(section){
function toggleSectionVisibility(section, message){
document.getElementById(section).hidden = ! document.getElementById(section).hidden;
if (document.getElementById(section).hidden === true){
if (document.getElementById(section).hidden === true){ // show
items = localStorage.getItem('hidden');
if (items !== null){
if (!(items.includes(section))){
items = items + '|' + section + '|';
items = items + section + '|';
}
localStorage.setItem('hidden', items);
} else {
localStorage.setItem('hidden', section);
localStorage.setItem('hidden', section + '|');
}
} else {
document.getElementById(section[0]).innerHTML = document.getElementById(section[0]).innerHTML.replace('▼', '▲')
} else { // hide
items = localStorage.getItem('hidden');
if (items !== null){
if (items.includes(section)){
items = items.replace(section + '|', '')
}
localStorage.setItem('hidden', items);
}
document.getElementById(section[0]).innerHTML = document.getElementById(section[0]).innerHTML.replace('▲', '▼')
}
}
20 changes: 12 additions & 8 deletions docs/reST/themes/classic/elements.html
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ <h5>pygame-ce documentation</h5>
<img class="theme-icon" data-theme="light-theme" src="{{ pathto('_static/dark-theme-icon.svg', 1) }}" width="24" height="24" alt="Dark Theme Icon">
</div>
<form action="{{ pathto('search') }}" method="get" class="searchbar-form" style="display:inline;float:right;">
<input name="q" value="" type="text">
<input name="q" value="" type="text" style="::-webkit-border-radius: 20px;-moz-border-radius: 20px; border-radius: 20px;">
<img class="searchbar-button" src="{{ pathto('_static/searchbar-icon.svg', 1) }}" alt="Search">
<input class="searchbar-submit" value="search" type="submit">
</form>
Expand All @@ -53,7 +53,7 @@ <h5>pygame-ce documentation</h5>
{%- set hidden = ['Overlay', 'cdrom', 'sdl2_video', 'sdl2_controller'] %}
{%- if pyg_sections %}

<p class="bottom" onclick="toggleSectionVisibility('Window');"><b>Window</b><br></p>
<p class="bottom" onclick="toggleSectionVisibility('Window');" id="W"><b>Window</b><br></p>
<div class="bottom" id="Window">
{% set sep = joiner("<br>") %}
{%- for section in pyg_sections %}
Expand All @@ -71,7 +71,7 @@ <h5>pygame-ce documentation</h5>
</div>

<hr style="color:#222222;border-bottom:none;border-style: solid;border-bottom-style:none;">
<p class="bottom" onclick="toggleSectionVisibility('Drawing');"><b>Drawing / Surface</b><br></p>
<p class="bottom" onclick="toggleSectionVisibility('Drawing');" id="D"><b>Drawing / Surface</b><br></p>
<div class="bottom" id="Drawing">
{% set sep = joiner("<br>") %}
{%- for section in pyg_sections %}
Expand All @@ -89,7 +89,7 @@ <h5>pygame-ce documentation</h5>
</div>

<hr style="color:#222222;border-bottom:none;border-style: solid;border-bottom-style:none;">
<p class="bottom" onclick="toggleSectionVisibility('Events');"><b>Events/Input</b><br></p>
<p class="bottom" onclick="toggleSectionVisibility('Events');" id="E"><b>Events/Input</b><br></p>
<div class="bottom" id="Events">
{% set sep = joiner("<br>") %}
{%- for section in pyg_sections %}
Expand All @@ -107,7 +107,7 @@ <h5>pygame-ce documentation</h5>
</div>

<hr style="color:#222222;border-bottom:none;border-style: solid;border-bottom-style:none;">
<p class="bottom" onclick="toggleSectionVisibility('Collisions');"><b>Collisions</b><br></p>
<p class="bottom" onclick="toggleSectionVisibility('Collisions');" id="C"><b>Collisions</b><br></p>
<div class="bottom" id="Collisions">
{% set sep = joiner("<br>") %}
{%- for section in pyg_sections %}
Expand All @@ -125,7 +125,7 @@ <h5>pygame-ce documentation</h5>
</div>

<hr style="color:#222222;border-bottom:none;border-style: solid;border-bottom-style:none;">
<p class="bottom" onclick="toggleSectionVisibility('Music');"><b>Music</b><br></p>
<p class="bottom" onclick="toggleSectionVisibility('Music');" id="M"><b>Music</b><br></p>
<div class="bottom" id="Music">
{% set sep = joiner("<br>") %}
{%- for section in pyg_sections %}
Expand All @@ -143,7 +143,7 @@ <h5>pygame-ce documentation</h5>
</div>

<hr style="color:#222222;border-bottom:none;border-style: solid;border-bottom-style:none;">
<p class="bottom" onclick="toggleSectionVisibility('Other')"><b>Other</b><br></p>
<p class="bottom" onclick="toggleSectionVisibility('Other')" id="O"><b>Other</b><br></p>
<div class="bottom" id="Other">
{% set sep = joiner("<br>") %}
{%- for section in pyg_sections %}
Expand Down Expand Up @@ -181,7 +181,11 @@ <h5>pygame-ce documentation</h5>
<script type="text/javascript">
if (localStorage.getItem('hidden') !== null){
localStorage.getItem('hidden').split("|").forEach(element => {
if (document.getElementById(element) !== null) {document.getElementById(element).hidden = true};
if (document.getElementById(element) !== null) {
document.getElementById(element).hidden = true
console.log(document.getElementById(element[0]).innerHTML)
document.getElementById(element[0]).innerHTML = document.getElementById(element[0]).innerHTML.replace('▼', '▲')
};
});
}
</script>
Expand Down
13 changes: 6 additions & 7 deletions docs/reST/themes/classic/static/pygame.css_t
Original file line number Diff line number Diff line change
Expand Up @@ -299,14 +299,13 @@ div.document {
::-webkit-scrollbar-thumb:hover {
background: #4ace08;
}
.dark-theme {
::-webkit-scrollbar-thumb {
background: #888
}
::-webkit-scrollbar-thumb:hover {
background: #555;
}
.dark-theme ::-webkit-scrollbar-thumb {
background: #888
}
.dark-theme ::-webkit-scrollbar-thumb:hover {
background: #555;
}

.flex-container {
display: block;
flex-direction: column;
Expand Down

0 comments on commit 177598f

Please sign in to comment.