Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
X
x3domlet
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
3
Issues
3
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Elphel
x3domlet
Commits
54db8497
Commit
54db8497
authored
Jun 14, 2018
by
Oleg Dzhimiev
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
1. full screen
2. play N images
parent
7ce22d6e
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
51 additions
and
19 deletions
+51
-19
playloop.js
js/playloop.js
+50
-18
ui_init.js
js/ui_init.js
+1
-1
No files found.
js/playloop.js
View file @
54db8497
...
...
@@ -34,15 +34,7 @@
* for the JavaScript code in this page.
*/
var
SETTINGS
=
{
'path'
:
"models/1497599073_599932/x3d605/1497599073_599932"
,
'sufx'
:
"D0.0.jpeg"
,
'n'
:
4
,
'interval'
:
100
,
'order'
:
[
0
,
1
,
3
,
2
]
}
// already parsed by php
function
parseURL
(){
var
parameters
=
location
.
href
.
replace
(
/
\?
/ig
,
"&"
).
split
(
"&"
);
...
...
@@ -65,24 +57,59 @@ var images = [];
$
(
function
(){
init
();
resize
();
// initial resize
$
(
"#rotator img"
).
css
({
height
:
$
(
"#rotator"
).
height
()
});
});
function
resize
(){
// calc window size?
document
.
body
.
style
.
overflow
=
'hidden'
;
var
w
=
$
(
window
).
width
();
var
h
=
$
(
window
).
height
();
// panel height is fixed
var
ph
=
$
(
"#panel"
).
height
();
h
=
h
-
ph
;
console
.
log
(
w
+
" x "
+
h
);
$
(
"#rotator"
).
css
({
position
:
"absolute"
,
left
:
0
,
top
:
0
,
width
:
w
,
height
:
h
});
$
(
"#panel"
).
css
({
position
:
"absolute"
,
left
:
0
,
top
:
h
,
width
:
w
,
height
:
ph
});
}
function
init
(){
parseURL
();
//
parseURL();
index
=
SETTINGS
.
order
[
0
];
//load images
for
(
var
i
=
0
;
i
<
SETTINGS
.
n
;
i
++
){
imgs
.
push
(
SETTINGS
.
path
+
"-0"
+
(
SETTINGS
.
order
[
i
])
+
"-"
+
SETTINGS
.
sufx
);
images
[
i
]
=
new
Image
();
images
[
i
].
src
=
imgs
[
i
];
}
//load images
index
=
SETTINGS
.
order
[
0
];
init_rotator
(
document
.
getElementById
(
'rotator'
));
init_controls
(
document
.
getElementById
(
'rotator'
));
seti
(
index
);
...
...
@@ -93,7 +120,10 @@ function init_rotator(elem){
rotator
=
document
.
createElement
(
"img"
);
rotator
.
style
.
width
=
elem
.
offsetWidth
+
"px"
;
//rotator.style.width = elem.offsetWidth+"px";
$
(
rotator
).
css
({
height
:
$
(
elem
).
height
()
});
elem
.
appendChild
(
rotator
);
...
...
@@ -122,12 +152,14 @@ function init_rotator(elem){
}
function
set_n
(){
index
=
(
index
+
1
)
&
0x3
;
//index = (index+1)&0x3;
index
=
(
index
+
1
)
%
SETTINGS
.
n
;
seti
(
index
);
}
function
set_p
(){
index
=
(
index
-
1
)
&
0x3
;
//index = (index-1)&0x3;
index
=
(
index
-
1
)
%
SETTINGS
.
n
;
seti
(
index
);
}
...
...
js/ui_init.js
View file @
54db8497
...
...
@@ -175,7 +175,7 @@ function title_init(){
$("body").append(html);
*/
$
(
"#lpl"
).
attr
(
"href"
,
"playloop.
html?interval=1
00&sufx=D0.0.jpeg&path="
+
SETTINGS
.
basepath
+
"/"
+
SETTINGS
.
path
+
"/"
+
SETTINGS
.
version
+
"/"
+
SETTINGS
.
path
).
css
({
color
:
"white"
});
$
(
"#lpl"
).
attr
(
"href"
,
"playloop.
php?interval=2
00&sufx=D0.0.jpeg&path="
+
SETTINGS
.
basepath
+
"/"
+
SETTINGS
.
path
+
"/"
+
SETTINGS
.
version
+
"/"
+
SETTINGS
.
path
).
css
({
color
:
"white"
});
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment