Skip to content

Commit 8969f76

Browse files
author
Kevin Paul
committed
Move gallery styling/js to custom files
1 parent b13e899 commit 8969f76

File tree

6 files changed

+80
-125
lines changed

6 files changed

+80
-125
lines changed

portal/_static/custom.css

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
.modal {
2+
display: none;
3+
position: fixed;
4+
background: #f8f9fa;
5+
border-radius: 5px;
6+
padding: 3rem;
7+
width: 60%;
8+
height: auto !important;
9+
top: 20%;
10+
left: 20%;
11+
z-index: 20001;
12+
}
13+
14+
.modal-backdrop {
15+
display: none;
16+
position: fixed;
17+
background: rgba(0, 0, 0, 0.5);
18+
top: 0;
19+
left: 0;
20+
height: 100vh;
21+
width: 100vw;
22+
z-index: 20000;
23+
}
24+
25+
.modal-btn {
26+
color: #1a658f;
27+
text-decoration: none;
28+
}
29+
30+
.modal-img {
31+
float: right;
32+
margin: 0 0 2rem 2rem;
33+
max-width: 300px;
34+
max-height: 300px;
35+
}
36+
37+
.gallery-thumbnail {
38+
display: block;
39+
float: left;
40+
margin: 0 0 auto 0;
41+
padding: 0;
42+
max-width: 160px;
43+
}
44+
45+
.card-subtitle {
46+
font-size: 0.8rem;
47+
}

portal/_static/custom.js

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
var buttons = document.querySelectorAll('.modal-btn')
2+
var backdrop = document.querySelector('.modal-backdrop')
3+
var modals = document.querySelectorAll('.modal')
4+
5+
function openModal(i) {
6+
backdrop.style.display = 'block'
7+
modals[i].style.display = 'block'
8+
}
9+
10+
function closeModal(i) {
11+
backdrop.style.display = 'none'
12+
modals[i].style.display = 'none'
13+
}
14+
15+
for (i = 0; i < buttons.length; i++) {
16+
buttons[i].addEventListener(
17+
'click',
18+
(function (j) {
19+
return function () {
20+
openModal(j)
21+
}
22+
})(i)
23+
)
24+
backdrop.addEventListener(
25+
'click',
26+
(function (j) {
27+
return function () {
28+
closeModal(j)
29+
}
30+
})(i)
31+
)
32+
}

sphinx_pythia_theme/static/css/pythia.css

Lines changed: 0 additions & 44 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

sphinx_pythia_theme/static/css/pythia.css.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 0 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -1,32 +0,0 @@
1-
var buttons = document.querySelectorAll('.modal-btn')
2-
var backdrop = document.querySelector('.modal-backdrop')
3-
var modals = document.querySelectorAll('.modal')
4-
5-
function openModal(i) {
6-
backdrop.style.display = 'block'
7-
modals[i].style.display = 'block'
8-
}
9-
10-
function closeModal(i) {
11-
backdrop.style.display = 'none'
12-
modals[i].style.display = 'none'
13-
}
14-
15-
for (i = 0; i < buttons.length; i++) {
16-
buttons[i].addEventListener(
17-
'click',
18-
(function (j) {
19-
return function () {
20-
openModal(j)
21-
}
22-
})(i)
23-
)
24-
backdrop.addEventListener(
25-
'click',
26-
(function (j) {
27-
return function () {
28-
closeModal(j)
29-
}
30-
})(i)
31-
)
32-
}

sphinx_pythia_theme/static/scss/pythia.scss

Lines changed: 0 additions & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -290,54 +290,6 @@ div.document.onepager {
290290
}
291291
}
292292

293-
// MODAL ELEMENTS -------------------------------------------------------------
294-
295-
.modal {
296-
display: none;
297-
position: fixed;
298-
background: $light;
299-
border-radius: 5px;
300-
padding: 3rem;
301-
width: 60%;
302-
height: auto !important;
303-
top: 20%;
304-
left: 20%;
305-
z-index: 20001;
306-
}
307-
308-
.modal-backdrop {
309-
display: none;
310-
position: fixed;
311-
background: rgba(0, 0, 0, 0.5);
312-
top: 0;
313-
left: 0;
314-
height: 100vh;
315-
width: 100vw;
316-
z-index: 20000;
317-
}
318-
319-
.modal-btn {
320-
padding: 1rem;
321-
margin: 0;
322-
color: $primary;
323-
}
324-
325-
.modal-img {
326-
float: right;
327-
margin: 0 0 2rem 2rem;
328-
max-width: 300px;
329-
max-height: 300px;
330-
}
331-
332-
// PANELS ELEMENTS ------------------------------------------------------------
333-
334-
.gallery-thumbnail {
335-
display: block;
336-
margin: 0 auto;
337-
padding: 0 0 1rem 0;
338-
max-height: 160px;
339-
}
340-
341293
// IFRAME ELEMENTS ------------------------------------------------------------
342294

343295
.iframe {

0 commit comments

Comments
 (0)