This file contains hidden or 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
| var connectionCost = NetworkInformation.GetInternetConnectionProfile().GetConnectionCost(); | |
| if (connectionCost.NetworkCostType == NetworkCostType.Unknown | |
| || connectionCost.NetworkCostType == NetworkCostType.Unrestricted) | |
| { | |
| //Connection cost is unknown/unrestricted | |
| } | |
| else | |
| { | |
| //Metered Network | |
| } |
This file contains hidden or 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
| // register for network status change notifications | |
| networkStatusCallback = new NetworkStatusChangedEventHandler(OnNetworkStatusChange); | |
| if (!registeredNetworkStatusNotif) | |
| { | |
| NetworkInformation.NetworkStatusChanged += networkStatusCallback; | |
| registeredNetworkStatusNotif = true; | |
| } | |
| async void OnNetworkStatusChange(object sender) | |
| { |
This file contains hidden or 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
| <section class="mod model-1"> | |
| <div class="spinner"></div> | |
| </section> |
This file contains hidden or 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
| section { | |
| height: 110px; | |
| float: left; | |
| width: 50%; | |
| position: relative; | |
| } |
This file contains hidden or 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
| .spinner { | |
| width: 50px; | |
| height: 50px; | |
| border-radius: 100%; | |
| margin: auto; | |
| position: absolute; | |
| left: 0; | |
| right: 0; | |
| top: 0; | |
| bottom: 0; |
This file contains hidden or 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
| .model-1 { | |
| background: #fff; | |
| } | |
| .model-1 .spinner { | |
| color: #f00; | |
| -webkit-animation: color-bubble 2s linear 0s infinite; | |
| animation: color-bubble 2s linear 0s infinite; | |
| } | |
| .model-1 .spinner:after, .model-1 .spinner:before { | |
| content: ''; |
This file contains hidden or 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
| section { | |
| height: 110px; | |
| float: left; | |
| width: 50%; | |
| position: relative; | |
| } | |
| .spinner { | |
| width: 50px; |
This file contains hidden or 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
| var currentTop, | |
| currentLeft; | |
| /* With layout thrashing. */ | |
| currentTop = element.style.top; /* QUERY */ | |
| element.style.top = currentTop + 1; /* UPDATE */ | |
| currentLeft = element.style.left; /* QUERY */ | |
| element.style.left = currentLeft + 1; /* UPDATE */ |
This file contains hidden or 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
| var startingTop = 0; | |
| /* setInterval: Runs every 16ms to achieve 60fps (1000ms/60 ~= 16ms). */ | |
| setInterval(function() { | |
| /* Since this ticks 60 times a second, we divide the top property's increment of 1 unit per 1 second by 60. */ | |
| element.style.top = (startingTop += 1/60); | |
| }, 16); | |
| /* requestAnimationFrame: Attempts to run at 60fps based on whether the browser is in an optimal state. */ | |
| function tick () { |
This file contains hidden or 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
| $element | |
| /* Slide the element down into view. */ | |
| .velocity({ opacity: 1, top: "50%" }) | |
| /* After a delay of 1000ms, slide the element out of view. */ | |
| .velocity({ opacity: 0, top: "-50%" }, { delay: 1000 }); |