merged
This commit is contained in:
54
README.md
54
README.md
@@ -1,26 +1,28 @@
|
|||||||
# Mirva
|
# Mirva
|
||||||
|
|
||||||
A tool to create a web gallery from a single folder of images.
|
A tool to create a web gallery from a single folder of images.
|
||||||
Also .mp4 files are included in the gallery
|
Also .mp4 files are included in the gallery
|
||||||
|
|
||||||
## Installation
|
## Installation
|
||||||
|
|
||||||
Usage requires ImageMagick binaries! Make sure you have `convert` in PATH.
|
Usage requires ImageMagick binaries! Make sure you have `convert` in PATH.
|
||||||
|
|
||||||
Use pip or similar to install from source.
|
Use pip or similar to install from source.
|
||||||
|
|
||||||
ex.
|
ex.
|
||||||
|
|
||||||
`pip3 install --user --upgrade https://bitbucket.org/MoonQ/mirva/get/master.zip`
|
`pip3 install --user --upgrade https://bitbucket.org/MoonQ/mirva/get/master.zip`
|
||||||
|
|
||||||
or `pipx install https://bitbucket.org/MoonQ/mirva/get/master.zip`
|
or `pipx install https://bitbucket.org/MoonQ/mirva/get/master.zip`
|
||||||
|
|
||||||
## Usage
|
## Usage
|
||||||
|
|
||||||
Use the command line tool `mirva` to render web sites.
|
Use the command line tool `mirva` to render web sites.
|
||||||
|
|
||||||
|
note: Arrow keys left/right on web page move between images.
|
||||||
## Acknowledgements
|
|
||||||
|
|
||||||
Thank you Mirva for being a lustrous source of inspiration - May you stay
|
## Acknowledgements
|
||||||
full of joy and love!
|
|
||||||
|
Thank you Mirva for being a lustrous source of inspiration - May you stay
|
||||||
|
full of joy and love!
|
||||||
|
|||||||
@@ -1,4 +1,5 @@
|
|||||||
__version__ = "20220124.0"
|
__version__ = "20220124.0"
|
||||||
|
__version__ = "20211114.0"
|
||||||
|
|
||||||
|
|
||||||
def get_version():
|
def get_version():
|
||||||
|
|||||||
@@ -159,43 +159,7 @@ Released : 20110306
|
|||||||
<link rel="shortcut icon" href="{resource}/mirva.ico"/>
|
<link rel="shortcut icon" href="{resource}/mirva.ico"/>
|
||||||
<title>{page_title}</title>
|
<title>{page_title}</title>
|
||||||
<link href="{resource}/style.css" rel="stylesheet" type="text/css" media="screen" />
|
<link href="{resource}/style.css" rel="stylesheet" type="text/css" media="screen" />
|
||||||
<script>
|
<script src="{resource}/mirva.js"></script>
|
||||||
function r(f){{/in/.test(document.readyState)?setTimeout('r('+f+')',9):f()}}
|
|
||||||
r(function(){{
|
|
||||||
create_nav();
|
|
||||||
}});
|
|
||||||
function create_nav() {{
|
|
||||||
let navis = document.getElementsByClassName("navigation");
|
|
||||||
for (let i = 0; i<navis.length; i++) {{
|
|
||||||
if (i==navis.length-1) {{
|
|
||||||
navis[i].appendChild(create_button("up", navis[0]));
|
|
||||||
continue;
|
|
||||||
}}
|
|
||||||
if (navis[i-1]) {{
|
|
||||||
navis[i].appendChild(create_button("up", navis[i-1]));
|
|
||||||
}} else {{
|
|
||||||
navis[i].appendChild(create_button("up", document.body));
|
|
||||||
}}
|
|
||||||
if (navis[i+1]) {{
|
|
||||||
navis[i].appendChild(create_button("down", navis[i+1]));
|
|
||||||
}}
|
|
||||||
|
|
||||||
}}
|
|
||||||
}}
|
|
||||||
function create_button(direction, to) {{
|
|
||||||
let container = document.createElement('div');
|
|
||||||
container.classList.add("float_" + direction);
|
|
||||||
let button = document.createElement('img');
|
|
||||||
button.src = "{resource}/arrow_" + direction + ".png";
|
|
||||||
button.classList.add("navigation_button");
|
|
||||||
button.onclick = function(){{
|
|
||||||
to.parentElement.scrollIntoView({{behavior: "smooth"}});
|
|
||||||
}};
|
|
||||||
container.appendChild(button);
|
|
||||||
return container
|
|
||||||
}}
|
|
||||||
|
|
||||||
</script>
|
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
<div id="wrapper">
|
<div id="wrapper">
|
||||||
@@ -304,6 +268,7 @@ function create_button(direction, to) {{
|
|||||||
"arrow_down.png",
|
"arrow_down.png",
|
||||||
"banner.jpg",
|
"banner.jpg",
|
||||||
"mirva.ico",
|
"mirva.ico",
|
||||||
|
"mirva.js",
|
||||||
):
|
):
|
||||||
if os.path.exists(os.path.join(self.resource_dir, f)):
|
if os.path.exists(os.path.join(self.resource_dir, f)):
|
||||||
continue
|
continue
|
||||||
|
|||||||
82
mirva/resources/mirva.js
Normal file
82
mirva/resources/mirva.js
Normal file
@@ -0,0 +1,82 @@
|
|||||||
|
let current=-1;
|
||||||
|
function r(f){/in/.test(document.readyState)?setTimeout('r('+f+')',9):f()}
|
||||||
|
r(function(){
|
||||||
|
create_nav();
|
||||||
|
document.onkeydown = keyboard_entry;
|
||||||
|
document.onwheel = scroll_event;
|
||||||
|
|
||||||
|
});
|
||||||
|
function create_nav() {
|
||||||
|
let navis = document.getElementsByClassName("navigation");
|
||||||
|
for (let i = 0; i<navis.length; i++) {
|
||||||
|
if (i==navis.length-1) {
|
||||||
|
navis[i].appendChild(create_button("up", navis[0], 0));
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
if (navis[i-1]) {
|
||||||
|
navis[i].appendChild(create_button("up", navis[i-1], i-1));
|
||||||
|
} else {
|
||||||
|
navis[i].appendChild(create_button("up", document.body, 0));
|
||||||
|
}
|
||||||
|
if (navis[i+1]) {
|
||||||
|
navis[i].appendChild(create_button("down", navis[i+1], i+1));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
function create_button(direction, to, next) {
|
||||||
|
let container = document.createElement('div');
|
||||||
|
container.classList.add("float_" + direction);
|
||||||
|
let button = document.createElement('img');
|
||||||
|
button.src = ".mirva/arrow_" + direction + ".png";
|
||||||
|
button.classList.add("navigation_button");
|
||||||
|
button.onclick = function(){
|
||||||
|
to.parentElement.scrollIntoView({behavior: "smooth"});
|
||||||
|
current = next;
|
||||||
|
};
|
||||||
|
container.appendChild(button);
|
||||||
|
return container
|
||||||
|
}
|
||||||
|
function is_visible(el) {
|
||||||
|
let rect = el.getBoundingClientRect();
|
||||||
|
return rect.top < window.innerHeight && rect.bottom >= 0;
|
||||||
|
}
|
||||||
|
function scroll_event(ev) {
|
||||||
|
let navis = document.getElementsByClassName("navigation");
|
||||||
|
for (let i = 0; i<navis.length; i++) {
|
||||||
|
if (is_visible(navis[i])) {
|
||||||
|
current = i -1;
|
||||||
|
return
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
function keyboard_entry(ev) {
|
||||||
|
let kC = ev.keyCode;
|
||||||
|
let ctrlDown = ev.ctrlKey || ev.metaKey;
|
||||||
|
if (ctrlDown) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if ([32,33,34,35,36,37,38,39,40].indexOf(kC) == -1) {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
let navis = document.getElementsByClassName("navigation");
|
||||||
|
if (kC == '36') { // home
|
||||||
|
current = -1;
|
||||||
|
return
|
||||||
|
}
|
||||||
|
else if (kC == '35') { // end
|
||||||
|
current = navis.length;
|
||||||
|
return
|
||||||
|
}
|
||||||
|
else if (kC == '39') { // right
|
||||||
|
current += 1;
|
||||||
|
}
|
||||||
|
else if (kC == '37') { // left
|
||||||
|
current -= 1;
|
||||||
|
} else {
|
||||||
|
setTimeout(scroll_event, 100);
|
||||||
|
return
|
||||||
|
}
|
||||||
|
current = Math.max(0, current);
|
||||||
|
current = Math.min(navis.length-1, current);
|
||||||
|
navis[current].parentElement.scrollIntoView({behavior: "smooth"});
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user