Tumgik
#create an html element in javascript
ceyhanmedya · 2 years
Text
HTML
New Post has been published on https://hazirbilgi.com/what-is-html-when-and-by-whom-was-html-created/
HTML
What is HTML? When and by whom was HTML created?
HTML  is a markup language that defines the structure of web pages. HTML is one of the basic building blocks of every website . For this reason, it is among the first details that web developers will want to learn. 
While HTML is an important building block, it is not enough to make a web page look good. It  must be supported by CSS  and  JavaScript  . HTML is essentially code and is used to structure the content of a web page. 
The content on the web page can consist of a number of different paragraphs, images and tables. It is possible to format them with HTML. In this way, the web browser knows how to configure the web page that a person visits and displays it in the direction desired by the developer.
What is HTML and when was it invented?
HTML or  hypertext markup language is a markup language developed for displaying materials or data on the internet. Each material has a known buyer location,  called a web page  . Web pages contain hypertext links that allow the fetching of related pages.
HTML is the markup language used to code web pages. HTML  was designed by  British scientist Sir Tim Berners-Lee in 1980 . HTML markup tags  contain document elements such as headings, paragraphs, and tables. Once formatted, they can be viewed by programs or applications known as web browsers.
When viewing a web page, web browsers interpret it according to permitted technology. Thus, items such as headings, paragraphs, and tables are presented adapted to the screen size and font used. HTML documents also contain anchor links, called links to other web pages.
What is Semantic HTML?
Semantic HTML is the conveying of literal meanings for the uses of HTML tags. Semantic HTML was used effectively throughout most of the 90’s and  became an important part of the standard HTML structure . Since the late 90’s,  CSS has become more important in web pages when it has been used effectively .
Semantic HTML 
It consists of tags such as , ,,, and . One of the most important reasons to use semantic HTML tags is that web crawlers can easily index the web page. In this direction, it is possible to improve the web page in terms of SEO . Also, semantic HTML is important for accessing web pages from screen readers.
What are HTML Versions?
After HTML was designed, it has developed in many different forms over the years. For this reason, the HTML versions that are used effectively have changed from time to time. There are five different versions of HTML that are used effectively. Each of them made extra contributions to the HTML structure, making it easier for the developers to use it.
HTML 1.0: It is the first version developed for HTML. It was published in 1991 and was used effectively until 1995.
HTML 2.0: Version released in 1995. It has been accepted as the standard version in web design. Added support for features such as text boxes and buttons.
HTML 3.2: Published by the W3C in 1997. It provided extra support in terms of table creation and form elements. It is considered the official standard since 1997.
HTML 4.01: Released in 1999. It is the stable language for the HTML language and is considered the official standard. It has added CSS support to the HTML language.
HTML5: It is the newest version of the HTML language and was announced in 2008. This version  is developed by W3C and  WHATWG .
What’s the Difference Between HTML Tags, Elements, and Attributes?
HTML tags , HTML elements, and HTML attributes are often confused and used interchangeably when defining. However, there are differences between these three elements. Each  HTML tag has its own unique meaning. HTML elements are used to describe content. HTML attributes provide additional information for existing HTML elements.
What are HTML Tags?
HTML defines the formatting of a particular web page. For this reason, the text, images and other content on the page should be displayed in a shaped way. For example, you may want some text to be uppercase, lowercase, bold, or italic. To do this,  you need to use HTML tags .
HTML tags are like keywords that define how the web browser will display the content. When a web browser reads a document containing HTML, it reads it from top to bottom and from left to right. Thanks to HTML tags, a web browser can distinguish between HTML content and simple content. Each HTML tag can have different properties.
What are HTML Elements?
HTML  consists of three elements , opening tag, content and  closing tag . Some elements are used as empty. HTML elements are often confused with HTML tags. However, an element consists of a combination of three different elements. All HTML files are made up of elements. These elements are responsible for creating web pages. They also describe the content on the web page.
Theoretically, the opening tag, content, and closing tag should go together. Some elements may not have content and closing tags. Such elements  are called empty elements or self- closing elements  . For example, a line spacer  and a straight long line.
elements in this structure.
What are HTML Attributes?
HTML attributes are placed in the opening tag, and they  range from the “style” to  the “id” description. HTML attributes help convey more information about an element. In addition, these attributes ensure that needs such as styling elements on the web page with JavaScript are met.
While HTML attributes provide additional information about elements, they are modifiers of the HTML element. Each element defines the behavior of the element to which it is attached. HTML attributes must always be applied with the start tag. Although the names to be given to HTML attributes are case sensitive, standard usage consists of lowercase letters.
html,are html tags case sensitive,are html and css programming languages,are html and css the same,are html files safe,are html attachments safe,are html and javascript the same,are html tables still used,are html ids case sensitive,are html sites reliable,are html attributes case sensitive,create an html file,create an html page,can html files be dangerous,create an html table,create an html form,can html id have spaces,create an html element in javascript,create an html link,convert an html to pdf,
0 notes
codewithnazam · 2 years
Text
HTML Tables with examples: A Comprehensive Guide for Web Developers on Creating, Formatting, and Displaying Data
I. Introduction In this article, we will explore the world of HTML tables and their importance in web design. HTML tables are an essential part of building websites, as they allow developers to organize data and information in a structured and visually appealing way. They enable users to present information in a tabular format, making it easier to read and understand. HTML tables are used in a…
Tumblr media
View On WordPress
0 notes
codemerything · 1 year
Text
A structured way to learn JavaScript.
I came across a post on Twitter that I thought would be helpful to share with those who are struggling to find a structured way to learn Javascript on their own. Personally, I wish I had access to this information when I first started learning in January. However, I am grateful for my learning journey so far, as I have covered most topics, albeit in a less structured manner.
N/B: Not everyone learns in the same way; it's important to find what works for you. This is a guide, not a rulebook.
EASY
What is JavaScript and its role in web development?
Brief history and evolution of JavaScript.
Basic syntax and structure of JavaScript code.
Understanding variables, constants, and their declaration.
Data types: numbers, strings, boolean, and null/undefined.
Arithmetic, assignment, comparison, and logical operators.
Combining operators to create expressions.
Conditional statements (if, else if, else) for decision making.
Loops (for, while) for repetitive tasks. - Switch statements for multiple conditional cases.
MEDIUM
Defining functions, including parameters and return values.
Function scope, closures, and their practical applications.
Creating and manipulating arrays.
Working with objects, properties, and methods.
Iterating through arrays and objects.Understanding the Document Object Model (DOM).
Selecting and modifying HTML elements with JavaScript.Handling events (click, submit, etc.) with event listeners.
Using try-catch blocks to handle exceptions.
Common error types and debugging techniques.
HARD
Callback functions and their limitations.
Dealing with asynchronous operations, such as AJAX requests.
Promises for handling asynchronous operations.
Async/await for cleaner asynchronous code.
Arrow functions for concise function syntax.
Template literals for flexible string interpolation.
Destructuring for unpacking values from arrays and objects.
Spread/rest operators.
Design Patterns.
Writing unit tests with testing frameworks.
Code optimization techniques.
That's it I guess!
751 notes · View notes
izicodes · 7 months
Text
Convert HTML to Image: A Step-by-Step Guide ✨
Tumblr media
Do you want to turn some HTML code you've made that's on your website and have a way to convert it into an image for you to save?
Well, look no further! I too wanted to do the same thing but funny enough, there weren't any straightforward tutorials out there that could show you how! After hours of searching, I finally discovered the solution~!
This is an old tutorial I made 🐼
Tumblr media
💛 Set your environment
Before we dive into the conversion process, I'll assume you already have your HTML code ready. What you want to learn is how to turn it into an image file. You should have a good grasp of HTML and JavaScript. For this tutorial, we'll use the following HTML code example:
Tumblr media
We won't include the CSS code, as it doesn't affect this tutorial. The JavaScript file (script.js) at the bottom of the body element is where we'll add the functionality for the conversion.
Your page should resemble the following:
Tumblr media
As you can see, the "Click me" button will handle the conversion. We aim to convert everything within the div.info-div into an image.
💛 Using the html2canvas JavaScript Library
The html2canvas library allows you to take screenshots of webpages and target specific elements on a screen. Here are the steps to include the library in your project:
The steps to put the library in your project:
Visit the html2canvas website for more information.
Copy the CDN link from here
Tumblr media
and include it in a script tag in your project's head tag in the HTML file:
Tumblr media
That's it for including the library on the HTML side. Now, let's move on to the JavaScript code.
💛 JavaScript Functionality
Here's the JavaScript code to handle the conversion:
Tumblr media
In this code, I want to turn the whole div.info-div into an image, I put it into a variable in const div = document.querySelector(".info-div");.
I also put the button into a variable in const button = document.querySelector("button");
I added a click event listener to the button so when the user clicks the button, it will follow the code inside of the event listener!
You can find similar code like this in the documentation of the html2canvas library:
Tumblr media
What is happening here is:
We add the div (or what the element we want to take an image of) into the html2canvas([element]).then((canvas)
Added the image file type url to a variable = const imageDataURL = canvas.toDataURL("image/png"); - You can replace the png to other image file types such as jpg, jpeg etc
Created an anchor/link tag, added the href attribute to imageDataURL
The download attribute is where we will give the default name to the image file, I added "dog.png"
Perform the click() function to the anchor tag so it starts to download the image we created
And that's it!
💛 The End
And that's it! You've successfully learned how to turn your HTML into an image. It's a great way to save and share your web content in a unique format.
Tumblr media
If you have any questions or need further clarification, please comfortable to ask. Enjoy converting your HTML into images! 💖🐼
Tumblr media
128 notes · View notes
codingquill · 1 year
Text
JavaScript Fundamentals
I have recently completed a course that extensively covered the foundational principles of JavaScript, and I'm here to provide you with a concise overview. This post will enable you to grasp the fundamental concepts without the need to enroll in the course.
Prerequisites: Fundamental HTML Comprehension
Before delving into JavaScript, it is imperative to possess a basic understanding of HTML. Knowledge of CSS, while beneficial, is not mandatory, as it primarily pertains to the visual aspects of web pages.
Manipulating HTML Text with JavaScript
When it comes to modifying text using JavaScript, the innerHTML function is the go-to tool. Let's break down the process step by step:
Initiate the process by selecting the HTML element whose text you intend to modify. This selection can be accomplished by employing various DOM (Document Object Model) element selection methods offered by JavaScript ( I'll talk about them in a second )
Optionally, you can store the selected element in a variable (we'll get into variables shortly).
Employ the innerHTML function to substitute the existing text with your desired content.
Element Selection: IDs or Classes
You have the opportunity to enhance your element selection by assigning either an ID or a class:
Assigning an ID:
To uniquely identify an element, the .getElementById() function is your go-to choice. Here's an example in HTML and JavaScript:
HTML:
<button id="btnSearch">Search</button>
JavaScript:
document.getElementById("btnSearch").innerHTML = "Not working";
This code snippet will alter the text within the button from "Search" to "Not working."
Assigning a Class:
For broader selections of elements, you can assign a class and use the .querySelector() function. Keep in mind that this method can select multiple elements, in contrast to .getElementById(), which typically focuses on a single element and is more commonly used.
Variables
Let's keep it simple: What's a variable? Well, think of it as a container where you can put different things—these things could be numbers, words, characters, or even true/false values. These various types of stuff that you can store in a variable are called DATA TYPES.
Now, some programming languages are pretty strict about mentioning these data types. Take C and C++, for instance; they're what we call "Typed" languages, and they really care about knowing the data type.
But here's where JavaScript stands out: When you create a variable in JavaScript, you don't have to specify its data type or anything like that. JavaScript is pretty laid-back when it comes to data types.
So, how do you make a variable in JavaScript?
There are three main keywords you need to know: var, let, and const.
But if you're just starting out, here's what you need to know :
const: Use this when you want your variable to stay the same, not change. It's like a constant, as the name suggests.
var and let: These are the ones you use when you're planning to change the value stored in the variable as your program runs.
Note that var is rarely used nowadays
Check this out:
let Variable1 = 3; var Variable2 = "This is a string"; const Variable3 = true;
Notice how we can store all sorts of stuff without worrying about declaring their types in JavaScript. It's one of the reasons JavaScript is a popular choice for beginners.
Arrays
Arrays are a basically just a group of variables stored in one container ( A container is what ? a variable , So an array is also just a variable ) , now again since JavaScript is easy with datatypes it is not considered an error to store variables of different datatypeslet
for example :
myArray = [1 , 2, 4 , "Name"];
Objects in JavaScript
Objects play a significant role, especially in the world of OOP : object-oriented programming (which we'll talk about in another post). For now, let's focus on understanding what objects are and how they mirror real-world objects.
In our everyday world, objects possess characteristics or properties. Take a car, for instance; it boasts attributes like its color, speed rate, and make.
So, how do we represent a car in JavaScript? A regular variable won't quite cut it, and neither will an array. The answer lies in using an object.
const Car = { color: "red", speedRate: "200km", make: "Range Rover" };
In this example, we've encapsulated the car's properties within an object called Car. This structure is not only intuitive but also aligns with how real-world objects are conceptualized and represented in JavaScript.
Variable Scope
There are three variable scopes : global scope, local scope, and function scope. Let's break it down in plain terms.
Global Scope: Think of global scope as the wild west of variables. When you declare a variable here, it's like planting a flag that says, "I'm available everywhere in the code!" No need for any special enclosures or curly braces.
Local Scope: Picture local scope as a cozy room with its own rules. When you create a variable inside a pair of curly braces, like this:
//Not here { const Variable1 = true; //Variable1 can only be used here } //Neither here
Variable1 becomes a room-bound secret. You can't use it anywhere else in the code
Function Scope: When you declare a variable inside a function (don't worry, we'll cover functions soon), it's a member of an exclusive group. This means you can only name-drop it within that function. .
So, variable scope is all about where you place your variables and where they're allowed to be used.
Adding in user input
To capture user input in JavaScript, you can use various methods and techniques depending on the context, such as web forms, text fields, or command-line interfaces.We’ll only talk for now about HTML forms
HTML Forms:
You can create HTML forms using the &lt;;form> element and capture user input using various input elements like text fields, radio buttons, checkboxes, and more.
JavaScript can then be used to access and process the user's input.
Functions in JavaScript
Think of a function as a helpful individual with a specific task. Whenever you need that task performed in your code, you simply call upon this capable "person" to get the job done.
Declaring a Function: Declaring a function is straightforward. You define it like this:
function functionName() { // The code that defines what the function does goes here }
Then, when you need the function to carry out its task, you call it by name:
functionName();
Using Functions in HTML: Functions are often used in HTML to handle events. But what exactly is an event? It's when a user interacts with something on a web page, like clicking a button, following a link, or interacting with an image.
Event Handling: JavaScript helps us determine what should happen when a user interacts with elements on a webpage. Here's how you might use it:
HTML:
<button onclick="FunctionName()" id="btnEvent">Click me</button>
JavaScript:
function FunctionName() { var toHandle = document.getElementById("btnEvent"); // Once I've identified my button, I can specify how to handle the click event here }
In this example, when the user clicks the "Click me" button, the JavaScript function FunctionName() is called, and you can specify how to handle that event within the function.
Arrow functions : is a type of functions that was introduced in ES6, you can read more about it in the link below
If Statements
These simple constructs come into play in your code, no matter how advanced your projects become.
If Statements Demystified: Let's break it down. "If" is precisely what it sounds like: if something holds true, then do something. You define a condition within parentheses, and if that condition evaluates to true, the code enclosed in curly braces executes.
If statements are your go-to tool for handling various scenarios, including error management, addressing specific cases, and more.
Writing an If Statement:
if (Variable === "help") { console.log("Send help"); // The console.log() function outputs information to the console }
In this example, if the condition inside the parentheses (in this case, checking if the Variable is equal to "help") is true, the code within the curly braces gets executed.
Else and Else If Statements
Else: When the "if" condition is not met, the "else" part kicks in. It serves as a safety net, ensuring your program doesn't break and allowing you to specify what should happen in such cases.
Else If: Now, what if you need to check for a particular condition within a series of possibilities? That's where "else if" steps in. It allows you to examine and handle specific cases that require unique treatment.
Styling Elements with JavaScript
This is the beginner-friendly approach to changing the style of elements in JavaScript. It involves selecting an element using its ID or class, then making use of the .style.property method to set the desired styling property.
Example:
Let's say you have an HTML button with the ID "myButton," and you want to change its background color to red using JavaScript. Here's how you can do it:
HTML: <button id="myButton">Click me</button>
JavaScript:
// Select the button element by its ID const buttonElement = document.getElementById("myButton"); // Change the background color property buttonElement.style.backgroundColor = "red";
In this example, we first select the button element by its ID using document.getElementById("myButton"). Then, we use .style.backgroundColor to set the background color property of the button to "red." This straightforward approach allows you to dynamically change the style of HTML elements using JavaScript.
374 notes · View notes
uroboros-if · 1 year
Note
Please please share some coding/designing wisdom. Your game is so damn pretty 😭😭😭 Could you tell us what template you used and how hard it was to make it look like it is today? I imagine so much work must have gone into it
😭😭 I am no expert, but these are just my rationale/methods behind the visual choices I made!
For the template I used—I used Vahnya's Template! However, this post by @/manonamora-if has a whole section for templates that I wish I saw or checked out before making my IF! In another lifetime, I might've just used nyehilism's template to achieve the bottom sidebar instead of torturing myself learning how to do it... ;;
Below, I go into detail the timeline of designing Uroboros, as well as advice through the process I went!
Design Timeline
I started designing the UI late October 2022, and kept fixing, changing, editing it well into February and maybe a little bit of March 2023.
October 2022 - Early iterations of the design. Looked for stock images and began implementing it to add a background to the sidebar and the actual passages. Swatched some color palettes and began implementing them into the IF. Later decided to make the sidebar on the bottom instead of on the side. Also, added a title screen.
November - Testing different backgrounds for the IF's sidebar. Added a textbox to the passages, also worked on the black fade transitions.
December - Finished working on the sidebar background for both light and dark theme, began work on the background of the IF instead.
Tumblr media
January 2023 - Finished working on the dark and light theme backgrounds! Started work on drawing the skill icons for light and dark theme, and finished!
February - Changed the title screen to look better on mobile, created a circle logo, added a border to the textbox. Also, made further edits for light theme.
March - Just remade the "Uroboros" logo.
If you're wondering why it took approximately 5 months to get to the final version—don't worry! I wasn't working only on the design for 5 months. My partner helped make the edits for the design, while I worked on coding them in and writing.
I spent a lot of time trying to get a grasp on Javascript, SugarCube, and HTML all throughout this time as well, to know how to fluidly add these things. Meaning, while I was working on these visual elements, I was also figuring out how to do the "looking" mechanic, black and white transitions, figuring out how Tweego worked, radio buttons, and so on.
Do note I've been busy the entire time throughout, so perhaps you can do this much quicker than I can!
The "Secrets"
1. Please—look at IFs you love! What are some visual aspects of other IFs that you love and want to include in your story? I started by analyzing parts of other IFs that I love. I liked Wayfarer's textbox; I liked how the choices looked in When Twilight Strikes. I liked the textboxes in the beginning of Zorlok. Find the things that amaze you about other IFs, and implement it your own way!
This seems like super basic advice—but trust me, once you think, "How can I put this in my game?" you will not only be able to have it, but most likely, you'll also learn a LOT.
While seeing how I could make the radio buttons, for example, I started researching. I googled "How to live change text?" and then I found out about jQuery, how to use the replace macro, etc. etc. JUST from researching how to do exactly one (1) feature.
2. What is missing in other IFs? Think about your own reading experience. I didn't like the clunkiness of some, how the sidebar is on the side when space on a mobile-screen is severely limited length-wise. So, I put the sidebar on the bottom.
I didn't like how other choices look in IFs, so I wanted a way to do mine that's nice and elegant(though it's still a little hard to read, admittedly).
Again, researching how to do the things you want opens many doors for you. I learned how to style <li> and change how bullets look, learned how to style links in Twine in general, etc. etc. again with just this ONE thing I wanted to change/add.
3. Don't do the work all by yourself. I struggled so hard because I hate asking for help. I was happy to Google other people's problems, but I never thought to open up my own thread or ask anybody in the community for help. Please, not only ask, but also—your work doesn't have to be completely original.
Use templates. Look at manon's amazing masterlist of things you can implement. I also have a few macro's that you can use, like multipronouns for MC, that does the work for you, for free.
Rip people's codes—respectfully. I'm not saying from other IFs, but online in other places. If they appear on help forums or are publicly available through places like CodePen, chances are that they're open-source or licensed in such a way that anyone can use it (e.g. MIT license).
Again, here is Manon's masterlist, which includes custom macros you can use in your game (Chapel, HiEv and Cycy are my high recommendations)! Additionally, here's my code for multipronouns here and my code for setting RO genders here.
4. MAKE IT READABLE!! Even if you want your game to look pretty... please, I'm begging you, make it easy to read. This is the most important thing ever.
I have a short attention span, and so does my partner. We reviewed the game to make sure we are NOT compromising the reading experience with our design. As much as we want fantastical backgrounds, we wanted to make sure it was at least not distracting. As much as we want gaudy styles, we want the actual passage to be suited for the long haul.
The most, most important part is to enhance the reading experience--not by adding things on, but by making it simple and intuitive. As someone in the computer science field, the user experience is CRITICAL. Put yourself in their shoes, think about them first and foremost.
Twine is amazingly customizable, and its powers can be wielded for good and evil. Plenty of amazing writers but inexperienced UI designers, especially from CoG, get into Twine. CoG almost completely takes away the design element, so Twine is a whole new ballpark.
Uroboros has a lot of pomp, but the actual textbox is uncharacteristically simple in comparison. The simplicity against an otherwise fantastical, but non-distracting background helps give it elegance. The sidebar, in contrast, is very eye-catching—but, it's also out of view most of the time, and isn't built for long reading.
To add on, make sure it's readable on mobile. I guarantee 80% of your readers are going to be reading your IF on their phone, and probably at 3 AM, so you will want the mobile to look as good as PC, or even better.
Closing Thoughts
Anyway, as basic as this advice is, this is really what guided my entire thought process behind my visual choices! -- Picking and choosing what you like from IFs, figuring out how to do them through research, and making sure your IF is built to be read for a while.
Thanks so much for asking, thinking that I have wisdom to impart!! 😭🫶💕
94 notes · View notes
manonamora-if · 2 years
Text
Tumblr media
Hello person of the internet,
It is me again, your totally legit supplier of very good assets {100% GOOD!!! NO BUGS!!!}. I am back with another template for you! [Definitely not a SugarCube rip-off of the Chapbook base UI] This whole affair is still scam free and no bug included! Download another funky folder to make your projects even more greater! A simple template, still in exchange for nothing {YES, THIS IS STILL 100% FREE!!!} but your love and adoration for my help. What a steal! 
I PRESENT TO YOU THE...
One Page Template!
A 100% GOOD QUALITY template that you can download {YES OR FREE!!!} and share to your heart’s content!
ENJOY!!!
Tumblr media
The One Page Template Pack includes:
HTML ready-to-use file
Open Dyslexic Font 
.tw, .js and .css file for Tweego
Annotated passages, stylesheet and javascript
Mobile adapted (Portrait, min-width: 315px)
Template made on Twine (v 2.5.1)/Tweego with Sugarcube (v 2.36.1). Any use with other version may break some UI aspects (you may need to adjust those manually). It is recommended you create a new project and copy-paste the template's elements inside (Twine) or generate a new ifid (Tweego).
Note: the file only download does not come with the Open Dyslexic Font, you will need to download it and incorporate it separately.
If you do use this asset pack for a project, please tag me so I can see what you've done (also credit me so other find this template)!
If you have any question about or any issue with the template, send me an ask ! 
Consider rating and sharing this asset pack too! THANK YOU <3
Disclaimer:
The graphics and written presentation of this asset packs are meant to be a joke. This is obviously not a scam. The files are basic HTML/.tw/.js/.css files running on Twine/Sugarcube and have been tested for bugs.  They are completely editable and free to use. I will never require you to pay for those. 
150 notes · View notes
here is a basic code for a #deckEditor in an online game using HTML and JavaScript:
HTML code:
```
<!DOCTYPE html>
<html>
<head>
<title>Deck Editor</title>
</head>
<body>
<h1>Deck Editor</h1>
<div id="card-list">
<h2>Card List:</h2>
<ul id="cards">
<!-- populate with cards from database or API -->
<li>Card 1</li>
<li>Card 2</li>
<li>Card 3</li>
<li>Card 4</li>
<li>Card 5</li>
<li>Card 6</li>
<li>Card 7</li>
<li>Card 8</li>
<li>Card 9</li>
<li>Card 10</li>
</ul>
</div>
<div id="deck-list">
<h2>Deck:</h2>
<ul id="deck">
<!-- display selected cards here -->
</ul>
</div>
<button id="save-btn">Save Deck</button>
<button id="clear-btn">Clear Deck</button>
<script src="deck-editor.js"></script>
</body>
</html>
```
JavaScript code:
```
// get references to all necessary elements
const cardsList = document.getElementById('cards');
const deckList = document.getElementById('deck');
const saveBtn = document.getElementById('save-btn');
const clearBtn = document.getElementById('clear-btn');
// create an array to store selected cards
let deck = [];
// function to add a card to the deck
function addCard(event) {
// get the clicked card
const card = event.target;
// check if card is already in deck
if (deck.includes(card.innerText)) {
alert('Card already in deck!');
} else {
// add card to deck array
deck.push(card.innerText);
// create a new li element for the card
const li = document.createElement('li');
li.innerText = card.innerText;
// append li to deck list
deckList.appendChild(li);
}
}
// function to remove a card from the deck
function removeCard(event) {
// get the clicked card
const card = event.target;
// remove card from deck array
deck.splice(deck.indexOf(card.innerText), 1);
// remove card from deck list
card.parentNode.removeChild(card);
}
// add event listeners to cards in card list
cardsList.addEventListener('click', addCard);
// add event listeners to cards in deck list
deckList.addEventListener('click', removeCard);
// function to save deck
function saveDeck() {
// check if deck is empty
if (deck.length === 0) {
alert('Deck is empty!');
} else {
// send deck array to server or save in database
console.log(deck);
alert('Deck saved!');
}
}
// function to clear deck
function clearDeck() {
// remove all cards from deck array
deck = [];
// remove all cards from deck list
while (deckList.firstChild) {
deckList.removeChild(deckList.firstChild);
}
}
// add event listener to save button
saveBtn.addEventListener('click', saveDeck);
// add event listener to clear button
clearBtn.addEventListener('click', clearDeck);
```
Note: This is a basic code and can be improved and customized according to your specific needs and game requirements.
8 notes · View notes
quietmarie · 10 months
Text
Anyone can program (yes, even you)
"Programming is easy"
I saw some variations of this statement shared around the site recently, always in good intentions of course, but it got me thinking.
Is that really true?
Well it certainly isn't hard in the way some developers would want to make you believe. A great skill bestowed only upon the greatest of minds, they're the ones making the world work. You better be thankful.
That is just elitist gibberish. If anyone ever tells you that programmers are "special people" in that way, or tries to sell you on the idea of "real" programmers that are somehow better than the rest, you can safely walk in the other direction. They have nothing of value to tell you.
But I think the answer is more complicated than a simple "Yes, programming is easy" too. In all honesty, I don't think it's an easy thing to "just pick up" at all. It can be very unintuitive at first to wrap your head around just how to tell a computer to solve certain problems.
One person in the codeblr Discord server likened it to cooking. That's a skill that can be very hard, but it's also something that everyone can learn. Anyone can cook. And anyone can program.
I really mean that. No need to be good at maths, to know what a bit is or whatever it is people told you you need. You're not too old to learn it either, or too young for that matter. If you want to start programming (and you can read this post), you already have everything you need. You can write your first little programs today!
One of the cool things about programming is that you can just fuck around and try lots of stuff, and it's fine. Realistically, the worst thing that can happen is that it doesn't work the way you imagined. But you'll never accidentally trigger the fire alarm or burn your house down, so feel free to just try a bunch of stuff.
"Okay I want to learn programming now, what do I do?"
That's awesome, I love the enthusiasm! As much as I'd love to just give you a resource and tell you to build a thing, you still have to make a choice what you want to learn first. The options I'd recommend are:
Scratch: A visual education tool. The main advantage is that you don't have to worry about the exact words you need to write down, you can just think about the structure of your program. The way it works is that you drag and drop program elements to be executed when they should be. You can relatively quickly learn to make cute little games in it. The downside is that this isn't really a "professional" programming language, so, while learning from Scratch will give you the basics that apply to most languages and will make switching to another language easier, you're still gonna have to switch sooner or later. Start here: https://scratch.mit.edu/
Python: The classic choice. Python is a very widely used, flexible programming language that is suited for beginners. It is what I would recommend if you want to skip right to or move on from Scratch to a more flexible language. https://automatetheboringstuff.com/ is your starting point, but there's also a longer list of resources here if you want to check that out at some point.
HTML/CSS/JavaScript: The web path. HTML and CSS are for creating the look of websites, and JavaScript is for the interactive elements. For example, if you ever played a game in your browser, that was probably written in JS. Since HTML and CSS are just for defining how the website should look, they're different from traditional programming languages, and you won't be able to write programs in them, that's what JS is for. You have to know HTML before you learn CSS, but otherwise the order in which you learn these is up to you. Your JavaScript resource is https://javascript.info/, and for HTML and CSS you can check out https://developer.mozilla.org/en-US/docs/Learn/Getting_started_with_the_web.
I put some starting out resources here, but they're really just that - they're for starting out. You don't have to stick to them. If you find another path that suits you better, or if you want to get sidetracked with another resource or project, go for it! Your path doesn't have to be linear at all, and there's no "correct" way to learn things.
One of the most important things you'll want to do is talk to developers when you struggle. The journey is going to be frustrating at times, so search out beginner-friendly coding communities on Discord or wherever you're comfortable. The codeblr community certainly tends to be beginner-friendly and kind. My DMs and asks are also open on here.
16 notes · View notes
ogxfuturetech · 1 month
Text
Tumblr media
The Comprehensive Guide to Web Development, Data Management, and More 
Introduction 
Everything today is technology driven in this digital world. There's a lot happening behind the scenes when you use your favorite apps, go to websites, and do other things with all of those zeroes and ones — or binary data. In this blog, I will be explaining what all these terminologies really means and other basics of web development, data management etc. We will be discussing them in the simplest way so that this becomes easy to understand for beginners or people who are even remotely interested about technology.  JOIN US
What is Web Development? 
Web development refers to the work and process of developing a website or web application that can run in a web browser. From laying out individual web page designs before we ever start coding, to how the layout will be implemented through HTML/CSS. There are two major fields of web development — front-end and back-end. 
Front-End Development 
Front-end development, also known as client-side development, is the part of web development that deals with what users see and interact with on their screens. It involves using languages like HTML, CSS, and JavaScript to create the visual elements of a website, such as buttons, forms, and images. JOIN US
HTML (HyperText Markup Language): 
HTML is the foundation of all website, it helps one to organize their content on web platform. It provides the default style to basic elements such as headings, paragraphs and links. 
CSS (Cascading Style Sheets):  
styles and formats HTML elements. It makes an attractive and user-friendly look of webpage as it controls the colors, fonts, layout. 
JavaScript :  
A language for adding interactivity to a website Users interact with items, like clicking a button to send in a form or viewing images within the slideshow. JOIN US
Back-End Development 
The difference while front-end development is all about what the user sees, back end involves everything that happens behind. The back-end consists of a server, database and application logic that runs on the web. 
Server: 
A server is a computer that holds website files and provides them to the user browser when they request it. Server-Side: These are populated by back-end developers who build and maintain servers using languages like Python, PHP or Ruby. 
Database:  
The place where a website keeps its data, from user details to content and settings The database is maintained with services like MySQL, PostgreSQL, or MongoDB. JOIN US
Application Logic —  
the code that links front-end and back-end It takes user input, gets data from the database and returns right informations to front-end area. 
Tumblr media
Why Proper Data Management is Absolutely Critical 
Data management — Besides web development this is the most important a part of our Digital World. What Is Data Management? It includes practices, policies and procedures that are used to collect store secure data in controlled way. 
Data Storage –  
data after being collected needs to be stored securely such data can be stored in relational databases or cloud storage solutions. The most important aspect here is that the data should never be accessed by an unauthorized source or breached. JOIN US
Data processing:  
Right from storing the data, with Big Data you further move on to process it in order to make sense out of hordes of raw information. This includes cleansing the data (removing errors or redundancies), finding patterns among it, and producing ideas that could be useful for decision-making. 
Data Security:  
Another important part of data management is the security of it. It refers to defending data against unauthorized access, breaches or other potential vulnerabilities. You can do this with some basic security methods, mostly encryption and access controls as well as regular auditing of your systems. 
Other Critical Tech Landmarks 
There are a lot of disciplines in the tech world that go beyond web development and data management. Here are a few of them: 
Cloud Computing 
Leading by example, AWS had established cloud computing as the on-demand delivery of IT resources and applications via web services/Internet over a decade considering all layers to make it easy from servers up to top most layer. This will enable organizations to consume technology resources in the form of pay-as-you-go model without having to purchase, own and feed that infrastructure. JOIN US
Cloud Computing Advantages:  
Main advantages are cost savings, scalability, flexibility and disaster recovery. Resources can be scaled based on usage, which means companies only pay for what they are using and have the data backed up in case of an emergency. 
Examples of Cloud Services: 
Few popular cloud services are Amazon Web Services (AWS), Microsoft Azure, and Google Cloud. These provide a plethora of services that helps to Develop and Manage App, Store Data etc. 
Cybersecurity 
As the world continues to rely more heavily on digital technologies, cybersecurity has never been a bigger issue. Protecting computer systems, networks and data from cyber attacks is called Cyber security. 
Phishing attacks, Malware, Ransomware and Data breaches: 
This is common cybersecurity threats. These threats can bear substantial ramifications, from financial damages to reputation harm for any corporation. 
Cybersecurity Best Practices:  
In order to safeguard against cybersecurity threats, it is necessary to follow best-practices including using strong passwords and two-factor authorization, updating software as required, training employees on security risks. 
Artificial Intelligence and Machine Learning 
Artificial Intelligence (AI) and Machine Learning (ML) represent the fastest-growing fields of creating systems that learn from data, identifying patterns in them. These are applied to several use-cases like self driving cars, personalization in Netflix. 
AI vs ML —  
AI is the broader concept of machines being able to carry out tasks in a way we would consider “smart”. Machine learning is a type of Artificial Intelligence (AI) that provides computers with the ability to learn without being explicitly programmed. JOIN US
Applications of Artificial Intelligence and Machine Learning: some common applications include Image recognition, Speech to text, Natural language processing, Predictive analytics Robotics. 
Web Development meets Data Management etc. 
We need so many things like web development, data management and cloud computing plus cybersecurity etc.. but some of them are most important aspects i.e. AI/ML yet more fascinating is where these fields converge or play off each other. 
Web Development and Data Management 
Web Development and Data Management goes hand in hand. The large number of websites and web-based applications in the world generate enormous amounts of data — from user interactions, to transaction records. Being able to manage this data is key in providing a fantastic user experience and enabling you to make decisions based on the right kind of information. 
E.g. E-commerce Website, products data need to be saved on server also customers data should save in a database loosely coupled with orders and payments. This data is necessary for customization of the shopping experience as well as inventory management and fraud prevention. 
Cloud Computing and Web Development 
The development of the web has been revolutionized by cloud computing which gives developers a way to allocate, deploy and scale applications more or less without service friction. Developers now can host applications and data in cloud services instead of investing for physical servers. 
E.g. A start-up company can use cloud services to roll out the web application globally in order for all users worldwide could browse it without waiting due unavailability of geolocation prohibited access. 
The Future of Cybersecurity and Data Management 
Which makes Cybersecurity a very important part of the Data management. The more data collected and stored by an organization, the greater a target it becomes for cyber threats. It is important to secure this data using robust cybersecurity measures, so that sensitive information remains intact and customer trust does not weaken. JOIN US
Ex: A healthcare provider would have to protect patient data in order to be compliant with regulations such as HIPAA (Health Insurance Portability and Accountability Act) that is also responsible for ensuring a degree of confidentiality between a provider and their patients. 
Conclusion 
Well, in a nutshell web-developer or Data manager etc are some of the integral parts for digital world.
As a Business Owner, Tech Enthusiast or even if you are just planning to make your Career in tech — it is important that you understand these. With the progress of technology never slowing down, these intersections are perhaps only going to come together more strongly and develop into cornerstones that define how we live in a digital world tomorrow. 
With the fundamental knowledge of web development, data management, automation and ML you will manage to catch up with digital movements. Whether you have a site to build, ideas data to manage or simply interested in what’s hot these days, skills and knowledge around the above will stand good for changing tech world. JOIN US
4 notes · View notes
cssscriptcom · 2 months
Text
Create Custom Alerts/Tooltips/Popovers with Bobpop.js
Bobpop.js is a Vanilla JavaScript library for creating customizable popup windows. It uses the Popover API and CSS anchors to generate tooltips, popovers, and alert modals on web pages. How it works: Bobpop.js works by dynamically creating HTML elements and styling them using JavaScript. When you call the bobpop() function, it generates a new <div> element. This element represents the popup…
3 notes · View notes
ss-tech-services · 18 days
Text
Proven Techniques for Ranking Higher on Google
Tumblr media
Google is a powerful search engine, and seeking ways to place one's website at the top is important for enhancing the website's visibility, attracting more traffic, as well as the success of the online presence. At the digital marketing agency, we recognize that optimization is vital as there are millions of sites competing for the first places. Therefore, it is possible to use effective methods which cut across Google’s successful methods. In this article, we present systems that have been tested and proven to improve your google ranking and more traffic to your website.
1.Do a proper keyword research
Keyword research is the most important part of an SEO strategy. It is because by knowing what the intended audience is searching for you will be able to develop content that cuts across.
Action Steps:
Use Keyword Tools: Use high traffic specific keywords’ search volume tools like Google Keyword planner, Ahref, SEM rush etc. to search for keywords with low competition.
Analyze Competitors: Look at the keywords that are working for your competitors and narrow dow n on the related ones.
Focus on Long-Tail Keywords: The phrases are less competitive in nature and since they are more specific they lead to higher conversions.
2. Better the On-Page SEO Optimization
On page SEO Optimization is the process of editing and facilitating changes on the pages of a web document in order to make them rank well and fit to the targeted audience. Such changes may involve content optimization of the webpage, markup optimization improvement of the HTML source code.
Action Steps:
Rewriting and Optimization Strategy Title Tags and Meta Descriptions: Always ensure you note your page title and all the meta area as it has been promised to the readers and throughout the website.
Header Tags: Help cluster words and enhance comprehension by assigning H1 tags for the headline as the highest, H2, H3, etc for the subtitles.
URL Structure: Lines should be simple and moderate but include powerful words that are in line with what you are targeting.
Internal Linking: Where necessary links are created to other pages which are relevant to the current page being viewed by users and helps to spread out the link equity within the site.
3. Create High-Quality Content
Content is a very important element of SEO. Content, when properly designed, well written and is valuable and informative, will drive visitors, retain them and help establish credibility on a given niche.
Action Steps: Write for Your Audience: Use Solutions oriented approach where every word helps to eliminate audience problems.
Incorporate Keywords Naturally: Avoid abrupt keyword inclusion or excess use of keywords in the content.
Use Multimedia: Use of multimedia such as, images, animations, values etc to assist in a more appealing manner and also hold attention.
4.Enhance User Experience (UX)
The most important aspect with any Google ranking of the website is the user experience. Along with other factors, page speed, mobile usability, and site hierarchy are considerable for rankings.
Action Steps:
Improve Page Speed: It is possible to analyze why their site is slow through the use of Google PageSpeed and rectify the site’s speed. Spelling out some issues – Image compression, browser caching, CSS and javascript files minification.
Mobile-friendly Site Design: Create a website that is responsive to any device and that offers the same level of interaction regardless of the device used. With Google focusing on mobile first indexing, this becomes self-explanatory.
Utilize simple Structure: Website usability should be observed through the enabling of a better navigation structure and size of the website. This enables the website content to be easily accessed reducing the levels of bouncing.
5. Improve Quality of Backlinks
Links are an essential component of the parameters used in the Google algorithm, page rank among them. Backlinks from other websites with high reputation which are also relevant to the topic covered by a site will in most cases optimize the site.
Action Steps:
Develop Great Content: Write content that will drive people to share it, persuasive contents such as how to guides and case studies, original research.
Advertising through blogs: Write articles as a guest for reputable blogs in the niche and ensure to include a link to one’s site in the author information or within the article text.
6. Geo-targeting
For businesses that are into a certain geographic perspective, optimizing local search can get them local patrons and also enhance the local ranking.
Action Steps:
Claim Your Google My Business Listing: Your Google My Business profile must have all relevant details about your ventures such as addresses and business hours.
Social Media – Add Local Clientele Keywords: Identify local phrases and use them when generating content, title tags and meta descriptions.
Encouraging Reviews: Actively ask clients to review your services on Google and any other outlets and respond to them if possible, as good reviews will help boost your visibility in local search results.
7.Review and Performance metrics
It allows you to keep track of and evaluate your performance in line with search engine optimization. Bring out the strengths and weaknesses by utilizing the right tools.
Action Steps:
Google Analytics: Establish and analyze google analytical for effective tracking of such elements as the frequency of visitors, viewership and even exit of visitors.
Google Search Console: Use the GSC to see how well your web page performs, fixes, and submits the sitemap of your web page.
Finesse your strategies: With the use of prior or primary researches, refine any of your current seo methods. Adequate emphasis should be placed on aspects with some room for growth as well as recent developments on global search engine behaviors.
8. Follow New SEO Trends
SEO, as any other discipline, is dynamic, thus, it is important for the SEO professionals to go on top of the new developments and any new releases in a bid to keep their positions and even enhance them.
Action Steps:
Follow Industry Blogs: Sign up to popular and authoritative SEO blog sites and forums as fresh content and relevant changes are posted.
Participate in Webinars and Conferences: Join the SEO web-based presentations and conferences to listen to the views from other relevant fields.
Adapt to Algorithm Changes: Many changes concerning the Google algorithm are commonplace. This means these things are happening in a constant rush and therefore SEO strategies had to be altered with the changes.
Conclusion
Achieving a good rank on Google is a process that requires effective execution of multiple strategies like keyword research, website on-page and off page optimization, content writing and technical enhancement, etc. Downham Digital Marketing is dedicated to assist companies who wish to adopt these tested approaches to increase their online exposures. Keep in mind that SEO is not a one-time thing; it requires persistent revisions and improvements for the strategies to survive the competitive scene. For further assistance with your SEO efforts, be sure to contact our team of experts at SS TECH SERVICES as they employ state-of-the-art strategies and approaches.
2 notes · View notes
saide-hossain · 1 month
Text
Let's understand HTML
Tumblr media
Cover these topics to complete your HTML journey.
HTML (HyperText Markup Language) is the standard language used to create web pages. Here's a comprehensive list of key topics in HTML:
1. Basics of HTML
Introduction to HTML
HTML Document Structure
HTML Tags and Elements
HTML Attributes
HTML Comments
HTML Doctype
2. HTML Text Formatting
Headings (<h1> to <h6>)
Paragraphs (<p>)
Line Breaks (<br>)
Horizontal Lines (<hr>)
Bold Text (<b>, <strong>)
Italic Text (<i>, <em>)
Underlined Text (<u>)
Superscript (<sup>) and Subscript (<sub>)
3. HTML Links
Hyperlinks (<a>)
Target Attribute
Creating Email Links
4. HTML Lists
Ordered Lists (<ol>)
Unordered Lists (<ul>)
Description Lists (<dl>)
Nesting Lists
5. HTML Tables
Table (<table>)
Table Rows (<tr>)
Table Data (<td>)
Table Headings (<th>)
Table Caption (<caption>)
Merging Cells (rowspan, colspan)
Table Borders and Styling
6. HTML Forms
Form (<form>)
Input Types (<input>)
Text Fields (<input type="text">)
Password Fields (<input type="password">)
Radio Buttons (<input type="radio">)
Checkboxes (<input type="checkbox">)
Drop-down Lists (<select>)
Textarea (<textarea>)
Buttons (<button>, <input type="submit">)
Labels (<label>)
Form Action and Method Attributes
7. HTML Media
Images (<img>)
Image Maps
Audio (<audio>)
Video (<video>)
Embedding Media (<embed>)
Object Element (<object>)
Iframes (<iframe>)
8. HTML Semantic Elements
Header (<header>)
Footer (<footer>)
Article (<article>)
Section (<section>)
Aside (<aside>)
Nav (<nav>)
Main (<main>)
Figure (<figure>), Figcaption (<figcaption>)
9. HTML5 New Elements
Canvas (<canvas>)
SVG (<svg>)
Data Attributes
Output Element (<output>)
Progress (<progress>)
Meter (<meter>)
Details (<details>)
Summary (<summary>)
10. HTML Graphics
Scalable Vector Graphics (SVG)
Canvas
Inline SVG
Path Element
11. HTML APIs
Geolocation API
Drag and Drop API
Web Storage API (localStorage and sessionStorage)
Web Workers
History API
12. HTML Entities
Character Entities
Symbol Entities
13. HTML Meta Information
Meta Tags (<meta>)
Setting Character Set (<meta charset="UTF-8">)
Responsive Web Design Meta Tag
SEO-related Meta Tags
14. HTML Best Practices
Accessibility (ARIA roles and attributes)
Semantic HTML
SEO (Search Engine Optimization) Basics
Mobile-Friendly HTML
15. HTML Integration with CSS and JavaScript
Linking CSS (<link>, <style>)
Adding JavaScript (<script>)
Inline CSS and JavaScript
External CSS and JavaScript Files
16. Advanced HTML Concepts
HTML Templates (<template>)
Custom Data Attributes (data-*)
HTML Imports (Deprecated in favor of JavaScript modules)
Web Components
These topics cover the breadth of HTML and will give you a strong foundation for web development.
Full course link for free: https://shorturl.at/igVyr
2 notes · View notes
fujowebdev · 1 year
Note
Ok, I swear to take your “possible outline of future books” with a grain of salt. So, what is it?
Since you pinkie-promise, here’s some potential topics we’re considering for future volumes:
An issue covering basic web pages featuring HTML, CSS, and ARIA. In particular, we would want to focus on types of layouts that fandom people are likely to want to build, such as shrines or galleries, as well as how to make them both aesthetically pleasing and accessible. This issue would be aimed at helping readers create small websites with a few pages.
An issue covering Static Site Generators and the basics of creating reusable components for yourself or installing npm packages to reuse tools other people have made. Taking the jargon out, this would help readers build larger websites with many pages (like blogs) and create visual elements they can reuse across different pages or even projects.
An issue covering more complex interactivity in the browser itself—yes, we’re talking about JavaScript! 😊 This topic is very broad and we didn’t discuss it in depth yet since it’s a long way from where we are at now. As we see it, readers should learn enough about how interactive web pages work to confidently build things like, for example, a “dress up game”. 
An issue about automation and using JavaScript as a server technology. This could cover things like, “How do I send a notification to my Discord server whenever a new fanfiction is published in a specific AO3 tag?” or “How do I add a guestbook to my website?”.
Aside from these concepts, there is one topic we’d like to cover that is less technical but we still believe would be extremely helpful: what content does one put on their website, anyway? 
As we spend less and less time looking at other people’s personal websites and fandom shrines, we also lose the sense of what content would go into one of our own. For our larger plan to succeed, it’s fundamental that we also help people move past “blank website syndrome” and give them tools to jumpstart their creativity.
20 notes · View notes
izicodes · 8 months
Text
Mini React.js Tips #3 | Resources ✨
Tumblr media
Continuing the #mini react tips series, its components making time~!
In React, a component is like a Lego brick for building websites or apps. It's a small, independent part of the user interface (UI) that you can reuse whenever you need it. These components can be combined to create bigger and more complex applications. Examples are the header, footer, cards, asides, etc!
What you'll need:
know how to create a React project >> click
know the default React project's file structure >> click
know basic HTML
know basic JavaScript
basic knowledge of using the Terminal
Tumblr media
What We Are Creating:
Tumblr media
The footer at the bottom!
Tumblr media
[ 1 ] Navigate to the 'src' Folder: Open your project in Visual Studio Code, locate the 'src' folder, and right-click on it.
[ 2 ] Create a New File: Click 'New File' to create the file within the 'src' folder. This file will house the code for your React component.
Tumblr media
[ 3 ] Naming Conventions: Give your component a name, according to the convention of starting with a capital letter. This naming convention is essential for React to recognize your component~!!
Tumblr media
[ 4 ] Create The Initial Function: Open the file and type:
export default function [name of component]() {}
Tumblr media
[ 5 ] Insert The return() Statement: The statement is used within a component to specify what content should be rendered when the component is invoked or used. Type:
return()
Tumblr media
*the error is there because we haven't added anything inside yet, don't worry!
[ 6 ] Insert The Empty Tags: Inside of the return(), add empty tags (tags that don't have a specified element inside of them).
Tumblr media
[ 7 ] Time For Some HTML: Inside the empty tags, enter the normal HTML elements that you want~!
Tumblr media
[ 8 ] Integration with App.jsx: Navigate to the 'App.jsx' file in the project, which is typically the entry point of your React application. At the top, import your newly created component. Type:
import [name of component] from './[location of the component]'
Tumblr media
[ 9 ] Use Your Component: Inside the return() statement of the 'App()' function, include your component using the following syntax:
<[name of your component] />
Tumblr media
[ 10 ] Run the Development Server: Start your development server with the command (the 'Local' link):
npm run dev
Tumblr media
[ 11 ] Preview Your Project: Open the link provided in your terminal in your web browser. Witness your component in action!
Tumblr media Tumblr media
Congratulations! You made your first component! Try and create some new ones and place them around in the App()~!
BroCode’s 'React Full Course for Free’ 2024 >> click
React Official Website >> click
W3School's React Components >> click
Importing and Exporting Components >> click
🐬Previous Tip: Tip #2 The anatomy of the default React project >> click
Stay tuned for the other posts I will make on this series #mini react tips~!
33 notes · View notes
anbroids · 11 months
Note
hi!!! I loved ur hometsuck kids theme sm it made me want to go back into coding after so long(^^; I wanted to know how u learned it and if u have any tips for newcomers. Ty !!
oh holy shit this is ask is SO SWEET :,) thank you so much anon and i’m so happy to hear it made you want to get back into coding! we seriously need a tumblr theme renaissance. what i would give to see people coding and sharing/reblogging themes like the older days on tumblr. life could be dream.
i learned html and css from making my own tumblr themes as a kid! i think tumblr themes are literally such a good introduction into learning front-end development. BUT to be fair i also took a few programming classes and was a big coding nerd in school and that definitely helped me become a lot more comfortable with making themes from scratch and adding custom script. if you are interested in learning javascript, learnjavascript.online is a great source for starting out and getting some practice!
i think a great way to get your bearings is to look at some base themes and poke around at the code just to familiarize yourself with some of the tumblr-specific syntax. @theme-hunter has a great database of themes to look at with some tutorials for beginners compiled here. i think the best way to learn how div blocks function and what you are capable of changing is by playing around with preexisting code and seeing what you can create. i did this until i was comfortable enough to make a few base themes of my own from scratch that i can go back and reference when starting a new theme or coding project.
tumblr also has a list of their block elements online with some introduction to custom themes, which is helpful to reference when styling the features built into each tumblr blog like title, descriptions, posts, notes, etc.
as far as tips for newcomers, here’s a few things top of mind:
google is your best friend, seriously, i can't tell you how many times i am googling the most rudimentary of things because i'm always forgetting little syntax things. chances are, if there's something you want to achieve with code there will be someone on stack overflow with some advice, or a tutorial on codepen or w3schools that you can use as reference.
troubleshoot with inspect element! i usually build my code straight into the tumblr theme html and css on a sideblog, save, and then keep a tab of that blog open that i can refresh and inspect element to look for errors in the console. i think firefox works the best, but i would recommend always loading your blog in a few different browsers since there is css syntax that is specific to mozilla or chrome (eg. custom scrollbars or pure-css animations)
there are lot of browser extensions that can make the coding process easier! i recommend eye dropper for pulling and matching hex codes. i also use fonts ninja a lot for getting accurate weights and names for custom fonts. a few more that come to mind are window resizer and css viewer (chrome/mozilla) if you want to check those out!
happy coding!
8 notes · View notes