private void hideComparisonGrid(object sender, TappedRoutedEventArgs e) { switch (compareMode) { case CompareMode.Full: Storyboards.DissapearRight(comparisonGrid, collapseComparisonGrid); break; case CompareMode.Compare1: compareTransition = true; compareMode = CompareMode.Full; Storyboards.MoveToXAndFadeOut(compare1left, AppearTime, -App.Width / 2, fadeInCompareChart); Storyboards.MoveToXAndFadeOut(compare1right, AppearTime, App.Width / 2, null); break; case CompareMode.Compare2: compareTransition = true; compareMode = CompareMode.Full; Storyboards.MoveToXAndFadeOut(compare2left1, AppearTime, -App.Width / 2, fadeInCompareChart); Storyboards.MoveToXAndFadeOut(compare2rleft2, AppearTime, -App.Width / 2, null); Storyboards.MoveToXAndFadeOut(compare2right1, AppearTime, App.Width / 2, null); Storyboards.MoveToXAndFadeOut(compare2right2, AppearTime, App.Width / 2, null); Storyboards.MoveToXAndFadeOut(compare2right3, AppearTime, App.Width / 2, null); Storyboards.MoveToXAndFadeOut(compare2right4, AppearTime, App.Width / 2, null); break; } }
private void selectProduct(int id) { if (animating || id == currentProduct) { return; } animating = true; currentProduct = id; Storyboards.Fade(productImages[lastProduct], FadeTime, 0.5, 1, null); Storyboards.FadeOut(centerGrid, FadeTime / 2, fadeInNewProduct); setUsersImage(); if (currentProduct == 0) { Storyboards.FadeIn(assetImages[0], AppearTime, null); } for (int i = 2; i < NrOfAssets; i++) { bool hasFeature = ProductFeatures[currentProduct][i - 2]; assetImages[i].Source = hasFeature ? colorAssetSource[i] : grayAssetSource[i]; assetImages[i].Opacity = hasFeature ? 1.0 : GrayedOpacity; } setInfoBoxText(id); showAssets(); waveAssets(); lastProduct = currentProduct; Storyboards.Fade(productImages[currentProduct], FadeTime, 1, 0.5, doneAnimating); }
private void answerClosing(object sender, object e) { answersToClose--; if (answersToClose == 0) { closing = false; if (possibleProducts.Count == 1) { //Storyboards.DissapearLeft(rootGrid, toLoadingPage); timer.Stop(); answersGrid.Visibility = Visibility.Collapsed; Storyboards.FadeOut(dotImage, FadeOutTime, toLoadingPage); Storyboards.FadeOut(backButton, FadeOutTime, null); Storyboards.FadeOut(infoImage, FadeOutTime, null); Storyboards.FadeOut(questionOuterCircle, FadeOutTime, null); if (infoBox.Opacity > 0) { Storyboards.Fade(infoBox, FadeOutTime, infoBox.Opacity, 0, null); } App.SelectedProduct = possibleProducts[0]; } else { showQuestion(questionId + 1); } } }
private void showCompare1(object sender, object e) { comparisonChart.Visibility = Visibility.Collapsed; comparisonGridHP.Visibility = Visibility.Visible; Storyboards.MoveFromXAndFadeIn(compare1left, AppearTime, -App.Width / 2, finishCompareTransition); Storyboards.MoveFromXAndFadeIn(compare1right, AppearTime, App.Width / 2, null); }
private void hideVideo(object sender, object e) { video.Visibility = Visibility.Collapsed; updatePositions(); Storyboards.FadeIn(homeButton, AppearTime, splitCenterGrids); Storyboards.FadeIn(infoIcon, AppearTime, null); }
private void fadeInNewProduct(object sender, object e) { productImage.Source = productImages[currentProduct].Source; productTitle.Text = productName[currentProduct]; setProductHeader(); Storyboards.FadeIn(centerGrid, FadeTime / 2, null); }
public QuestionsIntro() { this.InitializeComponent(); this.Width = Double.NaN; this.Height = Double.NaN; Storyboards.PulseAndOpacityAnimate(imageAnim, 2200, 1500, 1.3); }
async void runScaleDelayed(int time, int id) { await Task.Delay(time); await Dispatcher.RunAsync(CoreDispatcherPriority.Normal, () => { Storyboards.Scale(assetImages[id], WaveTime, 1.0, WaveScale, true, null); }); }
public void animateColor() { Storyboards.ColorTransition(border, ColorAnimTime, ((SolidColorBrush)App.Current.Resources["Orange"]).Color, ((SolidColorBrush)App.Current.Resources["White"]).Color, null, "(Grid.Background).(SolidColorBrush.Color)"); }
private void animateHand() { animating = true; Storyboards.MoveXYAndFade(finger, AnimTime, 0, distance, 0, 0, AnimTime / 2, HandAlpha, 1.0, true, doneAnimating); if (StickListToAnim == true) { Storyboards.MoveY(stackPanel, 0, -distance, AnimTime, true, null); } }
private void compareHomeAndPersonal(object sender, TappedRoutedEventArgs e) { if (compareTransition) { return; } compareTransition = true; compareMode = CompareMode.Compare1; Storyboards.FadeOut(comparisonChart, FadeTime, showCompare1); }
async void runCompareAnimationDelayed(int time, int id) { await Task.Delay(time); await Dispatcher.RunAsync(CoreDispatcherPriority.Normal, () => { //comparisonImages[id].Opacity = 1.0; double shift = -comparisonGrids[id].ActualHeight * 2; Storyboards.MoveXYAndFadeIn(comparisonGrids[id], AppearTime, shift, shift, 0, 0, null); }); }
private void compare365And2016(object sender, TappedRoutedEventArgs e) { if (compareTransition) { return; } compareTransition = true; compareMode = CompareMode.Compare2; Storyboards.FadeOut(comparisonChart, FadeTime, showCompare2); }
private void hideFeaturesDetails(object sender, TappedRoutedEventArgs e) { Storyboards.DissapearBottom(featuresDetails, AppearTime, collapseFeaturesDetails); useScaleTargets = true; featuresDetailsMode = false; Storyboards.FadeIn(aUsersText, FadeTime, null); Storyboards.FadeIn(aDeviceText, FadeTime, null); aDevice.Source = singleDevice; showAssets(); }
private void showCompare2(object sender, object e) { comparisonChart.Visibility = Visibility.Collapsed; comparisonGrid365_2016.Visibility = Visibility.Visible; Storyboards.MoveFromXAndFadeIn(compare2left1, AppearTime, -App.Width / 2, finishCompareTransition); Storyboards.MoveFromXAndFadeIn(compare2rleft2, AppearTime, -App.Width / 2, null); Storyboards.MoveFromXAndFadeIn(compare2right1, AppearTime, App.Width / 2, null); Storyboards.MoveFromXAndFadeIn(compare2right2, AppearTime, App.Width / 2, null); Storyboards.MoveFromXAndFadeIn(compare2right3, AppearTime, App.Width / 2, null); Storyboards.MoveFromXAndFadeIn(compare2right4, AppearTime, App.Width / 2, null); }
private void showComparisonGrid(object sender, TappedRoutedEventArgs e) { /*if (UseComparisonAnimation) { * for (int i = 0; i < NrOfProducts; i++) * comparisonGrids[i].Opacity = 0.0; * Storyboards.AppearRight(comparisonGrid, animateComparisonChart); * } else {*/ animateComparisonChart(null, null); Storyboards.AppearRight(comparisonGrid, null); //} }
private void back_Tapped(object sender, TappedRoutedEventArgs e) { //if (animating) return; if (questionId > 0) { showQuestion(questionId - 1); } else { Storyboards.DissapearRight(rootGrid, backToHome); } }
private void showQuestion(int id) { //Debug.WriteLine("Show Question Animation."); animating = true; questionId = id; questionTextBlock.Opacity = 0; questionTextBlock.Text = questionText[id]; Storyboards.FadeIn(questionTextBlock, AnswerPopInTime, popInAnswers); infoBox.Title = infoBoxTitle[id]; infoBox.Description = infoBoxDescription[id]; button_click_numbers = 0; }
private void closeAnswers(object sender, object e) { //Debug.WriteLine("Close Answers Animation."); int phase = 0; Storyboards.FadeOut(questionTextBlock, AnswerPopInTime, null); foreach (Grid child in answersGrid.Children) { double radius = App.QuestionsOuterCircleDiameter / 2; Storyboards.MoveX(child, AnswersXOffset * radius, -radius, CloseAnswerPopOutTime + phase, answerClosing); phase += CloseAnswerPopOutPhase; } }
private void moveCenterGridUp(object sender, object e) { videoClosed = true; double toX = 0; double toY = -App.Height * yShift; Storyboards.MoveXY(video, AppearTime, 0, 0, toX, toY, hideVideo); Storyboards.MoveXY(centerGrid, AppearTime, 0, 0, toX, toY, null); Storyboards.MoveXY(subscriptionVsOneTimeGrid, AppearTime, 0, 0, toX, toY, null); productsPanel.Visibility = Visibility.Visible; Storyboards.MoveX(productsPanel, App.ProductStackPanelWidth, 0, AppearTime, null); Storyboards.FadeIn(whatsIncludedBtn, AppearTime, null); showAssets(); }
private void popInAnswers(object sender, object e) { //Debug.WriteLine("Pop In Answers Animation."); string[] answers = answerText[questionId].Split('|'); answersToClose = answers.Length; answersToAppear = answersToClose; updateAnswersGrid(); answersGrid.Children.Clear(); answersGrid.ColumnDefinitions.Clear(); answersGrid.RowDefinitions.Clear(); for (int i = 0; i < answers.Length; i++) { RowDefinition row = new RowDefinition(); row.Height = new GridLength(1.0, GridUnitType.Star); answersGrid.RowDefinitions.Add(row); } int phase = 0; for (int i = 0; i < answersToClose; i++) { Grid grid = new Grid(); grid.Tag = "" + questionId + "|" + i; grid.Tapped += setAnswer; grid.Background = (SolidColorBrush)App.Current.Resources["White"]; grid.BorderBrush = (SolidColorBrush)App.Current.Resources["Orange"]; grid.BorderThickness = new Thickness(0, i == 0 ? AnswersBorderThickness : 0, AnswersBorderThickness, AnswersBorderThickness); TextBlock tblock = new TextBlock(); Binding myBinding = new Binding(); myBinding.Source = App; myBinding.Path = new PropertyPath("AnswerFontSize"); myBinding.Mode = BindingMode.TwoWay; myBinding.UpdateSourceTrigger = UpdateSourceTrigger.PropertyChanged; BindingOperations.SetBinding(tblock, TextBlock.FontSizeProperty, myBinding); tblock.Style = (Style)App.Current.Resources["OrangeText"]; tblock.HorizontalAlignment = HorizontalAlignment.Center; tblock.VerticalAlignment = VerticalAlignment.Center; tblock.Text = answers[i]; grid.Children.Add(tblock); answersGrid.Children.Add(grid); Grid.SetRow(grid, i); Storyboards.MoveX(grid, -radius, AnswersXOffset * radius, CloseAnswerPopOutTime + phase, answerAppeared); phase += CloseAnswerPopOutPhase; } }
private void waveAssets() { Storyboards.MoveAndReverseY(infoIcon, 0, -aImgSize * WaveYFactor, WaveTime * 3, null); Storyboards.MoveAndReverseY(whatsIncludedBtn, 0, -aImgSize * WaveYFactor, WaveTime * 3, null); Storyboards.MoveAndReverseY(assetsGrid, 0, -aImgSize * WaveYFactor, WaveTime * 3, null); for (int i = 0; i < NrOfAssets; i++) { if (i < 2 || ProductFeatures[currentProduct][i - 2]) { runScaleDelayed(i * WaveShift, i); } else { break; } } }
private void combineCenterGrids(object sender, object e) { centerGridAnimating = true; centerGridShowCompare = false; double toX = -App.Width * xShift; double toY = -App.Height * yShift; Storyboards.MoveXY(subscriptionVsOneTimeGrid, CenterGridSplitTime, -toX * xShiftCompareFactor, toY, 0, toY, finishCenterGridAnimation); if (useScalingOnCenterGridAnimation) { Storyboards.MoveXYAndScale(centerGrid, CenterGridSplitTime, toX, toY, 0, toY, CenterGridScaleUp, CenterGridScaleUpTime, null); } else { Storyboards.MoveXY(centerGrid, CenterGridSplitTime, toX, toY, 0, toY, null); } Storyboards.FadeOut(subscriptionVsOneTimeGrid, CenterGridSplitTime, null); }
public WhatsNew() { this.InitializeComponent(); this.Width = Double.NaN; this.Height = Double.NaN; distance = App.Height / 4; rootPage = this; timer.Interval = TimeSpan.FromMilliseconds(Interval); timer.Tick += TimerTick; timer.Start(); String defaultPath = (String)Application.Current.Resources["default_path"]; for (int i = 1; i <= FeaturesCount; i++) { String filePath = defaultPath + (String)Application.Current.Resources["FeatureVideo" + i]; videoSource[i - 1] = new Uri(filePath); } animateHand(); videoGrid.Opacity = 0; videoGrid.Visibility = Visibility.Visible; Storyboards.DissapearRight(videoGrid, 1, collapseVideo); string currentMode = App.currentLanguageMode(); if (currentMode == "cs") { featureInkToMath.Visibility = Visibility.Collapsed; featureWordResearcher.Visibility = Visibility.Collapsed; featureSwayQuickStarter.Visibility = Visibility.Collapsed; featureExcellTellMe.Visibility = Visibility.Collapsed; } else { featureInkToMath.Visibility = Visibility.Collapsed; featureExcellTellMe.Visibility = Visibility.Collapsed; } App.whatsNewPage = this; }
private void hideInfoBox(object sender, TappedRoutedEventArgs e) { Storyboards.FadeOut(infoBox, AppearTime, collapseInfoBox); Storyboards.FadeIn(infoIcon, AppearTime, null); infoIcon.Visibility = Visibility.Visible; }
private void fadeInCompareChart(object sender, object e) { comparisonGridHP.Visibility = Visibility.Collapsed; comparisonGrid365_2016.Visibility = Visibility.Collapsed; Storyboards.FadeIn(comparisonChart, AppearTime, finishCompareTransition); }
private void showProductiInfoGrid(object sender, object e) { Storyboards.FadeIn(learnMore365Button, AppearTime, null); Storyboards.FadeIn(productInfoGrid, AppearTime, null); }
private void hideAssetDetails(object sender, TappedRoutedEventArgs e) { Storyboards.DissapearBottom(assetDetails, AppearTime, collapseAssetDetails); }
private void showAssetDetails(object sender, TappedRoutedEventArgs e) { if (featuresDetailsMode) { return; } Storyboards.FadeIn(featuresDetails, AppearTime / 2, showProductiInfoGrid); Storyboards.AppearBottom(featuresDetails, AppearTime / 2, null); learnMore365Button.Opacity = 0; productInfoGrid.Opacity = 0; featuresDetailsMode = true; useScaleTargets = true; Storyboards.FadeOut(aUsersText, FadeTime, null); Storyboards.FadeOut(aDeviceText, FadeTime, null); // TODO Rework this section for (int i = 0; i < NrOfAssets; i++) { var transform = assetDummy[i].TransformToVisual(Window.Current.Content); Point absolutePosition = transform.TransformPoint(new Point(0, 0)); double ff = 1.0, xoff = 0; double size = App.AssetDummySize; double originSize = aImgSize; if (i == 0) // Ignore? { size = App.AssetDummySizeUser; xoff = size * 0.2; ff = 0.85; } else if (i == 1) { size = App.AssetDummySizeDevice * 1.2; xoff = currentProduct > 1 ? 0: size * 0.1; ff = 0.75; } double scale = size / originSize; xyScaleTargets[i].X = scale; xyScaleTargets[i].Y = scale; xyTargets[i].X = absolutePosition.X + (scale - 1.0) * size / 4 + xoff; xyTargets[i].Y = -App.Height + absolutePosition.Y + size * ff; } double x = xyTargets[1].X; if (currentProduct == 1) { x *= 0.75; } else if (currentProduct == 0) { x *= 0.9; } xyTargets[0].X = x; xyTargets[0].Y = xyTargets[1].Y - App.AssetDummySizeDevice / 1.7; loadSources(); if (currentProduct == 0) { aDevice.Source = homeDevices; homeDevices.Stop(); homeDevices.Play(); } else if (currentProduct == 1) { aDevice.Source = personalDevices; personalDevices.Stop(); personalDevices.Play(); } else { aDevice.Source = singleDevice; singleDevice.Stop(); singleDevice.Play(); } }
private void Timer_Tick(object sender, object e) { if (!videoClosed && stopwatch.ElapsedMilliseconds > StartVideoCloseAt && !centerGridAnimating) { stopwatch.Stop(); centerGridAnimating = true; Storyboards.FadeIn(centerGrid, AppearTime, moveCenterGridUp); } if (videoClosed) { bool snapScale = false; for (int i = 0; i < NrOfAssets; i++) { CompositeTransform ct = assetImages[i].RenderTransform as CompositeTransform; ct.TranslateX += (xyTargets[i].X - ct.TranslateX) / AnimDivider; ct.TranslateY += (xyTargets[i].Y - ct.TranslateY) / AnimDivider; if (useScaleTargets) { ct.ScaleX += (xyScaleTargets[i].X - ct.ScaleX) / AnimDivider; ct.ScaleY += (xyScaleTargets[i].Y - ct.ScaleY) / AnimDivider; if (Math.Abs(xyScaleTargets[i].X - ct.ScaleX) < 0.02) { snapScale = true; } } } if (snapScale) { useScaleTargets = false; for (int i = 0; i < NrOfAssets; i++) { CompositeTransform ct = assetImages[i].RenderTransform as CompositeTransform; ct.ScaleX = xyScaleTargets[i].X; ct.ScaleY = xyScaleTargets[i].Y; } } updateUserDeviceTexts(); if (cgMoving) { //dbg("cgMoving {0},{1} to {2},{3}", (int)cgTransform.TranslateX, (int)cgTransform.TranslateY, (int)cgTargetX, (int)cgTargetY); if (Math.Abs(cgTargetX - cgTransform.TranslateX) < 1.0 && Math.Abs(cgTargetY - cgTransform.TranslateY) < 1.0) { dbg("cgMoving = false - snapped"); cgMoving = false; cgTransform.TranslateX = cgTargetX; cgTransform.TranslateY = cgTargetY; } else { dbg("cgTransformXY = {0},{1}", (int)cgTransform.TranslateX, (int)cgTransform.TranslateY); cgTransform.TranslateX += (cgTargetX - cgTransform.TranslateX) / AnimDivider; cgTransform.TranslateY += (cgTargetY - cgTransform.TranslateY) / AnimDivider; centerGrid.UpdateLayout(); } } if (cgTransform != null) { cgTransform.Rotation += (cgTargetRotation - cgTransform.Rotation) / AnimDivider; } } }