Skip to content

Commit

Permalink
Library code first commit
Browse files Browse the repository at this point in the history
  • Loading branch information
ines-akrap committed Mar 9, 2021
0 parents commit efa555d
Show file tree
Hide file tree
Showing 39 changed files with 6,580 additions and 0 deletions.
13 changes: 13 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
root = true

# Unix-style newlines with a newline ending every file
[*]
end_of_line = lf
trim_trailing_whitespace = true
insert_final_newline = true
charset = utf-8
indent_style = space
indent_size = 2

[*.md]
trim_trailing_whitespace = false
7 changes: 7 additions & 0 deletions .eslintrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"root": true,
"extends": "airbnb-base",
"env": {
"browser": true
}
}
5 changes: 5 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
npm-debug.log
node_modules

.DS_Store
.DS_Store?
9 changes: 9 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# Change Log

## 1.0.1 - 2021-02-23

- Adding dev init function to window

## 1.0.0 - 2021-02-22

- First release of ProgUX library
24 changes: 24 additions & 0 deletions LICENSE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
The MIT License

Copyright (c) 2021 Netcentric, a Cognizant Digital Business

Permission is hereby granted, free of charge,
to any person obtaining a copy of this software and
associated documentation files (the "Software"), to
deal in the Software without restriction, including
without limitation the rights to use, copy, modify,
merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom
the Software is furnished to do so,
subject to the following conditions:

The above copyright notice and this permission notice
shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR
ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
Binary file added assets/Logo_ProgUX.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/settings_modal.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/status_bar.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions dist/dev/dev-bundle.css

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions dist/dev/dev-bundle.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

11 changes: 11 additions & 0 deletions dist/index-dev.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<html>
<head>
<title>Progressive UX Dev Example</title>
<script src="dist/dev/dev-bundle.js"></script>
<link type="text/css" rel="stylesheet" href="dist/dev/dev-bundle.css">
<!-- dev bundles can be imported as modules -->
</head>
<body>
<h1>Progressive Page - Dev</h1>
</body>
</html>
14 changes: 14 additions & 0 deletions dist/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
<html>
<head>
<title>Progressive UX Prod Example</title>
<script type="application/javascript">
!function(){"use strict";const n=n=>"connection"in navigator?n.indexOf(navigator.connection.effectiveType)>=0?"slow":"fast":"unknown",e=n=>null!==sessionStorage.getItem(n),o=n=>{try{return e(n)?JSON.parse(sessionStorage.getItem(n)):{}}catch(n){return 0}};const t=(n,e)=>{((n,e)=>{try{sessionStorage.setItem(e,JSON.stringify(n))}catch(n){}})(n,e),function(n){const e=o(n),t=document.getElementsByTagName("html")[0];Object.entries(e).forEach((n=>{const[e,o]=n,r=`${e}-${o}`;t.classList.add(r)}))}(e)},r=e=>{const{lowRAM:o,lowCPU:t,slowConnectionTypes:r}=e;return{memoryLevel:(n=>{if(!("deviceMemory"in navigator))return"unknown";const e=navigator.deviceMemory;return e===n?"mid":e>n?"high":"low"})(o),cpuLevel:(n=>{if(!("hardwareConcurrency"in navigator))return"unknown";const e=navigator.hardwareConcurrency;return e===n?"mid":e>n?"high":"low"})(t),connectionSpeed:n(r),saveData:"connection"in navigator?navigator.connection.saveData:0,reducedMotion:window.matchMedia("(prefers-reduced-motion: reduce)").matches,doNotTrack:(()=>{const n="doNotTrack"in navigator,e="1"===navigator.doNotTrack;return n&&e})()}},s={settings:{lowRAM:4,lowCPU:4,slowConnectionTypes:["slow-2g","2g","3g"]},sessionStorageKey:"progressiveUserSettings"},i=i=>{const c={...s,...i},{sessionStorageKey:a}=c,g=o(a),d=e(a)?(e=>{const{slowConnectionTypes:o}=e;return{connectionSpeed:n(o)}})(c.settings):r(c.settings),u=Object.assign(g,d);t(u,a)};window.progUX=i}();
progUX({
sessionStorageKey: 'someOtherKeyName'
});
</script>
</head>
<body>
<h1>Progressive Page - Prod</h1>
</body>
</html>
Loading

0 comments on commit efa555d

Please sign in to comment.