React Website gives blank page on IOS Safari - ios

I created a single page website with React. While it works fine on Android and Windows devices, I get a white page error on IOS-based devices. I have tried many solutions.
I don't get console error for Safari (latest version) for Windows either.
Here for live : https://fitbodyclub.netlify.app/
It has many code you may look at it here : https://github.com/kececibora/FitBodyClub-Website
index.js:
import React from "react";
import ReactDOM from "react-dom/client";
import "./index.css";
import App from "./App";
const root = ReactDOM.createRoot(document.getElementById("root"));
root.render(
<React.StrictMode>
<App />
</React.StrictMode>
);
package.json:
{
"name": "fitclub",
"homepage": "https://fitbodyclub.netlify.app/",
"version": "0.1.0",
"private": true,
"dependencies": {
"#testing-library/jest-dom": "^5.16.4",
"#testing-library/react": "^13.3.0",
"#testing-library/user-event": "^13.5.0",
"framer-motion": "^6.3.15",
"number-counter": "^1.0.3",
"react": "^18.2.0",
"react-dom": "^18.2.0",
"react-onclickoutside": "^6.12.2",
"react-scripts": "5.0.1",
"react-scroll": "^1.8.7",
"web-vitals": "^2.1.4"
},
"scripts": {
"start": "react-scripts start",
"build": "react-scripts build",
"test": "react-scripts test",
"eject": "react-scripts eject"
},
"eslintConfig": {
"extends": [
"react-app",
"react-app/jest"
]
},
"browserslist": {
"production": [
">0.2%",
"not dead",
"not op_mini all"
],
"development": [
"last 1 chrome version",
"last 1 firefox version",
"last 1 safari version"
]
}
}
I tried :
1 - "start_url": ".", // in manifest.json
2 - delete iframe from files
3- "homepage": ".", // added to package.json
4- "start_url": "``https://fitbodyclub.netlify.app/``", // added in manifest.json
5-"start": "yarn run start:tw & sleep 1 && yarn run start:cra", // added in package.json
6- <iframe allow="fullscreen" // added allow to iframe
7-
I started to rebuild it. I found the file gives that problem :
// import Header from "./Header/Header";
import "./Hero.css";
import hero_image from "../assets/hero_image.png";
import hero_image_back from "../assets/hero_image_back.png";
import Heart from "../assets/heart.png";
import Calories from "../assets/calories.png";
const transition = { type: "spring", duration: 3 };
const mobile = window.innerWidth <= 768 ? true : false;
function Hero() {
return (
<div className="hero" id="home">
<div className="blur hero-blur"></div>
<div className="left-h">
{/* <Header /> */}
{/* slogan */}
<div className="slogan">
<div
initial={{ left: mobile ? "165px" : "238px" }}
whileInView={{ left: "8px" }}
transition={{ ...transition, type: "tween" }}
></div>
<span>Sporun Kalbi burada atıyor 💛💛</span>
</div>
{/* Büyük Slogan */}
<div className="hero-text">
<div>
<span className="bosluk-text">Hayalinizdeki </span>
<span>Vücuda</span>
</div>
<div>
<span>Kavuşma Zamanı</span>
</div>
<div>
<span>
Burada sizlere hayalinizdeki vücuda kavuşmanıza yardım ediyoruz.
Sen de yapabilirsin!
</span>
</div>
</div>
{/* Figürler */}
<div className="figures">
<div>
<span>+500</span>
<span>metrekare</span>
</div>
<div>
<span>+2500</span>
<span>Üyelik</span>
</div>
<div>
<span>+250</span>
<span>Ekipman</span>
</div>
</div>
{/*Butonlar */}
<div className="hero-buttons">
<button className="btn">Katıl Bize</button>
<button className="btn">Daha Fazlası</button>
</div>
</div>
<div className="right-h">
<button className="btn">Üye Girişi</button>
<div
initial={{ right: "-1rem" }}
whileInView={{ right: "4rem" }}
transition={transition}
className="heart-rate"
>
<img src={Heart} alt="" />
<span>Heart Rate</span>
<span>116bpm</span>
</div>
{/* Hero images */}
<img src={hero_image} alt="" className="hero-image" id="hero_image" />
<img
initial={{ right: "11rem" }}
whileInView={{ right: "20rem" }}
transition={transition}
src={hero_image_back}
alt=""
className="hero-image-back"
id="hero_image_back"
/>
{/* Kalori */}
<div
initial={{ right: "37rem" }}
whileInView={{ right: "28rem" }}
transition={transition}
className="calories"
>
<img src={Calories} alt="" />
<div>
<span>Kalori</span>
<span>220 kcal</span>
</div>
</div>
</div>
</div>
);
}
export default Hero;
I started to rebuild it. I found the file gives that problem :

Part by part i builded so, a css element mix-blend-mode causes problem.
.App{mix-blend-mode: overlay;}

Related

Problem with input type="file" in Mozilla web extension

I'm porting extension from Chrome to Firefox.
Have an html with
<input type="file" id="protocol-file"/>
After pressing an extension button I see my input. Then start to select local file from disk - I see window with file list on my disk, but extension windows dissapeared (only in Firefox, in Chrome it still remains visible).
I tried to add
document.getElementById('protocol-file').onchange = function() {
alert('protocol-file changed');
};
but it doesn't work - I don't see alert after file selected.
It seems that extension finishes working on selecting files in Firefox. In Chrome everything is Ok.
index.html
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8">
</head>
<script src="main.js"></script>
<body>
<div id="container">
<div class="file-input-block">
<span class="file-label">Файл:</span>
<input type="file" id="protocol-file"/>
</div>
</div>
</body>
</html>
main.js
document.addEventListener('DOMContentLoaded', function(){
document.getElementById('protocol-file').onchange = function() {
alert('protocol-file changed');
};
});
manifest.json
{
"name": "Example",
"version": "0.1",
"description": "Mozilla ext example",
"manifest_version": 2,
"permissions": [
"activeTab",
"tabs",
"notifications",
"http://*/",
"https://*/"
],
"browser_action": {
"default_title": "Example file select",
"default_popup": "index.html"
},
"browser_specific_settings": {
"gecko": {
"id": "my#examle.com",
"strict_min_version": "49.0"
}
}
}

How to get particular data from json object passing id in Angular 7

I want to get the JSON data from specific Id like i have 5 forms of data in my JSON ,and in my home page i have 5 buttons from form1 to form 5, so if i click form1 formID:1 data should display this should be dynamic
[
{
"formId": 1,
"formName": "formOne",
"components":
[
{
"label": "Email",
"allowMultipleMasks": false,
"showWordCount": false,
"showCharCount": false,
"tableView": true,
"alwaysEnabled": false,
"type": "email",
"input": true,
"key": "emailField2",
"widget": {
"type": ""
}
}
]
},
{
"formId": 2,
"formName": "formTwo",
"components":
[
{
"label": "Name",
"allowMultipleMasks": false,
"showWordCount": false,
"showCharCount": false,
"tableView": true,
"alwaysEnabled": false,
"type": "email",
"input": true,
"key": "emailField2",
"widget": {
"type": ""
}
},
]
},
]
so HTMl is Like This
<button type="button">Form One</button>
<button type="button">Form Two</button>
<button type="button">Form Three</button>
<button type="button">Form Four</button>
<button type="button">Form Five</button>
I expected the respective form for respective button from JSON ,but i got only one form.
Html is Look like this:
<div class="container mt-5">
<h2>Basic Forms List</h2>
<ul class="list-group">
<label class="list-group-item bg-info text-white text-center "><h4 routerLink="login" (click)="gettingId(formList[0].formId)" name="login">Login Form</h4></label>
<label class="list-group-item bg-info text-white text-center"><h4 routerLink="signup" (click)="gettingId(formList[1].formId)" name="signup">Signup Form</h4></label>
<label class="list-group-item bg-info text-white text-center"><h4 routerLink="registration" (click)="gettingId(formList[2].formId)" name="registration">Registration Form</h4></label>
<label class="list-group-item bg-info text-white text-center"><h4 routerLink="profile" (click)="gettingId(formList[3].formId)" name="profile">Profile</h4></label>
<label class="list-group-item bg-info text-white text-center"><h4 routerLink="feedback" (click)="gettingId(formList[4].formId)" name="feedback">FeedBack</h4></label>
</ul>
</div>
<div class="container" *ngIf="isFormSelected">
<formio [form]="formJson"></formio>
</div>
and the ts file like this:
import { Component } from '#angular/core';
import { FormsService } from './forms.service';
#Component({
selector: 'app-root',
templateUrl: './app.component.html',
styleUrls: ['./app.component.css']
})
export class AppComponent {
title = 'TestDemo';
formJson: any;
isFormSelected: Boolean = false;
formList;
constructor(private formService: FormsService) { }
ngOnInit() {
this.formService.getForms()
.subscribe(response => {
this.formList = response;
console.log(response)
})
;
}
gettingId(formIndex){
this.isFormSelected = true;
this.formList.forEach(element => {
debugger;
if(element.formId == formIndex){
this.formJson = {components:""};
this.formJson.components = element.components;
console.log("selected json",this.formJson);
}
});
}
}

Asp.net (MVC)Core 2.1 version Jquery Data table plugin issue

<link href="https://cdn.datatables.net/1.10.15/css/dataTables.bootstrap.min.css" rel="stylesheet" />
<link href="https://cdn.datatables.net/responsive/2.1.1/css/responsive.bootstrap.min.css" rel="stylesheet" />
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script>
<script src="https://cdn.datatables.net/1.10.15/js/jquery.dataTables.min.js"></script>
<script src="https://cdn.datatables.net/1.10.15/js/dataTables.bootstrap4.min.js "></script>
<div class="container">
<br />
<div style="width:90%; margin:0 auto;">
<table id="example" class="table table-striped table-bordered dt-responsive nowrap" width="100%" cellspacing="0">
<thead>
<tr>
<th>CustomerID</th>
<th>Name</th>
</tr>
</thead>
</table>
</div>
</div>
<script>
$(document).ready(function () {
$("#example").DataTable({
"processing": true, // for show progress bar
"serverSide": true, // for process server side
"filter": true, // this is for disable filter (search box)
"orderMulti": false, // for disable multiple column at once
"ajax": {
"url": "https://data.sfgov.org/resource/RowID.json",
"type": "GET",
"datatype": "json"
},
"columnDefs":
[{
"targets": [0],
"visible": false,
"searchable": false
}],
"columns": [
{ "data": "number_of_alarms", "name": "number_of_alarms", "autoWidth": true },
{ "data": "on_scene_dttm", "name": "on_scene_dttm", "autoWidth": true },
]
});
});
</script>
I am trying to use jquery.dataTables.min.js in my asp.net mvc core 2.1 version.
Though i have included my script lib in correct order i am getting the error saying "uncaught typeerror $(...).datatable is not a function".
this a typo?
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script>
should be
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script>

IpcMain and IpcRenderer call main.js function from index.html

I am new to electron
This is my package.json :
{
"name": "hello",
"version": "1.0.0",
"description": "hello app",
"main": "main.js",
"scripts":
{
"start": "electron ."
},
"keywords": [],
"author": "Rushikant Pawar",
"license": "ISC",
"devDependencies":
{
"electron": "2.0.2"
},
"build":
{
"asar": true
}
}
and this is my index.html :
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Hello World!</title>
<!-- Insert this line above script imports -->
<script>if (typeof module === 'object') {window.module = module; module = undefined;}</script>
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.1.0/css/bootstrap.min.css">
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css" type="text/css">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.14.0/umd/popper.min.js"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/4.1.0/js/bootstrap.min.js"></script>
<!-- Insert this line after script imports -->
<script>if (window.module) module = window.module;</script>
<script type="text/javascript">
$(document).ready(function ()
{
window.alert('messageText');
$("#InputData").on("click", function ()
{
var value = $("#searchtext").val();
mainjsfunction(value);
});
});
</script>
</head>
<body>
<h1>Hello World!</h1>
<form>
<div class="form-group">
<label for="exampleFormControlInput1">Input Text</label>
<input type="text" class="form-control" id="searchtext" placeholder="rushikant pawar">
</div>
<button type="button" id="InputData" class="btn btn-primary mb-2">Confirm identity</button>
</form>
</body>
</html>
My window.alert is working... but my click function and mainjsfunction is not working... Any help will be appreciated. Thank you in advance.
If your "mainjsfunction" is located in your main process (eg main.js) you can/should use ipc to trigger your function.
For example, in your main.js file you could do:
const {ipcMain} = require('electron')
ipcMain.on('call-mainjsfunction', (event, arg) => {
console.log(arg) // prints "ping"
var res = mainjsfunction(arg);
event.sender.send('reply-mainjsfunction', res)
})
And in your index.html or client js code you would do:
const {ipcRenderer} = require('electron')
ipcRenderer.send('call-mainjsfunction', 'ping') //eg placed in your onclick
ipcRenderer.on('reply-mainjsfunction', (event, res) => {
console.log(res) // result back in client/renderer
})
Reference: https://github.com/electron/electron/blob/master/docs/api/ipc-main.md

How to implement nested list view in angular material design

Is there a way to create a nested list view component such as the below one which is implemented in jquery mobile ?
https://demos.jquerymobile.com/1.2.0/docs/lists/lists-ul.html
I used up angular material tab component styles to create UI of a nested list. You can find the demo here.
http://codepen.io/ramanathanMuthuraman/pen/rLpBxQ
HTML
<div ng-app="appName">
<div ng-controller="MainController as vm">
<md-toolbar class="site-content-toolbar">
<h2 class="md-toolbar-item md-breadcrumb md-headline">
<span class="md-padding">{{vm.title}}</span>
</h2>
</md-toolbar>
<md-divider></md-divider>
<md-content class="md-tabs">
<div ng-class="vm.isDrilldownView?'md-left':'md-active'" class="md-tab-content dynamic-height">
<div ng-class="{'md-left':vm.isDrilldownView}" ng-if="!vm.isDrilldownView">
<md-list>
<md-list-item ng-click="vm.nextView(employee)" ng-repeat="employee in vm.employeeList
" class="md-3-line">
<div class="md-list-item-text " layout="column">
<h3>{{ employee.employeeID }}</h3>
<h4>{{ employee.name }}</h4>
<p>{{ employee.overallScore }}</p>
</div>
<md-button class="md-primary md-raised">></md-button>
<md-divider></md-divider>
</md-list-item>
</md-list>
</div>
</div>
<div ng-class="vm.isDrilldownView?'md-active':'md-right'" class="md-tab-content dynamic-height">
<div class="drilldownView" ng-if="vm.isDrilldownView">
<md-whiteframe class="md-whiteframe-1dp md-padding" layout="column" layout-align="center">
<h5 flex>ID: {{ vm.employee.employeeID}}</h5>
<h5 flex>Name: {{ vm.employee.name }}</h5>
<h5 flex>Overall Score :{{ vm.employee.overallScore }}</h5>
</md-whiteframe>
<div layout="row" layout-align="center" flex>
<md-button ng-click="vm.prevView()" class="md-primary md-raised">< BACK</md-button>
</div>
</md-content>
</div>
JS
(function() {
angular
.module("appName", ['ngMaterial'])
.controller("MainController", MainController);
function MainController() {
var vm = this;
vm.title = "View Summary";
vm.isDrilldownView = false;
vm.employeeList = [{
"employeeID": "1",
"name": "Thomas",
"overallScore": 80
}, {
"employeeID": 2,
"name": "Maya",
"overallScore": 80
}];
vm.nextView = function(employee) {
vm.isDrilldownView = true;
employee.individualScore = [{
"name": "Goal Score",
"value": "100"
}, {
"name": "Performance",
"value": "100"
}, {
"name": "Attendance",
"value": "100"
}, {
"name": "Skill set",
"value": "100"
}];
vm.employee = employee;
};
vm.prevView = function() {
vm.isDrilldownView = false;
};
};
})();
CSS
.md-tabs {
overflow: visible;
}
.md-tab-content {
width: 100%;
height: 100%;
overflow: auto;
-webkit-transform: translate3d(0, 0, 0);
transform: translate3d(0, 0, 0);
transition: all cubic-bezier(0.250, 0.460, 0.450, 0.940) .2s;
}
.md-tab-content.md-left:not(.md-active) {
-webkit-transform: translateX(-100%);
transform: translateX(-100%);
animation: 1s md-tab-content-hide;
opacity: 0;
}
.md-tab-content.md-right:not(.md-active) {
-webkit-transform: translateX(100%);
transform: translateX(100%);
animation: 1s md-tab-content-hide;
opacity: 0;
}

Resources