HTML preprocessors can make writing HTML more powerful or convenient. For instance, Markdown is designed to be easier to write and read for text documents and you could write a loop in Pug.
In CodePen, whatever you write in the HTML editor is what goes within the <body>
tags in a basic HTML5 template. So you don't have access to higher-up elements like the <html>
tag. If you want to add classes there that can affect the whole document, this is the place to do it.
In CodePen, whatever you write in the HTML editor is what goes within the <body>
tags in a basic HTML5 template. If you need things in the <head>
of the document, put that code here.
The resource you are linking to is using the 'http' protocol, which may not work when the browser is using https.
CSS preprocessors help make authoring CSS easier. All of them offer things like variables and mixins to provide convenient abstractions.
It's a common practice to apply CSS to a page that styles elements such that they are consistent across all browsers. We offer two of the most popular choices: normalize.css and a reset. Or, choose Neither and nothing will be applied.
To get the best cross-browser support, it is a common practice to apply vendor prefixes to CSS properties and values that require them to work. For instance -webkit-
or -moz-
.
We offer two popular choices: Autoprefixer (which processes your CSS server-side) and -prefix-free (which applies prefixes via a script, client-side).
Any URLs added here will be added as <link>
s in order, and before the CSS in the editor. You can use the CSS from another Pen by using its URL and the proper URL extension.
You can apply CSS to your Pen from any stylesheet on the web. Just put a URL to it here and we'll apply it, in the order you have them, before the CSS in the Pen itself.
You can also link to another Pen here (use the .css
URL Extension) and we'll pull the CSS from that Pen and include it. If it's using a matching preprocessor, use the appropriate URL Extension and we'll combine the code before preprocessing, so you can use the linked Pen as a true dependency.
JavaScript preprocessors can help make authoring JavaScript easier and more convenient.
Babel includes JSX processing.
Any URL's added here will be added as <script>
s in order, and run before the JavaScript in the editor. You can use the URL of any other Pen and it will include the JavaScript from that Pen.
You can apply a script from anywhere on the web to your Pen. Just put a URL to it here and we'll add it, in the order you have them, before the JavaScript in the Pen itself.
If the script you link to has the file extension of a preprocessor, we'll attempt to process it before applying.
You can also link to another Pen here, and we'll pull the JavaScript from that Pen and include it. If it's using a matching preprocessor, we'll combine the code before preprocessing, so you can use the linked Pen as a true dependency.
Search for and use JavaScript packages from npm here. By selecting a package, an import
statement will be added to the top of the JavaScript editor for this package.
Using packages here is powered by Skypack, which makes packages from npm not only available on a CDN, but prepares them for native JavaScript ES6 import
usage.
All packages are different, so refer to their docs for how they work.
If you're using React / ReactDOM, make sure to turn on Babel for the JSX processing.
If active, Pens will autosave every 30 seconds after being saved once.
If enabled, the preview panel updates automatically as you code. If disabled, use the "Run" button to update.
If enabled, your code will be formatted when you actively save your Pen. Note: your code becomes un-folded during formatting.
Visit your global Editor Settings.
<!DOCTYPE html>
<html lang="ja">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>[email protected]</title>
<style>
h1,h2,h3{text-indent:1em;font-family:"Small Fonts"}
h1 {
border-bottom: solid 3px skyblue;
position: relative;
}
h1 {
background: linear-gradient(transparent 70%, #a7d6ff 70%);
}
</style>
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css">
<script src="https://code.jquery.com/jquery-3.2.1.min.js"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js"></script>
</head>
<body>
<div class="content-fluid">
<h1>Welcome to ESP32 Web Page</h1>
<!-- タブ・メニュー -->
<ul class="nav nav-tabs">
<li class="active"><a href="#content1" data-toggle="tab">What is ESP32 ?</a></li>
<li><a href="#content2" data-toggle="tab">ESP32's spec</a></li>
<li><a href="#content3" data-toggle="tab">Servo Control page</a></li>
<li><a href="#content4" data-toggle="tab">その他お知らせ</a></li>
</ul>
<!-- タブ内容 -->
<div class="tab-content">
<div class="tab-pane active" id="content1">
<p>ESP32が新たな仲間に加わりました</p>
<img src="https://tekuteku-embedded.xyz/wp-content/uploads/2020/10/ESP32-1-scaled.jpg" alt="" width="30%" height="30%">
<h3>ESP32の4つのメリット</h3>
<!-- Panel部分-->
<div class="panel panel-info">
<div class="panel-heading">
はやい
</div>
<div class="panel-body">
TensilicaのXtensa LX6マイクロプロセッサを採用<br>
最大動作周波数240MHzを達成。ArduinoUNOに比べ実に10倍以上の速度差を実現。
</div>
</div>
<div class="panel panel-success">
<div class="panel-heading">
やすい
</div>
<div class="panel-body">
1500円と激安価格で入手可能。<br>
ArduinoUNOが4000円に対して、価格でもUNOを圧倒。
</div>
</div>
<div class="panel panel-primary">
<div class="panel-heading">
つながる
</div>
<div class="panel-body">
Bluetooth Classic /BLE, WIFIモジュールを実装。<br>
技適取得済みで、通信機能も盤石。
</div>
</div>
<div class="panel panel-warning">
<div class="panel-heading">
わかる
</div>
<div class="panel-body">
誰もが大好きArduinoIDEでの開発が可能。豊富なライブラリを
簡単に利用でき、意のままにあつかえる。
</div>
</div>
</div>
<div class="tab-pane" id="content2">
<h3>ESP32スペック情報</h3>
<table class="table table-striped table-bordered table-hover">
<tr><td>CPU</td><td>Xtensaデュアルコア32ビットLX6</td></tr>
<tr><td>memory</td><td>520KiB SRAM<br>Bluetooth v4.2 BR/EDRとBLE</td></tr>
<tr><td>無線接続</td><td>Wi-Fi 802.11 b/g/n/e/i</td></tr>
<tr><td>SOC</td><td>ESP32-D0WDQ6</td></tr>
<tr><td>SMTモジュール基板</td><td>ESP-WROOM-32</td></tr>
<tr><td>開発ボード</td><td>ESP32-DevKitC </td></tr>
</table>
</div>
<div class="tab-pane" id="content3">
<hr>
<div class="btn-group" data-toggle="buttons">
<label class="btn btn-success active">
<input type="radio" name="mode" value="pk" autocomplete="off" checked> ピカチューこっちむいて
</label>
<label class="btn btn-info">
<input type="radio" name="mode" value="fs" autocomplete="off"> フシギダネこっちむいて
</label>
<label class="btn btn-danger">
<input type="radio" name="mode" value="fr" autocomplete="off"> 自由な時間を過ごします
</label>
</div>
<hr>
<h2>Current Your Target Angle is ..</h2>
<div class="angle" style="text-indent: 5em; "><font size = "7"><span id="servoPos"></span></font>deg</div>
</div>
<div class="tab-pane" id="content4">
<p>このサイトはアフィリエイトサイトではありません。</p>
</div>
</div>
</div>
<script>
var servoP = document.getElementById("servoPos");
$(function(){
$( 'input[name="mode"]:radio' ).change( function() {
var sel = $(this).val();
if(sel == "pk")
{
servoP.innerHTML = 180;
servo(180);
}
if(sel == "fs")
{
servoP.innerHTML = 0;
servo(0);
}
if(sel == "fr")
{
}
});
});
function freeControl(){
if("fr"==$('input:radio[name="mode"]:checked').val())
{
servoP.innerHTML = Math.round( Math.random()*180 );
servo(servoP.innerHTML);
}
}
setInterval(freeControl, 2000);
$.ajaxSetup({timeout:1000});
function servo(pos) {
$.get("/?value=" + pos + "&");
{Connection: close};
}
</script>
</body>
</html>
Also see: Tab Triggers