Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
W
whats-open
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
1
Issues
1
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Nicholas J Anderson
whats-open
Commits
1f4bfb15
Commit
1f4bfb15
authored
Oct 26, 2013
by
Renfred Harper
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Smooth javascript transitions in info and about views
parent
0dac99d9
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
45 additions
and
19 deletions
+45
-19
website/static/css/style.css
website/static/css/style.css
+3
-4
website/static/js/about.js
website/static/js/about.js
+28
-12
website/static/js/info.js
website/static/js/info.js
+14
-3
No files found.
website/static/css/style.css
View file @
1f4bfb15
...
...
@@ -40,10 +40,6 @@ body {
background-size
:
cover
;
padding-top
:
50px
;
}
.clip
{
overflow
:
hidden
;
}
.title
{
text-align
:
center
;
font-size
:
50px
;
...
...
@@ -209,6 +205,9 @@ ul.ui-autocomplete {
-ms-transition
:
opacity
356ms
ease-in-out
,
-ms-filter
356ms
ease-in-out
;
transition
:
opacity
356ms
ease-in-out
,
"filter"
356ms
ease-in-out
;
}
.clip-height
{
max-height
:
60%
;
}
/* Custom Responsive Classes */
/* xs */
@media
(
min-width
:
480px
)
{
...
...
website/static/js/about.js
View file @
1f4bfb15
// Toggles the about page
$
(
document
).
ready
(
function
(){
var
lastosition
;
$
(
'
#about-link
'
).
click
(
function
(){
$
(
this
).
parent
().
toggleClass
(
'
active
'
);
$
(
'
#about-body
'
).
slideToggle
(
356
);
$
(
'
.main-container
'
).
toggleClass
(
'
grid-blur
'
);
// Prevent body from scolling when about section is active
$
(
'
body
'
).
toggleClass
(
'
clip
'
);
$
(
'
#about-link-text, #about-close-nav
'
).
toggle
();
// Keep track of the users vertical position so it can be scolled back
//to when the window is closed
position
=
$
(
window
).
scrollTop
();
console
.
log
(
position
);
$
(
'
#about-body
'
).
slideToggle
(
356
);
$
(
'
.main-container
'
).
toggleClass
(
'
grid-blur
'
);
$
(
this
).
parent
().
toggleClass
(
'
active
'
);
// Replace "About" link with the close icon
$
(
'
#about-link-text, #about-close-nav
'
).
toggle
();
// Prevent body from scolling when about section is active
$
(
'
.main-container
'
).
slideToggle
(
500
);
// Scroll back to top
$
(
'
html, body
'
).
animate
({
scrollTop
:
0
},
500
);
});
$
(
'
#about-close
'
).
click
(
function
(){
$
(
'
#about-link
'
).
parent
().
removeClass
(
'
active
'
);
$
(
'
#about-body
'
).
slideUp
(
356
);
$
(
'
.main-container
'
).
removeClass
(
'
grid-blur
'
);
$
(
'
body
'
).
removeClass
(
'
clip
'
);
$
(
'
#about-link-text
'
).
show
();
$
(
'
#about-close-nav
'
).
hide
();
$
(
'
#about-link
'
).
parent
().
removeClass
(
'
active
'
);
$
(
'
#about-body
'
).
slideUp
(
356
);
$
(
'
.main-container
'
).
removeClass
(
'
grid-blur
'
);
$
(
'
body
'
).
removeClass
(
'
clip
'
);
$
(
'
#about-link-text
'
).
show
();
$
(
'
#about-close-nav
'
).
hide
();
$
(
'
.main-container
'
).
show
();
// Scroll back to saved position
$
(
'
html, body
'
).
animate
({
scrollTop
:
position
},
500
);
});
});
website/static/js/info.js
View file @
1f4bfb15
...
...
@@ -33,6 +33,9 @@ $(document).ready(function() {
// Displays more info about a restaurant on-click
$
(
document
).
on
(
'
click
'
,
'
.grid-box
'
,
function
()
{
grid_id
=
$
(
this
).
attr
(
'
id
'
);
// Keep track of the users vertical position so it can be scolled back
//to when the window is closed
position
=
$
(
window
).
scrollTop
();
// Search though the restaurnts object to find the selected restaurant's info
var
restaurant
;
$
.
each
(
restaurants
,
function
(
idx
,
restaurant_i
)
{
...
...
@@ -91,13 +94,21 @@ $(document).ready(function() {
$
(
'
#info-body
'
).
slideDown
(
300
);
lastClicked
=
grid_id
;
}
if
(
$
(
window
).
width
()
<=
992
)
{
// On mobile displays, disable scrolling when info body is active
$
(
'
body
'
).
addClass
(
'
clip
'
);
if
(
$
(
window
).
width
()
<
992
)
{
// On mobile displays, hide grid to disable scrolling when info body is active
$
(
'
.main-container
'
).
slideToggle
(
500
);
// Scroll to top of page to prevent body from going out of view
$
(
'
html, body
'
).
animate
({
scrollTop
:
0
},
430
);
}
});
$
(
'
#info-close
'
).
click
(
function
()
{
$
(
'
#info-body
'
).
slideUp
(
350
);
$
(
'
body
'
).
removeClass
(
'
clip
'
);
$
(
'
.main-container
'
).
show
();
$
(
'
html, body
'
).
animate
({
scrollTop
:
position
},
350
);
});
});
\ 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