1.0.1 release
This commit is contained in:
parent
6b168e67d7
commit
192b1886c7
13 changed files with 134 additions and 83 deletions
7
CHANGES
7
CHANGES
|
@ -2,6 +2,13 @@
|
||||||
Changes
|
Changes
|
||||||
=======
|
=======
|
||||||
|
|
||||||
|
1.0.1 (*2021-06-03*)
|
||||||
|
====================
|
||||||
|
|
||||||
|
- Fix translation
|
||||||
|
- Add timer option
|
||||||
|
- Better CSS and transition
|
||||||
|
|
||||||
1.0.0 (*2021-05-28*)
|
1.0.0 (*2021-05-28*)
|
||||||
====================
|
====================
|
||||||
|
|
||||||
|
|
|
@ -39,6 +39,7 @@ Just use the galleria directive like this:
|
||||||
:hide_title: Flag - hide title under image (not in dialog) - image level
|
:hide_title: Flag - hide title under image (not in dialog) - image level
|
||||||
:hide_alt: Flag - hide alternative text under image - image level
|
:hide_alt: Flag - hide alternative text under image - image level
|
||||||
:no_transition: Flag - avoid transition effect - node level
|
:no_transition: Flag - avoid transition effect - node level
|
||||||
|
:timer: (optional) Go to next image each timer seconds
|
||||||
:class: (optional) HTML class for gallery - node level
|
:class: (optional) HTML class for gallery - node level
|
||||||
|
|
||||||
Image level options are same for all images defined by
|
Image level options are same for all images defined by
|
||||||
|
|
|
@ -10,7 +10,7 @@ license-files =
|
||||||
[extract_messages]
|
[extract_messages]
|
||||||
mapping_file = babel.cfg
|
mapping_file = babel.cfg
|
||||||
output_file = sphinx_galleria/locale/sphinx.pot
|
output_file = sphinx_galleria/locale/sphinx.pot
|
||||||
keywords = _ l_ lazy_gettext gettext ngettext
|
keywords = _ __ l_ lazy_gettext gettext ngettext
|
||||||
add_comments = Translators:
|
add_comments = Translators:
|
||||||
|
|
||||||
[init_catalog]
|
[init_catalog]
|
||||||
|
|
27
setup.py
27
setup.py
|
@ -1,35 +1,13 @@
|
||||||
from setuptools import setup
|
from setuptools import setup
|
||||||
import distutils
|
|
||||||
from babel.messages import frontend as babel
|
from babel.messages import frontend as babel
|
||||||
|
|
||||||
|
|
||||||
class TranslateCommand(distutils.cmd.Command):
|
|
||||||
description = "Translation"
|
|
||||||
|
|
||||||
user_options = []
|
|
||||||
sub_commands = [
|
|
||||||
('extract_messages', None),
|
|
||||||
('update_catalog', None),
|
|
||||||
('compile_catalog', None),
|
|
||||||
]
|
|
||||||
|
|
||||||
def initialize_options(self):
|
|
||||||
pass
|
|
||||||
|
|
||||||
def finalize_options(self):
|
|
||||||
pass
|
|
||||||
|
|
||||||
def run(self):
|
|
||||||
for cmd_name in self.get_sub_commands():
|
|
||||||
self.run_command(cmd_name)
|
|
||||||
|
|
||||||
|
|
||||||
with open("README.rst", "r") as fh:
|
with open("README.rst", "r") as fh:
|
||||||
long_description = fh.read()
|
long_description = fh.read()
|
||||||
|
|
||||||
setup(
|
setup(
|
||||||
name="sphinx_galleria",
|
name="sphinx_galleria",
|
||||||
version="1.0.0",
|
version="1.0.1",
|
||||||
url="https://procrastinator.nerv-project.eu/nerv-project/sphinx_galleria",
|
url="https://procrastinator.nerv-project.eu/nerv-project/sphinx_galleria",
|
||||||
license="EUPL 1.2",
|
license="EUPL 1.2",
|
||||||
author="Kujiu",
|
author="Kujiu",
|
||||||
|
@ -49,6 +27,9 @@ setup(
|
||||||
"*.py",
|
"*.py",
|
||||||
"static/sphinxgalleria/*.mjs",
|
"static/sphinxgalleria/*.mjs",
|
||||||
"static/sphinxgalleria/*.css",
|
"static/sphinxgalleria/*.css",
|
||||||
|
"locale/*.pot",
|
||||||
|
"locale/*/LC_MESSAGES/*.po",
|
||||||
|
"locale/*/LC_MESSAGES/*.mo",
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
install_requires=["sphinx>=3.0.0"],
|
install_requires=["sphinx>=3.0.0"],
|
||||||
|
|
|
@ -14,7 +14,7 @@ from PIL import Image
|
||||||
from . import directive
|
from . import directive
|
||||||
from . import collector
|
from . import collector
|
||||||
|
|
||||||
__version_info__ = (1, 0, 0)
|
__version_info__ = (1, 0, 1)
|
||||||
__version__ = '.'.join([str(val) for val in __version_info__])
|
__version__ = '.'.join([str(val) for val in __version_info__])
|
||||||
|
|
||||||
|
|
||||||
|
@ -112,4 +112,10 @@ def setup(app: Sphinx) -> Dict[str, Any]:
|
||||||
app.add_env_collector(collector.GalleriaCollector)
|
app.add_env_collector(collector.GalleriaCollector)
|
||||||
app.connect('env-updated', install_static_files)
|
app.connect('env-updated', install_static_files)
|
||||||
app.connect('env-updated', copy_images_files)
|
app.connect('env-updated', copy_images_files)
|
||||||
|
|
||||||
|
locale_path = os.path.join(
|
||||||
|
os.path.abspath(os.path.dirname(__file__)),
|
||||||
|
'locale'
|
||||||
|
)
|
||||||
|
app.add_message_catalog('sphinx', locale_path)
|
||||||
return {'version': __version__}
|
return {'version': __version__}
|
||||||
|
|
|
@ -21,6 +21,17 @@ from sphinx.util.osutil import relative_uri
|
||||||
from sphinx.locale import _
|
from sphinx.locale import _
|
||||||
|
|
||||||
|
|
||||||
|
def length_or_percentage_or_unitless(argument: str):
|
||||||
|
length_units = [
|
||||||
|
'em', 'rem', 'ex',
|
||||||
|
'px', 'pt',
|
||||||
|
'in', 'cm', 'mm', 'pt', 'pc',
|
||||||
|
'vh', 'vw',
|
||||||
|
'%', ''
|
||||||
|
]
|
||||||
|
return directives.get_measure(argument, length_units)
|
||||||
|
|
||||||
|
|
||||||
class galleria(nodes.General, nodes.Element):
|
class galleria(nodes.General, nodes.Element):
|
||||||
pass
|
pass
|
||||||
|
|
||||||
|
@ -112,13 +123,14 @@ class GalleriaDirective(Directive):
|
||||||
final_argument_whitespace = True
|
final_argument_whitespace = True
|
||||||
|
|
||||||
option_spec = {
|
option_spec = {
|
||||||
"class": directives.class_option,
|
'class': directives.class_option,
|
||||||
"galleria": directives.unchanged,
|
'galleria': directives.unchanged,
|
||||||
"alt": directives.unchanged,
|
'alt': directives.unchanged,
|
||||||
"title": directives.unchanged,
|
'title': directives.unchanged,
|
||||||
"thumbsize": directives.unchanged,
|
'thumbsize': directives.unchanged,
|
||||||
'width': directives.length_or_percentage_or_unitless,
|
'timer': directives.nonnegative_int,
|
||||||
'height': directives.length_or_unitless,
|
'width': length_or_percentage_or_unitless,
|
||||||
|
'height': length_or_percentage_or_unitless,
|
||||||
'align': align_choices,
|
'align': align_choices,
|
||||||
'hide_title': directives.flag,
|
'hide_title': directives.flag,
|
||||||
'hide_alt': directives.flag,
|
'hide_alt': directives.flag,
|
||||||
|
@ -161,11 +173,13 @@ class GalleriaDirective(Directive):
|
||||||
if self.options.get('class'):
|
if self.options.get('class'):
|
||||||
node['class'] = ' '.join(self.options['class'])
|
node['class'] = ' '.join(self.options['class'])
|
||||||
|
|
||||||
node['options']["width"] = self.options.get('width') or 'auto'
|
node['options']["width"] = self.options.get('width') or 'unset'
|
||||||
node['options']["height"] = self.options.get('height') or 'auto'
|
node['options']["height"] = self.options.get('height') or 'unset'
|
||||||
node['options']["align"] = self.options.get('align') or 'center'
|
node['options']["align"] = self.options.get('align') or 'center'
|
||||||
node['options']["no_transition"] = 'no_transition' in self.options
|
node['options']["no_transition"] = 'no_transition' in self.options
|
||||||
|
|
||||||
|
node['options']["timer"] = self.options.get('timer')
|
||||||
|
|
||||||
images_path = self.arguments
|
images_path = self.arguments
|
||||||
for path in images_path:
|
for path in images_path:
|
||||||
image = {}
|
image = {}
|
||||||
|
|
Binary file not shown.
|
@ -8,30 +8,40 @@ msgid ""
|
||||||
msgstr ""
|
msgstr ""
|
||||||
"Project-Id-Version: sphinx_galleria 1.0.0\n"
|
"Project-Id-Version: sphinx_galleria 1.0.0\n"
|
||||||
"Report-Msgid-Bugs-To: EMAIL@ADDRESS\n"
|
"Report-Msgid-Bugs-To: EMAIL@ADDRESS\n"
|
||||||
"POT-Creation-Date: 2021-06-02 23:53+0200\n"
|
"POT-Creation-Date: 2021-06-03 18:40+0200\n"
|
||||||
"PO-Revision-Date: 2021-06-02 23:55+0200\n"
|
"PO-Revision-Date: 2021-06-02 23:55+0200\n"
|
||||||
|
"Last-Translator: \n"
|
||||||
"Language: fr\n"
|
"Language: fr\n"
|
||||||
"Language-Team: fr <LL@li.org>\n"
|
"Language-Team: fr <LL@li.org>\n"
|
||||||
"Plural-Forms: nplurals=2; plural=(n > 1);\n"
|
"Plural-Forms: nplurals=2; plural=(n > 1)\n"
|
||||||
"MIME-Version: 1.0\n"
|
"MIME-Version: 1.0\n"
|
||||||
"Content-Type: text/plain; charset=utf-8\n"
|
"Content-Type: text/plain; charset=utf-8\n"
|
||||||
"Content-Transfer-Encoding: 8bit\n"
|
"Content-Transfer-Encoding: 8bit\n"
|
||||||
"Generated-By: Babel 2.9.1\n"
|
"Generated-By: Babel 2.9.1\n"
|
||||||
"Last-Translator: \n"
|
|
||||||
"X-Generator: Poedit 2.4.3\n"
|
|
||||||
|
|
||||||
#: sphinx_galleria/directive.py:151
|
#: sphinx_galleria/collector.py:73
|
||||||
|
#, python-format
|
||||||
|
msgid "thumbsize %s is invalid (use 100x120 format)"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: sphinx_galleria/collector.py:112
|
||||||
|
#, python-format
|
||||||
|
msgid "image file not readable %s"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: sphinx_galleria/directive.py:162
|
||||||
msgid "Previous"
|
msgid "Previous"
|
||||||
msgstr "Précédent"
|
msgstr "Précédent"
|
||||||
|
|
||||||
#: sphinx_galleria/directive.py:152
|
#: sphinx_galleria/directive.py:163
|
||||||
msgid "Next"
|
msgid "Next"
|
||||||
msgstr "Suivant"
|
msgstr "Suivant"
|
||||||
|
|
||||||
#: sphinx_galleria/directive.py:153
|
#: sphinx_galleria/directive.py:164
|
||||||
msgid "Close"
|
msgid "Close"
|
||||||
msgstr "Fermer"
|
msgstr "Fermer"
|
||||||
|
|
||||||
#: sphinx_galleria/directive.py:154
|
#: sphinx_galleria/directive.py:165
|
||||||
msgid "Thumbnail, click to enlarge"
|
msgid "Thumbnail, click to enlarge"
|
||||||
msgstr "Vignette, cliquer pour agrandir"
|
msgstr "Vignette, cliquer pour agrandir"
|
||||||
|
|
||||||
|
|
Binary file not shown.
|
@ -8,30 +8,40 @@ msgid ""
|
||||||
msgstr ""
|
msgstr ""
|
||||||
"Project-Id-Version: sphinx_galleria 1.0.0\n"
|
"Project-Id-Version: sphinx_galleria 1.0.0\n"
|
||||||
"Report-Msgid-Bugs-To: EMAIL@ADDRESS\n"
|
"Report-Msgid-Bugs-To: EMAIL@ADDRESS\n"
|
||||||
"POT-Creation-Date: 2021-06-02 23:53+0200\n"
|
"POT-Creation-Date: 2021-06-03 18:40+0200\n"
|
||||||
"PO-Revision-Date: 2021-06-02 23:57+0200\n"
|
"PO-Revision-Date: 2021-06-02 23:57+0200\n"
|
||||||
|
"Last-Translator: \n"
|
||||||
"Language: nl\n"
|
"Language: nl\n"
|
||||||
"Language-Team: nl <LL@li.org>\n"
|
"Language-Team: nl <LL@li.org>\n"
|
||||||
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
|
"Plural-Forms: nplurals=2; plural=(n != 1)\n"
|
||||||
"MIME-Version: 1.0\n"
|
"MIME-Version: 1.0\n"
|
||||||
"Content-Type: text/plain; charset=utf-8\n"
|
"Content-Type: text/plain; charset=utf-8\n"
|
||||||
"Content-Transfer-Encoding: 8bit\n"
|
"Content-Transfer-Encoding: 8bit\n"
|
||||||
"Generated-By: Babel 2.9.1\n"
|
"Generated-By: Babel 2.9.1\n"
|
||||||
"Last-Translator: \n"
|
|
||||||
"X-Generator: Poedit 2.4.3\n"
|
|
||||||
|
|
||||||
#: sphinx_galleria/directive.py:151
|
#: sphinx_galleria/collector.py:73
|
||||||
|
#, python-format
|
||||||
|
msgid "thumbsize %s is invalid (use 100x120 format)"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: sphinx_galleria/collector.py:112
|
||||||
|
#, python-format
|
||||||
|
msgid "image file not readable %s"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: sphinx_galleria/directive.py:162
|
||||||
msgid "Previous"
|
msgid "Previous"
|
||||||
msgstr "Vorig"
|
msgstr "Vorig"
|
||||||
|
|
||||||
#: sphinx_galleria/directive.py:152
|
#: sphinx_galleria/directive.py:163
|
||||||
msgid "Next"
|
msgid "Next"
|
||||||
msgstr "Volgende"
|
msgstr "Volgende"
|
||||||
|
|
||||||
#: sphinx_galleria/directive.py:153
|
#: sphinx_galleria/directive.py:164
|
||||||
msgid "Close"
|
msgid "Close"
|
||||||
msgstr "Sluit"
|
msgstr "Sluit"
|
||||||
|
|
||||||
#: sphinx_galleria/directive.py:154
|
#: sphinx_galleria/directive.py:165
|
||||||
msgid "Thumbnail, click to enlarge"
|
msgid "Thumbnail, click to enlarge"
|
||||||
msgstr "Miniatuur, klik om te vergroten"
|
msgstr "Miniatuur, klik om te vergroten"
|
||||||
|
|
||||||
|
|
|
@ -7,9 +7,9 @@
|
||||||
#, fuzzy
|
#, fuzzy
|
||||||
msgid ""
|
msgid ""
|
||||||
msgstr ""
|
msgstr ""
|
||||||
"Project-Id-Version: sphinx_galleria 1.0.0\n"
|
"Project-Id-Version: sphinx_galleria 1.0.1\n"
|
||||||
"Report-Msgid-Bugs-To: EMAIL@ADDRESS\n"
|
"Report-Msgid-Bugs-To: EMAIL@ADDRESS\n"
|
||||||
"POT-Creation-Date: 2021-06-02 23:53+0200\n"
|
"POT-Creation-Date: 2021-06-03 18:40+0200\n"
|
||||||
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
|
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
|
||||||
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
|
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
|
||||||
"Language-Team: LANGUAGE <LL@li.org>\n"
|
"Language-Team: LANGUAGE <LL@li.org>\n"
|
||||||
|
@ -18,19 +18,29 @@ msgstr ""
|
||||||
"Content-Transfer-Encoding: 8bit\n"
|
"Content-Transfer-Encoding: 8bit\n"
|
||||||
"Generated-By: Babel 2.9.1\n"
|
"Generated-By: Babel 2.9.1\n"
|
||||||
|
|
||||||
#: sphinx_galleria/directive.py:151
|
#: sphinx_galleria/collector.py:73
|
||||||
|
#, python-format
|
||||||
|
msgid "thumbsize %s is invalid (use 100x120 format)"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: sphinx_galleria/collector.py:112
|
||||||
|
#, python-format
|
||||||
|
msgid "image file not readable %s"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: sphinx_galleria/directive.py:162
|
||||||
msgid "Previous"
|
msgid "Previous"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: sphinx_galleria/directive.py:152
|
#: sphinx_galleria/directive.py:163
|
||||||
msgid "Next"
|
msgid "Next"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: sphinx_galleria/directive.py:153
|
#: sphinx_galleria/directive.py:164
|
||||||
msgid "Close"
|
msgid "Close"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: sphinx_galleria/directive.py:154
|
#: sphinx_galleria/directive.py:165
|
||||||
msgid "Thumbnail, click to enlarge"
|
msgid "Thumbnail, click to enlarge"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
|
|
|
@ -2,6 +2,8 @@
|
||||||
text-align: center;
|
text-align: center;
|
||||||
box-sizing: border-box;
|
box-sizing: border-box;
|
||||||
margin-bottom: 1rem;
|
margin-bottom: 1rem;
|
||||||
|
display: flex;
|
||||||
|
flex-flow: column nowrap;
|
||||||
}
|
}
|
||||||
|
|
||||||
.sphinxgalleria-core.align-center {
|
.sphinxgalleria-core.align-center {
|
||||||
|
@ -22,11 +24,17 @@
|
||||||
.sphinxgalleria-core figure {
|
.sphinxgalleria-core figure {
|
||||||
margin: 0;
|
margin: 0;
|
||||||
padding: 0;
|
padding: 0;
|
||||||
|
flex-grow: 1000;
|
||||||
|
flex-shrink: 1000;
|
||||||
|
display: flex;
|
||||||
|
flex-flow: column nowrap;
|
||||||
}
|
}
|
||||||
|
|
||||||
.sphinxgalleria-core figure .row {
|
.sphinxgalleria-core figure .row {
|
||||||
flex-flow: row nowrap;
|
flex-flow: row nowrap;
|
||||||
display: flex;
|
display: flex;
|
||||||
|
flex-shrink: 1000;
|
||||||
|
flex-grow: 1000;
|
||||||
}
|
}
|
||||||
|
|
||||||
.sphinxgalleria-core figure .row button {
|
.sphinxgalleria-core figure .row button {
|
||||||
|
@ -44,7 +52,7 @@
|
||||||
border-radius: unset;
|
border-radius: unset;
|
||||||
box-sizing: border-box;
|
box-sizing: border-box;
|
||||||
width: 100%;
|
width: 100%;
|
||||||
height: max-content;
|
height: 100%;
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-flow: column nowrap;
|
flex-flow: column nowrap;
|
||||||
background-color: transparent;
|
background-color: transparent;
|
||||||
|
@ -74,13 +82,15 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
.sphinxgalleria-core figure .row button.button-modal img {
|
.sphinxgalleria-core figure .row button.button-modal img {
|
||||||
margin: 0;
|
margin: auto;
|
||||||
padding: 0;
|
padding: 0;
|
||||||
border: none;
|
border: none;
|
||||||
width: 100%;
|
width: auto;
|
||||||
height: auto;
|
height: auto;
|
||||||
object-fit: cover;
|
|
||||||
transition: width ease .4s, height ease .4s, opacity ease .4s;
|
transition: width ease .4s, height ease .4s, opacity ease .4s;
|
||||||
|
object-fit: contain;
|
||||||
|
flex-grow: 1000;
|
||||||
|
flex-shrink: 1000;
|
||||||
}
|
}
|
||||||
.sphinxgalleria-core.no-transition figure .row button.button-modal img {
|
.sphinxgalleria-core.no-transition figure .row button.button-modal img {
|
||||||
transition: unset;
|
transition: unset;
|
||||||
|
@ -88,6 +98,8 @@
|
||||||
|
|
||||||
.sphinxgalleria-core figure input[type=range] {
|
.sphinxgalleria-core figure input[type=range] {
|
||||||
width: 90%;
|
width: 90%;
|
||||||
|
margin-left: auto;
|
||||||
|
margin-right: auto;
|
||||||
height: 1.5rem;
|
height: 1.5rem;
|
||||||
border: none;
|
border: none;
|
||||||
-webkit-appearance: none;
|
-webkit-appearance: none;
|
||||||
|
@ -117,6 +129,7 @@
|
||||||
margin-top: -.5rem;
|
margin-top: -.5rem;
|
||||||
}
|
}
|
||||||
.sphinxgalleria-core figure input[type=range]:focus::-webkit-slider-runnable-track {
|
.sphinxgalleria-core figure input[type=range]:focus::-webkit-slider-runnable-track {
|
||||||
|
-webkit-appearance: none;
|
||||||
background-color: hsl(0, 0%, 34%);
|
background-color: hsl(0, 0%, 34%);
|
||||||
border: none;
|
border: none;
|
||||||
}
|
}
|
||||||
|
@ -244,12 +257,14 @@
|
||||||
|
|
||||||
.sphinxgalleria-core figure button.prev,
|
.sphinxgalleria-core figure button.prev,
|
||||||
.sphinxgalleria-core figure button.next {
|
.sphinxgalleria-core figure button.next {
|
||||||
background-color: hsl(0, 0%, 34%);
|
color: hsl(0, 0%, 34%);
|
||||||
color: white;
|
background-color: transparent;
|
||||||
height: 4rem;
|
font-size: 4rem;
|
||||||
width: 4rem;
|
padding: 1rem;
|
||||||
margin: auto .5rem auto .5rem;
|
height: 100%;
|
||||||
border-radius: 1rem;
|
display: inline;
|
||||||
|
vertical-align: middle;
|
||||||
|
margin: 1;
|
||||||
border: none;
|
border: none;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -257,26 +272,19 @@
|
||||||
.sphinxgalleria-core figure button.next:hover,
|
.sphinxgalleria-core figure button.next:hover,
|
||||||
.sphinxgalleria-core figure button.prev:focus,
|
.sphinxgalleria-core figure button.prev:focus,
|
||||||
.sphinxgalleria-core figure button.next:focus {
|
.sphinxgalleria-core figure button.next:focus {
|
||||||
background-color: hsl(0, 0%, 64%);
|
color: hsl(0, 0%, 64%);
|
||||||
transition: background-color ease .4s;
|
transition: color ease .4s;
|
||||||
}
|
|
||||||
|
|
||||||
.sphinxgalleria-core figure button.prev {
|
|
||||||
}
|
|
||||||
|
|
||||||
.sphinxgalleria-core figure button.next {
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.sphinxgalleria-core figure button.prev::before,
|
.sphinxgalleria-core figure button.prev::before,
|
||||||
.sphinxgalleria-core dialog menu button.prev::before {
|
.sphinxgalleria-core dialog menu button.prev::before {
|
||||||
margin-right: 0.5rem;
|
content: '<';
|
||||||
content: '←';
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.sphinxgalleria-core figure button.next::after,
|
.sphinxgalleria-core figure button.next::after,
|
||||||
.sphinxgalleria-core dialog menu button.next::after {
|
.sphinxgalleria-core dialog menu button.next::after {
|
||||||
margin-left: 0.5rem;
|
margin-left: 0.5rem;
|
||||||
content: '→';
|
content: '>';
|
||||||
}
|
}
|
||||||
|
|
||||||
.sphinxgalleria-core ul.thumbnails {
|
.sphinxgalleria-core ul.thumbnails {
|
||||||
|
@ -305,5 +313,6 @@
|
||||||
.sphinxgalleria-core ul.thumbnails li img {
|
.sphinxgalleria-core ul.thumbnails li img {
|
||||||
margin: 0.5rem;
|
margin: 0.5rem;
|
||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
|
object-fit: cover;
|
||||||
max-width: unset;
|
max-width: unset;
|
||||||
}
|
}
|
||||||
|
|
|
@ -146,6 +146,12 @@ export class SphinxGalleria {
|
||||||
self.dialog_button_close_icon.addEventListener('keypress', onclose);
|
self.dialog_button_close_icon.addEventListener('keypress', onclose);
|
||||||
|
|
||||||
if(!self.oneimage) {
|
if(!self.oneimage) {
|
||||||
|
if(self.options.timer){
|
||||||
|
setInterval(function(){
|
||||||
|
self.next();
|
||||||
|
}, self.options.timer*1000);
|
||||||
|
}
|
||||||
|
|
||||||
var onprev = function(event) {
|
var onprev = function(event) {
|
||||||
var key = event.key;
|
var key = event.key;
|
||||||
if(event.type==='keypress' && key!==" " && key!=="Enter") {
|
if(event.type==='keypress' && key!==" " && key!=="Enter") {
|
||||||
|
@ -314,12 +320,9 @@ export class SphinxGalleria {
|
||||||
self.node_slider.value = idx + 1;
|
self.node_slider.value = idx + 1;
|
||||||
}
|
}
|
||||||
var current_img = current.nextSibling.childNodes[0];
|
var current_img = current.nextSibling.childNodes[0];
|
||||||
self.node_thumbnails.scrollTo({
|
current_img.scrollIntoView({
|
||||||
left: current_img.x -
|
behavior: 'smooth',
|
||||||
self.node_thumbnails.offsetWidth/2 +
|
inline: 'center',
|
||||||
current_img.clientWidth/2,
|
|
||||||
top: 0,
|
|
||||||
behavior: 'smooth'
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue