예제 #1
0
        protected override async Task OnInitializedAsync()
        {
            aVTestsData = (await TJBarnesService.GetHttpClient()
                           .GetFromJsonAsync <AVTestData[]>("api/avtests")).ToList();

            BrowserDimensions browserDimensions = await JSRuntime.InvokeAsync <BrowserDimensions>("getDimensions");

            testSpec.BrowserWidth  = browserDimensions.Width;
            testSpec.BrowserHeight = browserDimensions.Height;
            testSpec.DeviceLoad    = Device.DeviceLoad;

            testSpec.SaveLabel = "Save";

            testSpec.DiameterScale  = ScreenSizing.DiameterScaleAV(testSpec.BrowserWidth);
            testSpec.XScale         = ScreenSizing.XScale(testSpec.BrowserWidth);
            testSpec.YScale         = ScreenSizing.YScale(testSpec.BrowserWidth);
            testSpec.BorderWidth    = ScreenSizing.BorderWidthAV(testSpec.BrowserWidth);
            testSpec.FontSize       = ScreenSizing.FontSize(testSpec.BrowserWidth);
            testSpec.FontPaddingTop = ScreenSizing.FontPaddingTop(testSpec.BrowserWidth);
            testSpec.GapMin         = 200;
            testSpec.GapMax         = 1200;

            testSpec.ButtonsCentered = true;
            testSpec.SubmitLabel1    = "Submit";

            screen.XMargin   = ScreenSizing.XMargin(testSpec.BrowserWidth) + 100;
            screen.YMargin   = ScreenSizing.YMargin(testSpec.BrowserWidth) + Convert.ToInt32(testSpec.YScale / 2);
            screen.PlayLabel = "Play";
        }
        protected override async Task OnInitializedAsync()
        {
            gapTestsData = (await TJBarnesService.GetHttpClient()
                            .GetFromJsonAsync <GapTestData[]>("api/gaptests")).ToList();

            BrowserDimensions browserDimensions = await JSRuntime.InvokeAsync <BrowserDimensions>("getDimensions");

            testSpec.BrowserWidth  = browserDimensions.Width;
            testSpec.BrowserHeight = browserDimensions.Height;
            testSpec.DeviceLoad    = Device.DeviceLoad;

            testSpec.SaveLabel = "Save";

            testSpec.DiameterScale       = ScreenSizing.DiameterScale(testSpec.BrowserWidth);
            testSpec.XScale              = ScreenSizing.XScale(testSpec.BrowserWidth);
            testSpec.YScale              = ScreenSizing.YScale(testSpec.BrowserWidth);
            testSpec.BorderWidth         = ScreenSizing.BorderWidth(testSpec.BrowserWidth);
            testSpec.FontSize            = ScreenSizing.FontSize(testSpec.BrowserWidth);
            testSpec.FontPaddingTop      = ScreenSizing.FontPaddingTop(testSpec.BrowserWidth);
            testSpec.StrokeLabelXOffset  = ScreenSizing.StrokeLabelXOffset(testSpec.BrowserWidth);
            testSpec.StrokeLabelYOffset  = ScreenSizing.StrokeLabelYOffset(testSpec.BrowserWidth);
            testSpec.RowStartLabelWidth  = ScreenSizing.RowStartLabelWidth(testSpec.BrowserWidth);
            testSpec.RowStartLabelHeight = ScreenSizing.RowStartLabelHeight(testSpec.BrowserWidth);
            testSpec.ChangeLabelXOffset  = ScreenSizing.ChangeLabelXOffset(testSpec.BrowserWidth);
            testSpec.ChangeLabelYOffset  = ScreenSizing.ChangeLabelYOffset(testSpec.BrowserWidth);

            testSpec.ButtonsCentered = false;
            testSpec.SubmitLabel1    = "Submit";

            screen.XMargin   = ScreenSizing.XMargin(testSpec.BrowserWidth);
            screen.YMargin   = ScreenSizing.YMargin(testSpec.BrowserWidth);
            screen.PlayLabel = "Play";
        }
        protected override async Task OnInitializedAsync()
        {
            aBTestsData = (await TJBarnesService.GetHttpClient()
                           .GetFromJsonAsync <ABTestData[]>("api/abtests")).ToList();

            BrowserDimensions browserDimensions = await JSRuntime.InvokeAsync <BrowserDimensions>("getDimensions");

            testSpec.BrowserWidth  = browserDimensions.Width;
            testSpec.BrowserHeight = browserDimensions.Height;
            testSpec.DeviceLoad    = Device.DeviceLoad;

            testSpec.SaveLabel = "Save";

            testSpec.DiameterScale       = ScreenSizing.DiameterScale(testSpec.BrowserWidth);
            testSpec.XScale              = ScreenSizing.XScale(testSpec.BrowserWidth);
            testSpec.YScale              = ScreenSizing.YScale(testSpec.BrowserWidth);
            testSpec.BorderWidth         = ScreenSizing.BorderWidth(testSpec.BrowserWidth);
            testSpec.FontSize            = ScreenSizing.FontSize(testSpec.BrowserWidth);
            testSpec.FontPaddingTop      = ScreenSizing.FontPaddingTop(testSpec.BrowserWidth);
            testSpec.StrokeLabelXOffset  = ScreenSizing.StrokeLabelXOffset(testSpec.BrowserWidth);
            testSpec.StrokeLabelYOffset  = ScreenSizing.StrokeLabelYOffset(testSpec.BrowserWidth);
            testSpec.RowStartLabelWidth  = ScreenSizing.RowStartLabelWidth(testSpec.BrowserWidth);
            testSpec.RowStartLabelHeight = ScreenSizing.RowStartLabelHeight(testSpec.BrowserWidth);
            testSpec.ChangeLabelXOffset  = ScreenSizing.ChangeLabelXOffset(testSpec.BrowserWidth);
            testSpec.ChangeLabelYOffset  = ScreenSizing.ChangeLabelYOffset(testSpec.BrowserWidth);

            testSpec.SubmitLabel1 = "A has errors";
            testSpec.SubmitLabel2 = "B has errors";
            testSpec.SubmitLabel3 = "I can't tell which has errors";

            screenA.IsA       = true;
            screenA.XMargin   = ScreenSizing.XMargin(testSpec.BrowserWidth);
            screenA.YMargin   = ScreenSizing.YMargin(testSpec.BrowserWidth);
            screenA.PlayLabel = "Play A";

            screenB.IsA       = false;
            screenB.XMargin   = ScreenSizing.XMargin(testSpec.BrowserWidth);
            screenB.YMargin   = ScreenSizing.YMarginB(testSpec.BrowserWidth);
            screenB.PlayLabel = "Play B";
        }