Fix function to scale resolutions to user's screen on Stackblitz
- or -
Post a project like this$20
- Posted:
- Proposals: 1
- Remote
- #3138637
- Expired
Description
Experience Level: Entry
Estimated project duration: 1 day or less
I have built a method to take x and y resolutions and scale them to the user's viewport. (most of the work is complete)
The problem is that the way it is currently built scales X and Y to ensure EACH fit. This is causing unusable results when one dimension fits and the other does not. The method needs to be re-thought.
https://stackblitz.com/edit/angular-rat-to-res
Specifications:
1. This function needs refactoring / potentially simplify if possible.
2. _screenx _screeny are your actual screen's dimensions (from window object - working in stackblitz)
3. This function accepts any x/y resolutions (think as small as 300x300 up to 15360×8640 (16k))
4. scale x and y to fit within the user's screen (could be a phone 320x568 or a huge 4K TV 3840x2160)
5. Fit within means scale to a dimension between 35%-50% of the user's screen
The problem is that the way it is currently built scales X and Y to ensure EACH fit. This is causing unusable results when one dimension fits and the other does not. The method needs to be re-thought.
https://stackblitz.com/edit/angular-rat-to-res
Specifications:
1. This function needs refactoring / potentially simplify if possible.
2. _screenx _screeny are your actual screen's dimensions (from window object - working in stackblitz)
3. This function accepts any x/y resolutions (think as small as 300x300 up to 15360×8640 (16k))
4. scale x and y to fit within the user's screen (could be a phone 320x568 or a huge 4K TV 3840x2160)
5. Fit within means scale to a dimension between 35%-50% of the user's screen
Ben R.
100% (1)Projects Completed
1
Freelancers worked with
1
Projects awarded
50%
Last project
17 May 2020
United States
New Proposal
Login to your account and send a proposal now to get this project.
Log inClarification Board Ask a Question
-
There are no clarification messages.
We collect cookies to enable the proper functioning and security of our website, and to enhance your experience. By clicking on 'Accept All Cookies', you consent to the use of these cookies. You can change your 'Cookies Settings' at any time. For more information, please read ourCookie Policy
Cookie Settings
Accept All Cookies