Skip to content

Instantly share code, notes, and snippets.

View desoga10's full-sized avatar
💥
Aiming for the stars

deji adesoga desoga10

💥
Aiming for the stars
View GitHub Profile
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<script src="https://kit.fontawesome.com/a71707a89a.js" crossorigin="anonymous"></script>
<link rel="stylesheet" href="./style.css"/>
<title>Popup Box</title>
</head>
<body>
var Alert = new CustomAlert();
function CustomAlert(){
this.render = function(){
//Show Modal
let popUpBox = document.getElementById('popUpBox');
popUpBox.style.display = "block";
//Close Modal
document.getElementById('closeModal').innerHTML = '<button onclick="Alert.ok()">OK</button>';
}
body{
margin: 0;
padding: 0;
box-sizing: border-box;
}
.btn{
position: absolute;
top: 50%;
left: 50%;
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<script src="https://kit.fontawesome.com/a71707a89a.js" crossorigin="anonymous"></script>
<link rel="stylesheet" href="./style.css"/>
<title>Popup Box</title>
</head>
import React, { Component } from 'react';
class App extends Component{
render(){
return( <h1>Hello World</h1> );
}}
export default App;
import React from 'react';
import ReactDOM from 'react-dom';
import App from './App.js';
ReactDOM.render(<App />, document.getElementById('app'));
"scripts": {
"start": "webpack-dev-server",
"build-for-windows": "SET NODE_ENV='development' && webpack"
},
"babel": {
"presets": [
"@babel/preset-env",
"@babel/preset-react"
],
"plugins": [
const path = require('path')
const HtmlWebpackPlugin = require('html-webpack-plugin')
module.exports = { entry: './index.js', output: { path: path.resolve(__dirname, 'dist'),
filename: 'index_bundle.js', publicPath: '/' },
module: { rules: [ { test: /\.(js)$/, use: 'babel-loader' },
{ test: /\.css$/, use: [ 'style-loader', 'css-loader' ]} ]},
mode: process.env.NODE === 'production' ? 'production' : 'development',
plugins: [ new HtmlWebpackPlugin({ template: './index.html' }) ],
devServer: { historyApiFallback: true } }
<!DOCTYPE html> <html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>My First App</title>
</head>
<body>
<div id="app">
</div>
</body>
{
"name": "my-first-react-app",
"version": "1.0.0",
"description": "My First React App",
"main": "index.js",
"scripts": {
"test": "echo \\"Error: no test specified\\" && exit 1"
},
"keywords": \[\],
"author": "",