HTML CSS & JAVASCRIPT, YouTube

Present your own country using html, css and javascript

Present your own country using html, css and javascript

Coding BD given Present your own country using html, css and javascript. You can create a flag of bangladesh. We create the most similar flags. It is the most important part Of javascript animation. We have given more importance to the vanilla javascript animation. They used pure javascript effects. because they need highly effective effects. Thank you so much.

😍😍 If You like this video Please like, share and subscribe This video.😍😍

😍😍 Check Others Programming Video👇

➡️ creative button hover effects: https://www.youtube.com/watch?v=3FbyiuhhhTI

➡️ How to Download Source code in Coding BD: https://www.youtube.com/watch?v=WXAZ-BScKBE&t=3s

➡️Responsive website html css javascript | part( 1 ): https://www.youtube.com/watch?v=g0ART…

➡️ Responsive Services Section: https://www.youtube.com/watch?v=wvLky…

➡️ CSS Clip Path Hover Circle Hover Effects: https://www.youtube.com/watch?v=cRSgo…

➡️ CSS Responsive CARD Hover Effects & Adding Stroke to Text | Html5 CSS3 2021: https://www.youtube.com/watch?v=QVMJ5…

➡️ Neon Light Button Animation Effects on Hover | CSS Snake Border: https://www.youtube.com/watch?v=GtVSF…

➡️ Responsive Box Model Web Design Using CSS Flexbox: https://www.youtube.com/watch?v=03RuV…

➡️ Digital Clock with Animated Progress-bar | HTML CSS & Vanilla Javascript: https://www.youtube.com/watch?v=6A6Hp…

➡️ How to create a light to dark mode for HTML CSS & Vanilla Javascript 2021: https://www.youtube.com/watch?v=43FbR…

➡️Scroll top button : https://www.youtube.com/watch?v=9fDEJ…

➡️ Animated eid mubarak 2021 using Html CSS & Javascript: https://www.youtube.com/watch?v=60H2g…

Here is all Source code ( Present your own country ). You can follow this steps:

  1. Create 1 folder
  2. create 1 HTML file: index.html
  3. create 1 CSS file: style.css
  4. copy HTML code and pest HTML file, copy CSS code and past CSS file
  5. Now give a smile and jump out loud. 😍😍

<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Present your own country using html, css and javascript</title>
    <link rel="stylesheet" href="style.css">
</head>

<body>
    <h1>This Bangladesh built on the blood of martyrs</h1>
    <main>
        <div class="container">
            <div class="container__section"></div>
            <div class="container__section"></div>
            <div class="container__section"></div>
        </div>
    </main>
    <script src="./app.js"></script>
</body>

</html>
@import url("https://fonts.googleapis.com/css2?family=Poppins:[email protected];200;300;400;500;600&display=swap");
* {
  margin: 0;
  padding: 0;
}
body,
html {
  height: 100vh;
  margin: 0;
  padding: 0;
  background: black;
  text-align: center;
  font-family: "Poppins", sans-serif;
}

h1 {
  color: #fff;
  margin-top: 100px;
  margin-bottom: -100px;
  font-weight: 700;
  text-transform: uppercase;
  font-size: 35px;
}
main {
  align-items: center;
  justify-content: center;
  display: flex;
  height: 100%;
}
.container {
  justify-content: center;
  display: flex;
  min-height: 500px;
  width: 80%;
}
.container__section {
  background: #fff;
  flex-grow: 1;
  min-height: 100%;
  margin: 10px;
}
.container__section canvas {
  height: 100%;
  width: 100%;
}
.container__section:first-child {
  background: #006b4f;
}
.container__section:nth-child(2) {
  background: #ee2e43;
}
.container__section:last-child {
  background: #006b4f;
}
var _class, _temp;
function _defineProperty(obj, key, value) {
  if (key in obj) {
    Object.defineProperty(obj, key, {
      value: value,
      enumerable: true,
      configurable: true,
      writable: true,
    });
  } else {
    obj[key] = value;
  }
  return obj;
}
class Points {
  constructor() {
    if (Points.instance) {
      return Points.instance;
    }

    Points.instance = this;
    this.points = [];

    for (let i = 0; i < Points.pointNum; i++) {
      this.points.push({
        y: 0,
        amplitude:
          Math.random() * (this.maxAmplitude - this.minAmplitude) +
          this.minAmplitude,
        speed: Math.random() * this.speedMultiplier + 0.5,
        offset: Math.random() * this.offsetMultiplier,
      });
    }

    this.run = this.run.bind(this);
  }

  getPoint(i) {
    return this.points[i];
  }

  run(delta) {
    if (this.running) {
      requestAnimationFrame(this.run);
    }

    let time = delta * 0.0005;
    this.points.forEach((point) => {
      point.y = Math.sin(time * point.speed + point.offset) * point.amplitude;
    });
  }

  get length() {
    return this.points.length;
  }

  set offsetMultiplier(value) {
    if (value > 0) {
      this._offsetMultiplier = value;
    }
  }
  get offsetMultiplier() {
    return this._offsetMultiplier || 100;
  }

  set speedMultiplier(value) {
    if (value > 0) {
      this._speedMultiplier = value;
    }
  }
  get speedMultiplier() {
    return this._speedMultiplier || 1;
  }

  set minAmplitude(value) {
    if (value > 0) {
      this._minAmplitude = value;
    }
  }
  get minAmplitude() {
    return this._minAmplitude || 20;
  }

  set maxAmplitude(value) {
    if (value > 0) {
      this._maxAmplitude = value;
    }
  }
  get maxAmplitude() {
    return this._maxAplitude || 100;
  }

  set running(value) {
    if (!this._running && value === true) {
      requestAnimationFrame(this.run);
    }
    this._running = value === true;
  }
  get running() {
    return this._running === true;
  }
}
_defineProperty(Points, "pointNum", 16);
_defineProperty(Points, "instance", null);

class WaveFrame {
  constructor(points, parentElement, minPoint, maxPoint) {
    if (
      !(parentElement instanceof HTMLElement) ||
      !(minPoint >= 0) ||
      !(maxPoint >= 0) ||
      !(points instanceof Points)
    ) {
      return null;
    }

    this.points = points;

    this.minPoint = minPoint;
    this.maxPoint = maxPoint;

    this._parentElement = parentElement;
    this._canvas = document.createElement("canvas");
    this._canvas.width = this.width;
    this._canvas.height = this.height;
    this._ctx = this._canvas.getContext("2d");
    setTimeout(() => {
      this._parentElement.appendChild(this._canvas);
    }, 0);

    this.run = this.run.bind(this);
  }

  update() {
    if (this.updated === false) return;
    this.updated = false;
    this._parentElement.removeChild(this._canvas);
    // This logic breaks sometimes on rabid resizes, but I can't quite figure
    // out why as yet.
    // Will probably need to investigate an alternative and more robust debounce
    // that more readily suits multiple items.
    setTimeout(() => {
      this._canvas.width = this.width;
      this._canvas.height = this.height;
      setTimeout(() => {
        this._parentElement.appendChild(this._canvas);
        this.updated = true;
      }, 0);
    }, 100);
  }

  run(delta) {
    if (this.running) {
      requestAnimationFrame(this.run);
    }

    this._ctx.clearRect(0, 0, this.width, this.height);

    let dist = this.pointDistance;
    this._ctx.beginPath();
    this._ctx.fillStyle = "#FFFFFF";

    this._ctx.moveTo(
      -dist,
      this.middle + this.points.getPoint(this.leftOffPoint).y
    );

    for (let i = 0; i <= this.pointsNum; i++) {
      let point = this.points.getPoint(this.minPoint + i);
      let nextPoint = this.points.getPoint(this.minPoint + i + 1);

      let p1 = this.middle + point.y;
      let p2 = this.middle + nextPoint.y;
      var xc = dist * i + dist * 0.5;
      var yc = (p1 + p2) * 0.5;
      this._ctx.quadraticCurveTo(dist * i, p1, xc, yc);
    }
    this._ctx.lineTo(this.width, this.height);
    this._ctx.lineTo(0, this.height);
    this._ctx.closePath();
    this._ctx.fill();
  }

  get middle() {
    return this.height * 0.5;
  }

  get pointsNum() {
    return this.maxPoint - this.minPoint;
  }

  get leftOffPoint() {
    let point = this.minPoint - 1;
    if (point < 0) point = this.points.length - 1;
    return point;
  }

  get rightOffPoint() {
    let point = this.minPoint + 1;
    if (point > this.points.length) point = 0;
    return point;
  }

  get pointDistance() {
    return this.width / (this.pointsNum - 1);
  }

  set minPoint(value) {
    if (value >= 0) {
      this._minPoint = value;
    }
  }
  get minPoint() {
    return this._minPoint;
  }

  set maxPoint(value) {
    if (value >= 0) {
      this._maxPoint = value;
    }
  }
  get maxPoint() {
    return this._maxPoint;
  }

  get width() {
    return this._parentElement.offsetWidth;
  }
  get height() {
    return this._parentElement.offsetHeight;
  }

  set running(value) {
    if (!this._running && value === true) {
      requestAnimationFrame(this.run);
    }
    this._running = value === true;
  }
  get running() {
    return this._running === true;
  }
}

const containers = document.querySelectorAll(".container__section");
const points = new Points();
const waveFrames = [
  new WaveFrame(points, containers[0], 1, 6),
  new WaveFrame(points, containers[1], 5, 10),
  new WaveFrame(points, containers[2], 9, 14),
];

const Controller =
  ((_temp = _class =
    class Controller {
      static runToggle() {
        if (!Controller.running) {
          points.running = true;
          waveFrames.forEach((frame) => {
            frame.running = true;
          });
        } else {
          points.running = false;
          waveFrames.forEach((frame) => {
            frame.running = false;
          });
        }
        Controller.running = !Controller.running;
      }
      static setupListeners() {
        window.addEventListener("resize", Controller.onResize);
      }
      static onResize(e) {
        waveFrames.forEach((frame) => {
          frame.update();
        });
      }
    }),
  _defineProperty(_class, "running", false),
  _temp);

console.clear();

Controller.setupListeners();
Controller.runToggle();

Don’t Forget to Follow me on all Social Network

YouTube: https://www.youtube.com/channel/UCw9etYfx-25oKB_qt1fFNWw

Facebook Page: https://www.facebook.com/codingbd2021

LinkedIn: https://www.linkedin.com/in/sajjat-ho… 

GitHub: https://github.com/cgsaleh8383

You can see css image hover overlay effects

Related Posts

Leave a Reply

Your email address will not be published.