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.
<template>
<div id="app">
<div class="container">
<div class="left-section">
<h2>楊梅物流中心</h2>
<h4>訪客車輛資訊</h4>
<h4>-區域詳細資訊</h4>
<h4>訪客預約登記</h4>
<h4>訪客預約紀錄</h4>
<h4>-已預約未進場車輛</h4>
<h4>-未來時段預約紀錄</h4>
<h4>-訪客預約類別</h4>
<h4><a href="http://localhost:8080/">车辆進出紀錄</a></h4>
<h4>閘道控制選單</h4>
<h4>承租公司設定</h4>
<h4>貨運公司設定</h4>
<h4>車輛設定</h4>
<h4>使用者設定</h4>
<h4>使用者群組</h4>
<h4>使用者權限</h4>
<h4>使用紀錄</h4>
</div>
<div class="center-section">
<h2>車輛進出紀錄</h2>
<div class="box">
<table>
<thead>
<tr>
<th>
車牌號碼
<select v-model="車牌號碼">
<option value="車牌號碼">Ac-2345</option>
</select>
</th>
<th>
預約樓層
<select v-model="預約樓層">
<option value="預約樓層">3F</option>
</select>
</th>
<th>
拜訪公司
<select v-model="拜訪公司">
<option value="拜訪公司">B公司</option>
</select>
</th>
</tr>
<tr>
<th>
車輛類別
<select v-model="車輛類別">
<option value="車輛類別">契約車</option>
</select>
</th>
<th>
車輛類型
<select v-model="車輛類型">
<option value="車輛類型">貨車</option>
</select>
</th>
<th>
駕駛人公司
<select v-model="駕駛人公司">
<option value="駕駛人公司">C物流公司</option>
</select>
</th>
</tr>
</thead>
</table>
<div class="block-left">
<input type="checkbox" class="checkbox" />
<h4>進場起始時間</h4>
<datetime v-model="date" input-id="startDate">
<input type="datetime-local" v-model="value1" />
</datetime>
<input type="checkbox" class="checkbox" />
<h4>離場起始時間</h4>
<datetime v-model="date" input-id="startDate">
<input type="datetime-local" v-model="value2" />
</datetime>
</div>
<div class="block-right">
<h4>進場結束時間</h4>
<datetime v-model="date" input-id="startDate">
<input type="datetime-local" v-model="value3" />
</datetime>
<h4>離場結束時間</h4>
<datetime v-model="date" input-id="startDate">
<input type="datetime-local" v-model="value4" />
</datetime>
</div>
<div class="gwee">
<button @click="search">搜尋</button>
<button @click="cancel">取消</button>
</div>
<div class="east">
<button @click="printPage" class="image-button">
<img src="./assets/printer.jpg" alt="./assets/printer.jpg" />
</button>
<button @click="downloadPage" class="image-button">
<img src="./assets/icon.jpg" alt="./assets/icon.jpg" />
</button>
</div>
<table class="record">
<hr class="my-6" />
<div class="row">
<thead>
<tr>
<th>
<input type="checkbox" class="checkbox" />
</th>
<th>序</th>
<th>車牌號碼</th>
<th>車輛類別</th>
<th>車輛類型</th>
<th>駕駛人</th>
<th>駕駛人公司</th>
<th>預約樓層</th>
<th>拜訪公司</th>
<th>進場時間</th>
<th>離場時間</th>
<th>預約時間</th>
</tr>
</thead>
<tbody>
<tr v-for="record in records" :key="record.序">
<td><input type="checkbox" /></td>
<td>{{ record.序 }}</td>
<td>{{ record.車牌號碼 }}</td>
<td>{{ record.車輛類別 }}</td>
<td>{{ record.車輛類型 }}</td>
<td>{{ record.駕駛人 }}</td>
<td>{{ record.駕駛人公司 }}</td>
<td>{{ record.預約樓層 }}</td>
<td>{{ record.拜訪公司 }}</td>
<td>{{ record.進場時間 }}</td>
<td>{{ record.離場時間 }}</td>
<td>{{ record.預約時間 }}</td>
</tr>
</tbody>
</div>
</table>
</div>
</div>
<div class="right-section">
<h3>楊梅物流中心</h3>
<h4>車輛進出紀錄</h4>
<img src="./assets/Group2.png" width="50" height="50" />
<div class="adef">
<h5>駕駛公司:A物流公司</h5>
<h5>駕駛人:王先生</h5>
<h5>車牌號碼:Ac-2345</h5>
<h5>車種:貨車</h5>
<h5>進場時間:2023/06/23 12:00</h5>
</div>
<div class="adef">
<img src="./assets/Group2.png" width="50" height="50" />
<h5>駕駛公司:A物流公司</h5>
<h5>駕駛人:王先生</h5>
<h5>車牌號碼:Ac-2345</h5>
<h5>車種:貨車</h5>
<h5>進場時間:2023/06/23 12:00</h5>
</div>
</div>
</div>
<router-link to="/"></router-link>
<router-link to="/page2"></router-link>
<a href="/">page1</a> |
<a href="/page2">page2</a>
<router-view></router-view>
</div>
</template>
<style>
#app {
font-family: "Avenir", Arial, Helvetica, sans-serif;
-webkit-font-smoothing: antialiased;
-moz-font-smoothing: grayscale;
text-align: center;
margin-bottom: 60px;
}
* {
margin: 0;
padding: 0;
box-sizing: border-box;
}
body {
margin: 0;
padding: 0;
}
.container {
display: flex;
}
.app {
padding: 20px;
border: 1px solid transparent;
border-radius: 5px;
background-color: rgb(202, 202, 202);
}
.left-section {
background-color: rgb(202, 202, 202);
width: 20%;
}
.center-section {
background-color: #ffffff;
flex-grow: 1;
padding: 20px;
}
.right-section {
background-color: #e0e0e0;
width: 20%;
}
.left-section h2 {
border-bottom: 1px solid black;
padding-bottom: 5px;
}
.left-section h4 {
border: none;
background-color: transparent;
padding: 0;
cursor: pointer;
font-size: inherit;
color: inherit;
width: auto;
text-decoration: underline;
}
.right-section h4 {
border-bottom: 1px solid black;
padding-bottom: 5px;
}
.right-section img {
float: left;
}
.adef {
border-bottom: 1px solid black;
padding-bottom: 5px;
width: auto;
font-size: 12px;
}
.right-section {
float: right;
}
.box {
padding: 20px;
border: 1px solid transparent;
border-radius: 5px;
background-color: rgb(202, 202, 202);
}
.center-section table {
width: 100%;
border-collapse: collapse;
}
.center-section table tr,
th {
padding: 10px;
text-align: center;
}
.block-left {
text-align: left;
display: inline-flex;
}
.block-right {
text-align: right;
display: inline-flex;
}
.east {
text-align: right;
border-bottom: 1px solid black;
padding-bottom: 5px;
}
.gwee {
display: flex;
align-items: center;
justify-content: center;
}
.record {
width: 100%;
margin-bottom: 20px;
overflow-y: auto;
max-height: 400px;
border-collapse: collapse;
}
.record th,
.record td {
border: 1px solid #ddd;
text-align: center;
padding: 8px;
font-size: 10px;
}
th input[type="checkbox"] {
margin-right: 5px;
}
.record th {
background-color: #f2f2f2;
}
.checkbox {
text-align: center;
}
.image-button {
border: none;
background: none;
padding: 0;
}
.image-button img {
width: 25px;
height: 25px;
transition: transform 0.3s ease;
}
.image-button img:hover {
transform: scale(0.9);
}
</style>
export default {
name: "App",
name: "page1",
name: "page2",
data() {
return {
車牌號碼: "車牌號碼",
預約樓層: "預約樓層",
拜訪公司: "拜訪公司",
車輛類別: "車輛類別",
車輛類型: "車輛類型",
駕駛人公司: "駕駛人公司",
value1: "",
value2: "",
value3: "",
value4: "",
records: [],
};
},
methods: {
search() {
this.records = [
{
序: 1,
車牌號碼: "Ac-2345",
車輛類別: "契約車",
車輛類型: "貨車",
駕駛人: "王先生",
駕駛人公司: "C物流公司",
預約樓層: "3F",
拜訪公司: "B公司",
進場時間: "2024-03-07 10:00",
離場時間: "2024-03-07 20:00",
預約時間: "2024-03-07 13:00",
},
];
},
cancel() {
this.records = null;
},
printPage() {
window.print();
},
downloadPage() {
window.open(this.downloadPage);
},
},
};
Also see: Tab Triggers