intial
This commit is contained in:
parent
e19ebb48c8
commit
3ec90619cd
3 changed files with 138 additions and 0 deletions
58
CSS/style.css
Normal file
58
CSS/style.css
Normal file
|
|
@ -0,0 +1,58 @@
|
||||||
|
/* General Reset */
|
||||||
|
* {
|
||||||
|
margin: 0;
|
||||||
|
padding: 0;
|
||||||
|
box-sizing: border-box;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Body Styling */
|
||||||
|
body {
|
||||||
|
font-family: Arial, sans-serif;
|
||||||
|
line-height: 1.6;
|
||||||
|
background-color: #f4f4f4;
|
||||||
|
color: #333;
|
||||||
|
padding: 20px;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Header Styling */
|
||||||
|
header {
|
||||||
|
background: #333;
|
||||||
|
color: #fff;
|
||||||
|
padding: 10px 20px;
|
||||||
|
text-align: center;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Navigation Styling */
|
||||||
|
nav {
|
||||||
|
margin: 20px 0;
|
||||||
|
text-align: center;
|
||||||
|
}
|
||||||
|
|
||||||
|
nav a {
|
||||||
|
color: #333;
|
||||||
|
text-decoration: none;
|
||||||
|
margin: 0 10px;
|
||||||
|
font-weight: bold;
|
||||||
|
}
|
||||||
|
|
||||||
|
nav a:hover {
|
||||||
|
color: #007BFF;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Main Content Styling */
|
||||||
|
main {
|
||||||
|
background: #fff;
|
||||||
|
padding: 20px;
|
||||||
|
border-radius: 5px;
|
||||||
|
box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Footer Styling */
|
||||||
|
footer {
|
||||||
|
text-align: center;
|
||||||
|
margin-top: 20px;
|
||||||
|
padding: 10px;
|
||||||
|
background: #333;
|
||||||
|
color: #fff;
|
||||||
|
border-radius: 5px;
|
||||||
|
}
|
||||||
31
Javascript/script.js
Normal file
31
Javascript/script.js
Normal file
|
|
@ -0,0 +1,31 @@
|
||||||
|
// Basic D3 Script
|
||||||
|
|
||||||
|
// Create an SVG container
|
||||||
|
const svg = d3.select("body")
|
||||||
|
.append("svg")
|
||||||
|
.attr("width", 500)
|
||||||
|
.attr("height", 500);
|
||||||
|
|
||||||
|
// Add a circle to the SVG
|
||||||
|
svg.append("circle")
|
||||||
|
.attr("cx", 250)
|
||||||
|
.attr("cy", 250)
|
||||||
|
.attr("r", 50)
|
||||||
|
.attr("fill", "blue");
|
||||||
|
|
||||||
|
// Add a rectangle to the SVG
|
||||||
|
svg.append("rect")
|
||||||
|
.attr("x", 200)
|
||||||
|
.attr("y", 300)
|
||||||
|
.attr("width", 100)
|
||||||
|
.attr("height", 50)
|
||||||
|
.attr("fill", "green");
|
||||||
|
|
||||||
|
// Add some text to the SVG
|
||||||
|
svg.append("text")
|
||||||
|
.attr("x", 250)
|
||||||
|
.attr("y", 100)
|
||||||
|
.attr("text-anchor", "middle")
|
||||||
|
.attr("font-size", "20px")
|
||||||
|
.attr("fill", "black")
|
||||||
|
.text("Hello, D3!");
|
||||||
49
index.html
Normal file
49
index.html
Normal file
|
|
@ -0,0 +1,49 @@
|
||||||
|
<!DOCTYPE html>
|
||||||
|
<html lang="en">
|
||||||
|
<head>
|
||||||
|
<meta charset="UTF-8">
|
||||||
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||||
|
<title>Basic Webpage with D3</title>
|
||||||
|
<style>
|
||||||
|
body {
|
||||||
|
font-family: Arial, sans-serif;
|
||||||
|
margin: 0;
|
||||||
|
padding: 0;
|
||||||
|
}
|
||||||
|
header, footer {
|
||||||
|
background-color: #f4f4f4;
|
||||||
|
text-align: center;
|
||||||
|
padding: 1em 0;
|
||||||
|
}
|
||||||
|
main {
|
||||||
|
padding: 20px;
|
||||||
|
}
|
||||||
|
#d3-content {
|
||||||
|
margin: 20px auto;
|
||||||
|
width: 80%;
|
||||||
|
height: 400px;
|
||||||
|
border: 1px solid #ccc;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
<header>
|
||||||
|
<h1>Welcome to My D3 Webpage</h1>
|
||||||
|
</header>
|
||||||
|
<main>
|
||||||
|
<h2>D3 Content Area</h2>
|
||||||
|
<div id="d3-content"></div>
|
||||||
|
</main>
|
||||||
|
<footer>
|
||||||
|
<p>© 2023 My Website</p>
|
||||||
|
</footer>
|
||||||
|
<script src="https://d3js.org/d3.v7.min.js"></script>
|
||||||
|
<script>
|
||||||
|
// D3 content will go here
|
||||||
|
const svg = d3.select("#d3-content")
|
||||||
|
.append("svg")
|
||||||
|
.attr("width", "100%")
|
||||||
|
.attr("height", "100%");
|
||||||
|
</script>
|
||||||
|
</body>
|
||||||
|
</html>
|
||||||
Loading…
Reference in a new issue