Compare commits

...

9 Commits

Author SHA1 Message Date
b0977d5e9a Remove useless stuff 2024-11-12 21:57:29 +08:00
d9b31d03da Update funny websites 2022-07-19 03:33:08 +08:00
a1203de811 Change background image 2022-07-18 23:57:50 +08:00
e86aebdc5d 移除 ntut.com.tw 要過期的資訊 2021-10-17 19:44:45 +08:00
f1e5411469 修改一些好玩ㄉ網站的敘述 2021-09-26 04:23:40 +08:00
ba6ebd33b9 Add link to youtube together 2021-09-26 03:55:35 +08:00
8c5062471f Change ntut.com.tw to pinlin.me 2021-09-25 17:59:21 +08:00
b384eb00ac Support IE 2021-09-25 17:59:21 +08:00
9eae3e42e5 Use correct jQuery build 2021-09-25 17:51:52 +08:00
4 changed files with 20 additions and 112 deletions

View File

@ -2,29 +2,9 @@ body {
background: url(../image/background.jpg) fixed;
background-size: cover;
}
#urlBox {
padding: 10px 0 0 5px;
border: 1px solid rgba(0,0,0,.125);
border-radius: 5px;
}
#urlBox .url {
padding: 5px;
}
#urlBox .url input {
width: 100%;
font-size: 16px;
line-height: 32px;
color: #000;
border: none;
border-bottom: 1px solid rgba(0,0,0,.125);
}
#content {
background-color: white;
opacity: 0.87;
opacity: 0.75;
box-shadow: 0 0 2vmin black;
}

Binary file not shown.

Before

Width:  |  Height:  |  Size: 985 KiB

After

Width:  |  Height:  |  Size: 310 KiB

View File

@ -28,56 +28,39 @@
<hr>
<h2 class="text-center"><code>縮網址服務</code></h2>
<div id="urlBox" class="container">
<div class="urls"></div>
<div class="url row">
<p class="col-md-4 col-6">
<input class="text-center short-code" name="short-code" type="text" placeholder="別名,可留空">
</p>
<p class="col-md-8 col-6">
<input class="text-center target-url" name="target-url" type="text"
placeholder="網址例如https://www.ntut.edu.tw/">
</p>
<p class="col-12"></p>
<p class="col-md-4 col-sm-2"></p>
<p class="col-md-4 col-sm-8 col-12">
<a class="btn btn-primary" style="width: 100%;" href="javascript:" onclick="shortenUrl()">縮起來!</a>
</p>
<p class="col-md-4 col-sm-2"></p>
</div>
</div>
<div class="row">
<div class="websites col-lg-6">
<!--<div class="websites col-lg-6">
<h2 class="text-center"><code>好玩ㄉ網站</code></h2>
<ul class="list-group">
<li class="list-group-item list-group-item-action">
<a href="https://git.ntut.com.tw" target="_blank">Gitea of NTUT.COM.TW</a>
<a href="https://bus.pinlin.me" target="_blank">Bustw CLI</a>
<br>
<span>程式碼託管平台</span>
<span>用終端機輕鬆查公車</span>
</li>
<li class="list-group-item list-group-item-action">
<a href="https://yuren-tw.github.io/textRevealer/" target="_blank">Text Revealer</a>
<a href="https://ccm.pinlin.me" target="_blank">China Cipher Messenger</a>
<br>
<span>網頁大字報</span>
<span>瓷器信使 - 端對端加密通訊平台</span>
</li>
<li class="list-group-item list-group-item-action">
<a href="https://www.ntut.com.tw/chipet" target="_blank">Chi Pet</a>
<a href="https://yt.pinlin.me" target="_blank">YouTube Together</a>
<br>
<span>幫烏龜澆水</span>
<span>和朋友同步播放 YouTube 影片</span>
</li>
<li class="list-group-item list-group-item-action">
<a href="https://yuren-tw.github.io/textRevealer" target="_blank">textRevealer</a>
<br>
<span>網頁大字報 by @YuRen-tw</span>
</li>
</ul>
</div>
</div>-->
<div class="gist col-lg-6">
<h2 class="text-center"><code>好用 Script</code></h2>
<div class="gist col-lg-12">
<!--<h2 class="text-center"><code>好用 Script</code></h2>-->
<script src="https://gist.github.com/PinLin/3f6c1885d3c22d9fbf6a726788778112.js"></script>
</div>
<div class="video col-lg-12">
<!--<div class="video col-lg-12">
<div class="embed-responsive embed-responsive-16by9">
<video src="https://myweb.ntut.edu.tw/TaipeiTech.mp4" controls preload="none"
class="embed-responsive-item" type="video/mp4">
@ -86,7 +69,7 @@
&emsp;&emsp;國立臺北科技大學 Taipei Tech
創立於大正元年,為臺灣技職教育之濫觴,校史輝煌悠久。本校定位為「實務研究型大學」,設機電、電資、工程、管理、設計及人文與社會科學六學院。素有「企業家搖籃」之美名,校友遍佈產業各界,於產業界極有影響力,深厚的學術基礎、地利之便、多元課程、豐富資源與國際能見度,使本校發展成為以科技為強項的國際知名大學。
</p>
</div>
</div>-->
</div>
<hr>
@ -95,9 +78,8 @@
<p class="text-center">(ˊ・ω・ˋ)(ˊ・ω・ˋ)(ˊ・ω・ˋ)(ˊ・ω・ˋ)(ˊ・ω・ˋ)(ˊ・ω・ˋ)</p>
</footer>
</div>
<script src="https://code.jquery.com/jquery-3.5.1.slim.min.js"
integrity="sha384-DfXdz2htPH0lsSSs5nCTpuj/zy4C+OGpamoFVy38MVBnE+IbbVYUew+OrCXaRkfj"
crossorigin="anonymous"></script>
<script src="https://code.jquery.com/jquery-3.6.0.min.js"
integrity="sha256-/xUj+3OJU5yExlq6GSYGSHk7tPXikynS7ogEvDej/m4=" crossorigin="anonymous"></script>
<script src="https://cdn.jsdelivr.net/npm/bootstrap@4.6.0/dist/js/bootstrap.bundle.min.js"
integrity="sha384-Piv4xVNRyMGpqkS2by6br4gNJ7DXjqk09RmUpJ8jgGtD7zP9yug3goQfGII0yAns"
crossorigin="anonymous"></script>

View File

@ -1,54 +0,0 @@
'use strict'
let backend = 'https://ntut.com.tw'
const shortenUrl = async () => {
let shortCode = $('#urlBox .short-code')[0].value || null
let url = $('#urlBox .target-url')[0].value
if (!url) {
alert("URL is empty!")
return
}
request({ shortCode, url })
.done((res) => {
console.log(res)
addNewRow(res)
})
.fail((err) => {
console.log(err)
if (err.status == 409) {
alert("This code has been used.")
}
else {
alert("Failed to establish connection.")
}
})
}
const addNewRow = (data) => {
let view = $('#urlBox .urls')
view.append($(`
<div class="url row">
<p class="text-center col-md-4 col-6">ntut.com.tw/${data.shortCode}</p>
<p class="text-center col-md-8 col-6">${data.url}</p>
</div>
`))
}
const request = ({ shortCode, url }) => {
return $.ajax({
type: 'POST',
dataType: 'json',
url: `${backend}/api/shortUrl`,
data: JSON.stringify({
shortCode, url
}),
processData: false,
contentType: 'application/json; charset=UTF-8'
})
}