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 esm.sh, which makes packages from npm not only available on a CDN, but prepares them for native JavaScript ESM 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.
<div id='calendar'></div>
$(document).ready(function () {
// Documentの読み込みが完了するまで待機し、カレンダーを初期化します。
$('#calendar').fullCalendar({
// ヘッダーのタイトルとボタン
header: {
// title, prev, next, prevYear, nextYear, today
left: 'prev,next today',
center: 'title',
right: 'month agendaWeek agendaDay'
},
// jQuery UI theme
theme: false,
// 最初の曜日
firstDay: 1, // 1:月曜日
// 土曜、日曜を表示
weekends: true,
// 週モード (fixed, liquid, variable)
weekMode: 'fixed',
// 週数を表示
weekNumbers: false,
// 高さ(px)
//height: 700,
// コンテンツの高さ(px)
//contentHeight: 600,
// カレンダーの縦横比(比率が大きくなると高さが縮む)
//aspectRatio: 1.35,
// ビュー表示イベント
viewDisplay: function(view) {
//alert('ビュー表示イベント ' + view.title);
},
// ウィンドウリサイズイベント
windowResize: function(view) {
//alert('ウィンドウリサイズイベント');
},
// 日付クリックイベント
dayClick: function () {
//alert('日付クリックイベント');
},
// 初期表示ビュー
defaultView: 'month',
// 終日スロットを表示
allDaySlot: true,
// 終日スロットのタイトル
allDayText: '終日',
// スロットの時間の書式
axisFormat: 'H(:mm)',
// スロットの分
slotMinutes: 15,
// 選択する時間間隔
snapMinutes: 15,
// TODO よくわからない
//defaultEventMinutes: 120,
// スクロール開始時間
firstHour: 9,
// 最小時間
minTime: 6,
// 最大時間
maxTime: 20,
// 表示する年
year: 2012,
// 表示する月
month: 12,
// 表示する日
day: 31,
// 時間の書式
timeFormat: 'H(:mm)',
// 列の書式
columnFormat: {
month: 'ddd', // 月
week: "d'('ddd')'", // 7(月)
day: "d'('ddd')'" // 7(月)
},
// タイトルの書式
titleFormat: {
month: 'yyyy年M月', // 2013年9月
week: "yyyy年M月d日{ ~ }{[yyyy年]}{[M月]d日}", // 2013年9月7日 ~ 13日
day: "yyyy年M月d日'('ddd')'" // 2013年9月7日(火)
},
// ボタン文字列
buttonText: {
prev: '‹', // <
next: '›', // >
prevYear: '«', // <<
nextYear: '»', // >>
today: '今日',
month: '月',
week: '週',
day: '日'
},
// 月名称
monthNames: ['1月', '2月', '3月', '4月', '5月', '6月', '7月', '8月', '9月', '10月', '11月', '12月'],
// 月略称
monthNamesShort: ['1月', '2月', '3月', '4月', '5月', '6月', '7月', '8月', '9月', '10月', '11月', '12月'],
// 曜日名称
dayNames: ['日曜日', '月曜日', '火曜日', '水曜日', '木曜日', '金曜日', '土曜日'],
// 曜日略称
dayNamesShort: ['日', '月', '火', '水', '木', '金', '土'],
// 選択可
selectable: true,
// 選択時にプレースホルダーを描画
selectHelper: true,
// 自動選択解除
unselectAuto: true,
// 自動選択解除対象外の要素
unselectCancel: '',
// イベントソース
eventSources: [
{
events: [
{
title: 'event1',
start: '2013-01-01'
},
{
title: 'event2',
start: '2013-01-02',
end: '2013-01-03'
},
{
title: 'event3',
start: '2013-01-05 12:30:00',
allDay: false // will make the time show
}
]
}
]
});
// 動的にオプションを変更する
//$('#calendar').fullCalendar('option', 'height', 700);
// カレンダーをレンダリング。表示切替時などに使用
//$('#calendar').fullCalendar('render');
// カレンダーを破棄(イベントハンドラや内部データも破棄する)
//$('#calendar').fullCalendar('destroy')
});
Also see: Tab Triggers