MrDevKnown

SELECT * FROM world WHERE humanity IS NOT NULL;

  • Home
  • About
  • Contact Us

 Idea

This article will teach you how you can make a Windows 11 themed website design. In this article, you will learn about HTML and CSS. There will be more parts on this idea in the upcoming days.

Prerequisites

Basic knowleddge of HTML and CSS.

Code

HTML part

<div class="desktop">
        <div class="taskbar">
            <div class="icons">
                <!-- start -->
                <div class="icon_img">
                    <img src="https://static.techspot.com/images2/downloads/topdownload/2021/08/2021-08-12-ts3_thumbs-9cf.png">
                </div>
                <!-- search -->
                <div class="icon_img search">
                    <img src="https://www.freeiconspng.com/thumbs/search-icon-png/search-icon-png-5.png">
                </div>
                <!-- file -->
                <div class="icon_img">
                    <img src="https://winaero.com/blog/wp-content/uploads/2019/09/File-Explorer-fluent-icon.png">
                </div>
                <!-- ie -->
                <div class="icon_img">
                    <img src="https://1000logos.net/wp-content/uploads/2020/09/Edge-logo.png">
                </div>
                <!-- chrome -->
                <div class="icon_img">
                    <img src="https://upload.wikimedia.org/wikipedia/commons/thumb/a/a5/Google_Chrome_icon_%28September_2014%29.svg/2048px-Google_Chrome_icon_%28September_2014%29.svg.png">
                </div>
            </div>
        </div>
    </div>

CSS part

        * {
            box-sizing: border-box;
        }
        body {
            margin: 0%;
            padding: 0%;
            height: 100vh;
            width: 100vw;
        }
        .desktop {
            background: url("https://mspoweruser.com/wp-content/uploads/2021/06/Microsoft-Windows-11-Wallpaper.jpg");
            background-repeat: no-repeat;
            background-position: center;
            background-size: cover;
            height: 100%;
        }
        .taskbar {
            display: flex;
            position: fixed;
            bottom: 0%;
            justify-content: center;
            align-items: center;
            background: #D4D9E8;
            height: 5.8vh;
            width: 100%;
            padding: 0.5rem;
            box-sizing: border-box;
        }
        .icons {
            display: flex;
            height: 100%;
        }
        .icon_img img {
            height: 1.7rem;
            width: 100%;
            padding-right: 0.9rem;
        }

Complete code:

<!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>Document</title>

    <style>
        * {
            box-sizing: border-box;
        }
        body {
            margin: 0%;
            padding: 0%;
            height: 100vh;
            width: 100vw;
        }
        .desktop {
            background: url("https://mspoweruser.com/wp-content/uploads/2021/06/Microsoft-Windows-11-Wallpaper.jpg");
            background-repeat: no-repeat;
            background-position: center;
            background-size: cover;
            height: 100%;
        }
        .taskbar {
            display: flex;
            position: fixed;
            bottom: 0%;
            justify-content: center;
            align-items: center;
            background: #D4D9E8;
            height: 5.8vh;
            width: 100%;
            padding: 0.5rem;
            box-sizing: border-box;
        }
        .icons {
            display: flex;
            height: 100%;
        }
        .icon_img img {
            height: 1.7rem;
            width: 100%;
            padding-right: 0.9rem;
        }
    </style>

</head>
<body>
    <div class="desktop">
        <div class="taskbar">
            <div class="icons">
                <!-- start -->
                <div class="icon_img">
                    <img src="https://static.techspot.com/images2/downloads/topdownload/2021/08/2021-08-12-ts3_thumbs-9cf.png">
                </div>
                <!-- search -->
                <div class="icon_img search">
                    <img src="https://www.freeiconspng.com/thumbs/search-icon-png/search-icon-png-5.png">
                </div>
                <!-- file -->
                <div class="icon_img">
                    <img src="https://winaero.com/blog/wp-content/uploads/2019/09/File-Explorer-fluent-icon.png">
                </div>
                <!-- ie -->
                <div class="icon_img">
                    <img src="https://1000logos.net/wp-content/uploads/2020/09/Edge-logo.png">
                </div>
                <!-- chrome -->
                <div class="icon_img">
                    <img src="https://upload.wikimedia.org/wikipedia/commons/thumb/a/a5/Google_Chrome_icon_%28September_2014%29.svg/2048px-Google_Chrome_icon_%28September_2014%29.svg.png">
                </div>
            </div>
        </div>
    </div>
</body>
</html>

Output

The website looks like this


Windows 11 themed Website Design - Make a Windows 11 themed Website - MrDevKnown



 Summary

In this article you learnt how you can make a Windows 11 themed web design. You learnt about some basics of HTML and CSS.

Thanks for reading. Hope you liked the idea and project. Do comment down you opinions. Also, share this project with your friends and programmers.


This article will teach you how you can test your typing speed, but in programmer style, with Python. Check how fast you can type by making your own software to calculate the basic things needed to get the idea of your typing speed. We are going to use PyGame for making this software. You can also make this with Tkinter or other GUI. But PyGame is a bit useful for making these kind of GUIs, so I used it.

Download a suitable landscape background image you want for this app and rename that to "bg.jpg". Download a cartoon png from anywhere, or follow this link. Rename the character to "char.png".

Make a text file named typing.txt containing the collection of some sentences, e.g.,

The quick brown fox jumps over the lazy dog

Anyone who lives in Antarctica is their for a scientific research station.

Save all these files at one location on your device, inside the same directory (folder). 

 Install PyGame

  pip install pygame  

Type this command in your terminal: cmd, bash, etc.. and press enter (run).

  Code

Import modules

import pygame
from pygame.locals import *
import sys
import time
import random

Game class (contains all the functions for the game)

class Game:
    def __init__(self):
        self.w = 750
        self.h=500
        self.reset=True
        self.active = False
        self.input_text=''
        self.word = ''
        self.time_start = 0
        self.total_time = 0
        self.accuracy = '0%'
        self.results = 'Time:0 Accuracy:0 % Wpm:0 '
        self.wpm = 0
        self.end = False
        self.HEAD_C = (255,213,102)
        self.TEXT_C = (240,240,240)
        self.RESULT_C = (255,70,70)

        pygame.init()
        self.open_img = pygame.image.load('bg.jpg')
        self.open_img = pygame.transform.scale(self.open_img, (self.w,self.h))
        self.bg = pygame.image.load('bg.jpg')
        self.bg = pygame.transform.scale(self.bg, (self.w,self.h))
        self.screen = pygame.display.set_mode((self.w,self.h))
        pygame.display.set_caption('Type Speed test')

    def draw_text(self, screen, msg, y ,fsize, color):
        font = pygame.font.Font(None, fsize)
        text = font.render(msg, 1, color)
        text_rect = text.get_rect(center=(self.w/2, y))
        screen.blit(text, text_rect)
        pygame.display.update()
   
    def get_sentence(self):
        f = open('typing.txt').read()
        sentences = f.split('\n')
        sentence = random.choice(sentences)
        return sentence
   
    def show_results(self, screen):
        if(not self.end):
            #Calculate time
            self.total_time = time.time() - self.time_start
            #Calculate accuracy
            count = 0
            for i,c in enumerate(self.word):
                try:
                    if self.input_text[i] == c:
                        count += 1
                except:
                    pass
            self.accuracy = count/len(self.word)*100
            #Calculate words per minute
            self.wpm = len(self.input_text)*60/(5*self.total_time)
            self.end = True
            print(self.total_time)

            self.results = 'Time: '+str(round(self.total_time)) +"sec," +
" Accuracy: "+ str(round(self.accuracy)) + "%, " +
'Wpm: ' + str(round(self.wpm))
            # draw icon image
            self.time_img = pygame.image.load('char.png')
            self.time_img = pygame.transform.scale(self.time_img, (150,150))
            screen.blit(self.time_img, (self.w/2-115,self.h-140))
            self.draw_text(screen,"Reset", self.h - 93, 26, (100,100,10))
            print(self.results)
            pygame.display.update()
   
    def run(self):
        self.reset_game()
        self.running=True
        while(self.running):
            clock = pygame.time.Clock()
            self.screen.fill((0,0,0), (50,250,650,50))
            pygame.draw.rect(self.screen,self.HEAD_C, (50,250,650,50), 2)
            # update the text of user input
            self.draw_text(self.screen, self.input_text, 274, 26,(250,250,250))
            pygame.display.update()
            for event in pygame.event.get():
                if event.type == QUIT:
                    self.running = False
                    sys.exit()
                elif event.type == pygame.MOUSEBUTTONUP:
                    x,y = pygame.mouse.get_pos()
                    # position of input box
                    if(x>=50 and x<=650 and y>=250 and y<=300):
                        self.active = True
                        self.input_text = ''
                        self.time_start = time.time()
                    # position of reset box
                    if(x>=310 and x<=510 and y>=390 and self.end):
                        self.reset_game()
                        x,y = pygame.mouse.get_pos()
                elif event.type == pygame.KEYDOWN:
                    if self.active and not self.end:
                        if event.key == pygame.K_RETURN:
                            print(self.input_text)
                            self.show_results(self.screen)
                            print(self.results)
                            self.draw_text(self.screen, self.results,350, 28, self.RESULT_C)
                            self.end = True
                        elif event.key == pygame.K_BACKSPACE:
                            self.input_text = self.input_text[:-1]
                        else:
                            try:
                                self.input_text += event.unicode
                            except:
                                pass
            pygame.display.update()
        clock.tick(60)
   
    def reset_game(self):
        self.screen.blit(self.open_img, (0,0))
        pygame.display.update()
        time.sleep(1)
        self.reset=False
        self.end = False
        self.input_text=''
        self.word = ''
        self.time_start = 0
        self.total_time = 0
        self.wpm = 0
        # Get random sentence
        self.word = self.get_sentence()
        if (not self.word): self.reset_game()
        # drawing heading
        self.screen.fill((255,255,255))
        self.screen.blit(self.bg,(0,0))
        msg = "Typing Speed Test"
        self.draw_text(self.screen, msg, 80, 80,"red")
        # draw the rectangle for input box
        pygame.draw.rect(self.screen, (255,192,25), (50,250,650,50), 1)
        # draw the sentence string
        self.draw_text(self.screen, self.word,175, 28,"blue")
        pygame.display.update()

Run the game

Game().run()

 Output

Now your game is ready.

Make a Python GUI app to test your typing speed - Python Game - PyGame Tutorial - Pencyl - mypencyl.blogspot.com

Make a Python GUI app to test your typing speed - Python Game - PyGame Tutorial - Pencyl - mypencyl.blogspot.com

 Summary

In this article you learnt about making an app to test your typing speed in Python with PyGame. You learnt about PyGame module.

Thanks for reading. Hope you liked the idea and project. Do comment down you opinions. Also, share this project with your friends and programmers.


   Idea

This article will teach you how you can count the number of words in JavaScript. You will learn about making a logic in JavaScript. We will make this project in react.

 Prerequisites

Basic knowledge of JavaScript (string operations), react JS basics.

  Code

Logic of the program

HTML part in React:

    <div className="form-group container p-4">

                /* buttons */
           <button disabled={text.length === 0} onClick={clear} className="btn  btn-primary" data-bs-toggle="tooltip" data-bs-placement="top" title="Tooltip on top"><i className="far fa-trash-alt"></i></button>
           <button disabled={text.length === 0} onClick={copy} className="btn  btn-primary"><i className="far fa-copy"></i></button>
           <button disabled={text.length === 0} onClick={upper} className="btn  btn-primary"><i className="far fa-text-size"></i></button>
           <button disabled={text.length === 0} onClick={capitalize} className="btn  btn-primary"><i className="fas fa-font-case"></i></button>
           <button disabled={text.length === 0} onClick={remove_space} className="btn btn-primary"><i className="fas fa-line-height fa-rotate-270"></i></button>

                /* Textarea */
           <textarea className="thetext form-control mb-4" value={text} onChange={handleOnChange} id="exampleFormControlTextarea1" rows="8"></textarea>
           <h4 className="mt-4">Text Count</h4>
           <div className="my-2">
           <p>{text.split(/\s+/).filter((element) => { return element.length !== 0 }).length} words and {text.split(' ').filter(s => s).join('').length} characters</p>
         
     </div >

Making a react component with this Logic

Using React UseState:

import React, { useState } from 'react'

export default function Form() {
    const clear = () => {
        let newtext = text.substr(0, -1);
        setText(newtext);
    }
    const handleOnChange = (event) => {
        setText(event.target.value);
    }
    const [text, setText] = useState("");
    return (
        <>
            <div className="form-group container p-4">

                {/* Textarea */}
                <textarea className="thetext form-control mb-4" value={text} onChange={handleOnChange} id="exampleFormControlTextarea1" rows="8"></textarea>
                <h4 className="mt-4">Text Count</h4>
                <div className="my-2">
                    <p>{text.split(/\s+/).filter((element) => { return element.length !== 0 }).length} words and {text.split(' ').filter(s => s).join('').length} characters</p>
                </div>
            </div >
        </>
    )
}

 Output

Now your Program is ready...



I just a used a little bootstrap and added some more buttons and extra logic to make this. I have already written a post on this whole site. Visit

 Summary

In this article you learnt about how you can count the no. of words and characters in React.

Thanks for reading. Hope you liked the idea and project. Do comment down you opinions. Also, share this project with your friends and programmers.


   Idea

This article will teach you how you can make a spinning donut with Python. It is a popular project in programming. The spinning donut is made in the languages such as C or C++. In this article, you'll learn how you can make the same with python.

 Prerequisites

Basic knowleddge of Python, knowledge of Classes and Functions in Python, how to install Python packages with pip, Knowledge about PyGame, math module and colorsys.

 Install Modules

  pip install pygame  

Type this command in your terminal: cmd, bash, etc.. and press enter (run).

  Code

Import modules

import pygame, colorsys, math

The logic

pygame.init()

white = (255, 255, 255)
black = (0, 0, 0)
hue = 0

WIDTH = 1920
HEIGHT = 1080

x_co, y_co = 0, 0

x_sep = 10
y_sep = 20

rows = HEIGHT // y_sep
columns = WIDTH // x_sep
screen_size = rows * columns

x_offset = columns / 2
y_offset = rows / 2

A, B = 0, 0  # rotating animation

theta_spacing = 10
phi_spacing = 1

big_chars = ".,-~:;=!*#$@"

screen = pygame.display.set_mode((WIDTH, HEIGHT))

display_surface = pygame.display.set_mode((WIDTH, HEIGHT))
# display_surface = pygame.display.set_mode((0, 0), pygame.FULLSCREEN)
pygame.display.set_caption('Donut')
font = pygame.font.SysFont('Arial', 18, bold=True)

def hsv2rgb(h, s, v):
    return tuple(round(i * 255) for i in colorsys.hsv_to_rgb(h, s, v))


def text_display(letter, x_co, y_co):
    text = font.render(str(letter), True, hsv2rgb(hue, 1, 1))
    display_surface.blit(text, (x_co, y_co))

# def text_display(letter, x_co, y_co):
#     text = font.render(str(letter), True, white)
#     display_surface.blit(text, (x_co, y_co))


run = True
while run:

    screen.fill((black))

    z = [0] * screen_size  # Donut. Fills donut space
    b = [' '] * screen_size  # Background. Fills empty space

    for j in range(0, 628, theta_spacing):  # from 0 to 2pi
        for i in range(0, 628, phi_spacing):  # from 0 to 2pi
            c = math.sin(i)
            d = math.cos(j)
            e = math.sin(A)
            f = math.sin(j)
            g = math.cos(A)
            h = d + 2
            D = 1 / (c * h * e + f * g + 5)
            l = math.cos(i)
            m = math.cos(B)
            n = math.sin(B)
            t = c * h * g - f * e
            x = int(x_offset + 40 * D * (l * h * m - t * n))  # 3D x coordinate after rotation
            y = int(y_offset + 20 * D * (l * h * n + t * m))  # 3D y coordinate after rotation
            o = int(x + columns * y)  
            N = int(8 * ((f * e - c * d * g) * m - c * d * e - f * g - l * d * n))  # luminance index
            if rows > y and y > 0 and x > 0 and columns > x and D > z[o]:
                z[o] = D
                b[o] = big_chars[N if N > 0 else 0]

    if y_co == rows * y_sep - y_sep:
        y_co = 0

    for i in range(len(b)):
        A += 0.00002 # for faster rotation change to bigger value
        B += 0.00001 # for faster rotation change to bigger value
        if i == 0 or i % columns:
            text_display(b[i], x_co, y_co)
            x_co += x_sep
        else:
            y_co += y_sep
            x_co = 0
            text_display(b[i], x_co, y_co)
            x_co += x_sep


    pygame.display.update()

    hue += 0.005

    for event in pygame.event.get():
        if event.type == pygame.QUIT:
            running = False
        if event.type == pygame.KEYDOWN:
            if event.key == pygame.K_ESCAPE:
                running = False

 Output

Now your game is ready. Just run the program and see the magic...



 Summary

In this article you learnt about making an app to display a rotating Donut in Python with PyGame module. You learnt about PyGame module.

Thanks for reading. Hope you liked the idea and project. Do comment down you opinions. Also, share this project with your friends and programmers.


Newer Posts Older Posts Home

ABOUT ME

Web developer, designer. A self taught programmer. Don't hesitate to come for say a small "hello!"
Shivesh Tiwari

POPULAR POSTS

  • How to make your own Screen Recorder with Python - Python OpenCV Tutorial
  • Pyhton Notification System Complete Project with Code
  • Python IDE + Text Editor
  • Chrome Dino Game Automation in Python
  • How to make a Kali Linux themed Terminal Website Portfolio using React JS
  • Logic Building in Python
  • How to make Windows 11 Website Design | Adding Working App Windows | Dark Mode and other things
  • Complete guide on managing code with Github (Git Tutorial)
  • First React Project - TextUtyls Website
  • Make a Windows 11 themed Website - HTML, CSS Windows 11 design

Categories

  • best javascript project 12
  • code 5
  • dino game 1
  • dislike 1
  • easy python projects 9
  • flask 1
  • free python code 10
  • game 2
  • git 1
  • github 1
  • hack 2
  • hack chrome dino game 1
  • hack game 1
  • html best website 4
  • javascript website 6
  • learn javascript 9
  • learn programming 13
  • learn python 15
  • like 1
  • like dislike system php 1
  • mrdevknown 5
  • music player 1
  • notification 1
  • php 2
  • programming 9
  • project 9
  • pyqt5 4
  • python 16
  • python IDE 2
  • python projects 8
  • React 5
  • react js 6
  • software 5
  • Tkinter 2
  • web app 4
  • website 4
Powered by Blogger
MrDevKnown

Search This Blog

Archive

  • August 20231
  • March 20231
  • December 20221
  • September 20222
  • August 20221
  • June 20221
  • March 20221
  • January 20226
  • December 20211
  • November 20213
  • October 202111
  • September 20213
  • August 20213
Show more Show less
  • Home
  • About
  • Contact Us

Subscribe

Posts
Atom
Posts
All Comments
Atom
All Comments

Subscribe

Posts
Atom
Posts
All Comments
Atom
All Comments

Categories

  • React5
  • Tkinter2
  • best javascript project12
  • code5
  • dino game1
  • dislike1
  • easy python projects9
  • flask1
  • free python code10
  • game2
  • git1
  • github1
  • hack2
  • hack chrome dino game1
  • hack game1
  • html best website4
  • javascript website6
  • learn javascript9
  • learn programming13
  • learn python15
  • like1
  • like dislike system php1
  • mrdevknown5
  • music player1
  • notification1
  • php2
  • programming9
  • project9
  • pyqt54
  • python16
  • python IDE2
  • python projects8
  • react js6
  • software5
  • web app4
  • website4

Translate

Pages

  • Home
  • Privacy Policy

Popular Posts

Music Player web app made in HTML, CSS, Javascript

Music Player web app made in HTML, CSS, Javascript

August 03, 2021
Top must have windows software for a developer

Top must have windows software for a developer

September 17, 2022
Javascript code to display a welcome message after accepting the name of the user using a prompt box

Javascript code to display a welcome message after accepting the name of the user using a prompt box

August 20, 2022

Trending Articles

  • How to make your own Screen Recorder with Python - Python OpenCV Tutorial
  • Pyhton Notification System Complete Project with Code
  • Python IDE + Text Editor
  • Chrome Dino Game Automation in Python

Popular Posts

  • Music Player web app made in HTML, CSS, Javascript
  • How to create a shining / glowing effect around the cursor on mouse hover over a div? Glassmorphism Tutorial
  • Javascript code to display a welcome message after accepting the name of the user using a prompt box

Labels

Distributed By Gooyaabi | Designed by OddThemes