I am trying to write a program to display weather data using the openweathermap.org API while using MaterializeCSS to make it look nice and pretty. However, currently my code does not appear to be loading the same in Electron as in my web browser. It works properly in the web browser (the lastest version of Google Chrome), while in Electron the buttons and animations are not working properly at all. There are no animations and the different tabs do not display correctly. When clicked, the tabs do nothing and all of the contents of the tabs show at once. See below.
https://i.stack.imgur.com/PdR4z.png
The file appears in the browser correctly as shown below.
https://i.stack.imgur.com/kAYpS.png
Here is the code for index.html:
const {app, BrowserWindow} = require('electron')
const path = require('path')
const url = require('url')
const functions = require('./functions')
let win;
function createWindow () {
win = new BrowserWindow({width: 1280, height: 720});
win.loadURL('file://' + __dirname + '/index.html');
functions.getData(function(data) {
console.log(data);
});
//win.webContents.openDevTools()
win.on('closed', () => {
win = null
});
}
app.on('ready', createWindow);
app.on('window-all-closed', () => {
// mac stuff
if (process.platform !== 'darwin') {
app.quit()
}
});
app.on('activate', () => {
// more mac stuff
if (win === null) {
createWindow()
}
});
// materializecss.com for the the css used.
<!DOCTYPE html>
<html>
<head>
<!-- micron.js -->
<link href="https://unpkg.com/webkul-micron@1.0.4/dist/css/micron.min.css" type="text/css" rel="stylesheet">
<!-- -->
<!-- materialize -->
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/materialize/0.100.2/css/materialize.min.css">
<link rel="stylesheet" href="/css/style.css">
<link href="https://fonts.googleapis.com/icon?family=Material+Icons" rel="stylesheet">
<!-- -->
<!-- scripts -->
<script type="text/javascript" src="./functions.js"></script>
<!-- -->
<meta charset="utf-8">
<title>Material Weather</title>
</head>
<body>
<nav class="nav-extended light-blue">
<div class="nav-wrapper light-blue">
<a href="#" class="brand-logo center light-blue">Material Weather</a>
<a href="#" data-activates="mobile-demo" class="button-collapse"><i class="material-icons">menu</i></a>
</div>
<div class="nav-content light-blue">
<ul class="tabs tabs-fixed-width light-blue">
<li class="tab"><a href="#today" class="white-text">Today</a></li>
<li class="tab"><a href="#tomorrow" class="white-text">Tomorrow</a></li>
<li class="tab"><a href="#10day" class="white-text">10 Day</a></li>
</ul>
</div>
</nav>
<div id="today" class="col s12">Today</div>
<div id="tomorrow" class="col s12">Tomorrow</div>
<div id="10day" class="col s12">10 Day</div>
<script type="text/javascript" src="https://code.jquery.com/jquery-3.3.1.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/materialize/0.100.2/js/materialize.min.js"></script>
<script src="https://unpkg.com/webkul-micron@1.0.4/dist/script/micron.min.js" type="text/javascript"></script>
</body>
</html>
If you need any additional information, please do not hesitate to ask. Thank you in advance for your time.