generated from hjess/PythonTemplateProject
Bug somewhere
All checks were successful
Build, Push, and Deploy to Nomad / docker-nomad (push) Successful in 35s
All checks were successful
Build, Push, and Deploy to Nomad / docker-nomad (push) Successful in 35s
This commit is contained in:
@@ -53,12 +53,16 @@ def slider(options, images):
|
||||
html_content = []
|
||||
html_content.append('<div class="button-stack">')
|
||||
for i, val in enumerate(images):
|
||||
|
||||
modal_id = f"{modal_id}_{i}"
|
||||
modal_id_next = f"{modal_id}_{i+1}"
|
||||
|
||||
if int(len(images))<=int(i+1):
|
||||
modal_id_next = f"{modal_id}_0"
|
||||
if i % 2 == 0:
|
||||
html_content.append(f"""<button onclick="openModal('modal{i}')" class="stacked-button"> <img src="{val}" class="thumbnail"></button>""".strip())
|
||||
html_content.append(f"""<button onclick="openModal('modal{modal_id}')" class="stacked-button"> <img src="{val}" class="thumbnail"></button>""".strip())
|
||||
else:
|
||||
html_content.append(f"""<button onclick="openModal('modal{i}')" class="stacked-button"> <img src="{val}" class="thumbnail" ></button>""".strip())
|
||||
html_content.append(f"""<div class="modal" id="modal{i}"> <div class="modal-content"> <h2>Modal {i}</h2> <img src="{val}" width="80%" height="80%"> <button onclick="closeModal('modal{i}')">Close</button><button class="next-btn" onclick="nextModal('modal{i}', 'modal{i+1}')">Next</button></div> </div>""")
|
||||
html_content.append(f"""<button onclick="openModal('modal{modal_id}')" class="stacked-button"> <img src="{val}" class="thumbnail" ></button>""".strip())
|
||||
html_content.append(f"""<div class="modal" id="modal{modal_id}"> <div class="modal-content"> <h2>Modal {i}</h2> <img src="{val}" width="80%" height="80%"> <button onclick="closeModal('modal{i}')">Close</button><button class="next-btn" onclick="nextModal('modal{modal_id}', 'modal{modal_id_next}')">Next</button></div> </div>""")
|
||||
html_content.append( '</div>' )
|
||||
html = '\n'.join( html_content )
|
||||
|
||||
|
||||
Reference in New Issue
Block a user