Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Allow the IF card window to scale up. (But not down; it scrolls.)
- Loading branch information
Andrew Plotkin
authored and
Andrew Plotkin
committed
May 4, 2016
1 parent
d575e3d
commit 305bf85
Showing
3 changed files
with
28 additions
and
1 deletion.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
'use strict'; | ||
|
||
/* These are the values defined in main.js, not in the HTML. */ | ||
const base_width = 810; | ||
const base_height = 600; | ||
|
||
function evhan_resize(ev) | ||
{ | ||
var width = $(window).width(); | ||
var height = $(window).height(); | ||
|
||
var ratio = Math.min(width / base_width, height / base_height); | ||
|
||
if (ratio < 1.0) | ||
$('#card').css('transform', ''); | ||
else | ||
$('#card').css('transform', 'scale('+ratio+','+ratio+')'); | ||
} | ||
|
||
$(document).ready(function() { | ||
$('#card').css('transform-origin', 'top left'); | ||
$('#card').css('margin-left', '10px'); | ||
$(window).on('resize', evhan_resize); | ||
}); |
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