Skip to main content

Code React Js

Creating Codebox for Blog Posts will not require much knowledge about HTML, CSS or JS because I have already designed it for you. What you need to do is to implement the codes at right place in your Blogger Theme XML.

HTML Code

import React from "react";
import ReactDOM from "react-dom/client";
import { createBrowserRouter, RouterProvider } from "react-router-dom";
// Bootstrap CSS
import "bootstrap/dist/css/bootstrap.min.css";
// Bootstrap Bundle JS
import "bootstrap/dist/js/bootstrap.bundle.min";
//components
import Layout from "./Layout";
import Home from "./pages/Home";
import About from "./pages/About"; const router = createBrowserRouter([
{
path: "/",
element: , children: [ { index: true, element: , }, { path: "about", element: , }, ], }, ]);

ReactDOM.createRoot(document.getElementById("root")).render();
children: [
{
index: true,
element: , }, { path: "about", element: , }, ], }, ]); ReactDOM.createRoot(document.getElementById("root")).render(); },
{
path: "about",
element: , }, ], }, ]); ReactDOM.createRoot(document.getElementById("root")).render(); },
],
},
]); ReactDOM.createRoot(document.getElementById("root")).render(
ReactDOM.createRoot(document.getElementById("root")).render();
},
{
path: "about",
element: , }, ], }, ]); ReactDOM.createRoot(document.getElementById("root")).render(); },
],
},
]); ReactDOM.createRoot(document.getElementById("root")).render(
ReactDOM.createRoot(document.getElementById("root")).render();
},
],
},
]); ReactDOM.createRoot(document.getElementById("root")).render(
ReactDOM.createRoot(document.getElementById("root")).render();

CSS Code

body {
  margin: 0;
  padding: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Roboto", "Oxygen",
    "Ubuntu", "Cantarell", "Fira Sans", "Droid Sans", "Helvetica Neue",
    sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

.map-wrap {
  position: relative;
  width: 100%;
  height: calc(
    103.6vh - 77px
  ); /* calculate height of the screen minus the heading */
  margin-top: 54px;
}

.map {
  position: absolute;
  width: 100%;
  height: 100%;
}

.geocoding {
  position: absolute;
  top: 10px;
  left: 10px;
}

Comments

Popular posts from this blog

React Js

React, also known as ReactJS or React.js, is a JavaScript library primarily used for building user interfaces.  It is an open-source project maintained by Meta (formerly Facebook) and a large community of developers. Here are some key aspects of React: Component-Based Architecture : React applications are built using reusable components, which are independent pieces of the user interface. Declarative Programming : React allows developers to describe the desired UI state, and it automatically handles the updates and rendering. Virtual DOM : React uses a virtual DOM to optimize updates, making applications faster and more efficient.  

Tentang Maplibre

  MapLibre GL JS   is an open-source library for publishing maps on your websites or webview based apps. Fast displaying of maps is possible thanks to GPU-accelerated vector tile rendering. It originated as an open-source fork of  mapbox-gl-js , before their switch to a non-OSS license in December 2020. The library's initial versions (1.x) were intended to be a drop-in replacement for the Mapbox’s OSS version (1.x) with additional functionality, but have evolved a lot since then.