This repository has been archived by the owner on Jan 21, 2025. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
42481ff
commit 589dd06
Showing
8 changed files
with
220 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,66 @@ | ||
# Slide for presentation | ||
# | ||
class Controller.Slide extends Controller.Base | ||
|
||
# Constructs a new slide | ||
# | ||
# @param parent [Controller.Presentation] The presentation this slide belongs to | ||
# @param selector [String] A DOM selector | ||
# @param value [Object] An optional value for the element | ||
# | ||
constructor: ( @parent, @selector, @argument ) -> | ||
super( new View.Collection() ) | ||
|
||
Object.defineProperty( @, "element", | ||
get: () => $(@selector).first() | ||
) | ||
|
||
# Prepares the slide | ||
# | ||
prepare: ( done ) -> | ||
console.log "Preparing", @ | ||
@_moveTo @element, done | ||
|
||
# Animates the cursor to a specific DOM element | ||
# | ||
# @param element [JQuery] The element | ||
# @param done [Function] Function to execute when done moving | ||
# | ||
_moveTo: ( element = @element, done ) -> | ||
centreX = element.offset().left #+ 10 #(element.width() / 2 ) | ||
centreY = element.offset().top # + 10 #(element.height() / 2 ) | ||
console.log element.width() | ||
object = { | ||
top: centreY | ||
left: centreX | ||
} | ||
@parent.cursor.animate(object, 500,"swing", done) | ||
|
||
# Inputs a character into an element | ||
# | ||
# @param element [JQuery] The element to input into | ||
# @param char [Character] The character to input | ||
# | ||
_inputCharacter: ( element, char ) -> | ||
element.val( element.val() + char ) | ||
|
||
# Animates the input of value into element | ||
# | ||
_inputValue: ( element, value ) -> | ||
console.log "Inputting", value, "into", element | ||
element.val("") | ||
for i,character of value | ||
setTimeout( @_inputCharacter, i * 200, element, character ) | ||
|
||
|
||
# Presents this slide | ||
# | ||
present: ( ) -> | ||
console.log "Presenting", @ | ||
|
||
@element.select() | ||
if @argument | ||
@_inputValue @element, @argument | ||
else | ||
console.log @element | ||
@element.click() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
div#cursor { | ||
position: absolute; | ||
background-image: url("/img/cursor.png"); | ||
top: 400px; | ||
left: 500px; | ||
width: 13px; | ||
height: 15px; | ||
z-index: 1000; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,4 +7,4 @@ | |
</div> | ||
|
||
<div id="graphs" class="container"> | ||
</div> | ||
</div> |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.