Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
S
shower-presentation
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Шардт Максим Александрович
shower-presentation
Commits
994f9844
You need to sign in or sign up before continuing.
Commit
994f9844
authored
Nov 15, 2010
by
Vadim Makeev
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
progress bar
parent
4602d631
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
34 additions
and
8 deletions
+34
-8
index.htm
index.htm
+1
-0
script.js
scripts/script.js
+8
-3
projection.css
styles/projection.css
+25
-5
No files found.
index.htm
View file @
994f9844
...
@@ -142,6 +142,7 @@
...
@@ -142,6 +142,7 @@
<p>
Shower:
<a
href=
"http://github.com/pepelsbey/shower"
>
github.com/pepelsbey/shower
</a></p>
<p>
Shower:
<a
href=
"http://github.com/pepelsbey/shower"
>
github.com/pepelsbey/shower
</a></p>
</article>
</article>
</section>
</section>
<div
class=
"progress"
><div></div></div>
</div>
</div>
<script
src=
"scripts/script.js"
></script>
<script
src=
"scripts/script.js"
></script>
</body>
</body>
...
...
scripts/script.js
View file @
994f9844
(
function
()
{
(
function
()
{
var
url
=
document
.
location
,
var
url
=
document
.
location
,
linkScreen
=
document
.
querySelector
(
'link[title=screen]'
),
linkScreen
=
document
.
querySelector
(
'link[title=screen]'
),
linkProjection
=
document
.
querySelector
(
'link[title=projection]'
),
linkProjection
=
document
.
querySelector
(
'link[title=projection]'
),
shower
=
document
.
querySelector
(
'div.shower'
),
shower
=
document
.
querySelector
(
'div.shower'
),
slides
=
document
.
querySelectorAll
(
'section.slide'
),
slides
=
document
.
querySelectorAll
(
'section.slide'
),
slideList
=
[],
hashList
=
{},
slideList
=
[],
hashList
=
{},
progress
=
document
.
querySelector
(
'div.progress div'
),
fullscreen
=
false
;
fullscreen
=
false
;
for
(
var
i
=
0
,
slidesLength
=
slides
.
length
;
i
<
slidesLength
;
i
++
)
{
for
(
var
i
=
0
,
slidesLength
=
slides
.
length
;
i
<
slidesLength
;
i
++
)
{
...
@@ -20,6 +21,7 @@
...
@@ -20,6 +21,7 @@
screen
.
width
==
window
.
outerWidth
&&
screen
.
height
==
window
.
outerHeight
screen
.
width
==
window
.
outerWidth
&&
screen
.
height
==
window
.
outerHeight
);
);
updateView
();
updateView
();
updateProgress
();
}
}
function
turnSlide
(
e
)
{
function
turnSlide
(
e
)
{
...
@@ -43,8 +45,6 @@
...
@@ -43,8 +45,6 @@
case
32
:
// Space
case
32
:
// Space
current
+=
e
.
shiftKey
?
-
1
:
1
;
current
+=
e
.
shiftKey
?
-
1
:
1
;
break
;
break
;
default
:
return
;
}
}
target
=
slideList
[
current
];
target
=
slideList
[
current
];
e
.
preventDefault
();
e
.
preventDefault
();
...
@@ -52,6 +52,7 @@
...
@@ -52,6 +52,7 @@
target
=
slideList
[
+
e
||
0
];
target
=
slideList
[
+
e
||
0
];
}
}
if
(
target
)
url
.
hash
=
target
;
if
(
target
)
url
.
hash
=
target
;
updateProgress
();
}
}
function
updateView
()
{
function
updateView
()
{
...
@@ -59,6 +60,10 @@
...
@@ -59,6 +60,10 @@
linkProjection
.
disabled
=
!
fullscreen
;
linkProjection
.
disabled
=
!
fullscreen
;
if
(
!
hashList
[
url
.
hash
])
turnSlide
(
0
);
if
(
!
hashList
[
url
.
hash
])
turnSlide
(
0
);
}
}
function
updateProgress
()
{
progress
.
style
.
width
=
(
100
/
(
slideList
.
length
-
1
)
*
hashList
[
url
.
hash
]).
toFixed
(
2
)
+
'%'
;
}
slides
[
0
].
addEventListener
(
'click'
,
function
(){
slides
[
0
].
addEventListener
(
'click'
,
function
(){
toggleFull
(
true
);
toggleFull
(
true
);
...
...
styles/projection.css
View file @
994f9844
...
@@ -41,7 +41,7 @@ A {
...
@@ -41,7 +41,7 @@ A {
top
:
-1em
;
top
:
-1em
;
bottom
:
-1em
;
bottom
:
-1em
;
right
:
-1em
;
right
:
-1em
;
z-index
:
10
;
z-index
:
3
;
width
:
1.5em
;
width
:
1.5em
;
border
:
1em
solid
#000
;
border
:
1em
solid
#000
;
border-left-width
:
0
;
border-left-width
:
0
;
...
@@ -240,7 +240,6 @@ A {
...
@@ -240,7 +240,6 @@ A {
position
:
absolute
;
position
:
absolute
;
top
:
0
;
top
:
0
;
right
:
3em
;
right
:
3em
;
z-index
:
2
;
width
:
1em
;
width
:
1em
;
height
:
100%
;
height
:
100%
;
background
:
#000
;
background
:
#000
;
...
@@ -256,13 +255,13 @@ A {
...
@@ -256,13 +255,13 @@ A {
background
:
#000
;
background
:
#000
;
}
}
.slide.back
ARTICLE
{
.slide.back
ARTICLE
{
z-index
:
2
;
z-index
:
3
;
}
}
.slide.back
IMG
{
.slide.back
IMG
{
position
:
absolute
;
position
:
absolute
;
top
:
0
;
top
:
0
;
left
:
50%
;
left
:
50%
;
z-index
:
1
;
z-index
:
2
;
height
:
100%
;
height
:
100%
;
-webkit-transform-origin
:
50%
0
;
-webkit-transform-origin
:
50%
0
;
-webkit-transform
:
translate
(
-50%
,
0
);
-webkit-transform
:
translate
(
-50%
,
0
);
...
@@ -313,4 +312,25 @@ A {
...
@@ -313,4 +312,25 @@ A {
}
}
.slide.shout
:after
{
.slide.shout
:after
{
content
:
''
;
content
:
''
;
}
}
\ No newline at end of file
/* Progress
---------------------------------------- */
.progress
{
position
:
absolute
;
right
:
3em
;
bottom
:
0
;
left
:
3em
;
z-index
:
1
;
float
:
left
;
height
:
0.2em
;
background
:
#CCC
;
}
.progress
DIV
{
width
:
0
;
height
:
100%
;
background
:
#0174A7
;
-webkit-transition
:
width
0.2s
linear
;
-moz-transition
:
width
0.2s
linear
;
-o-transition
:
width
0.2s
linear
;
}
\ No newline at end of file
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