mirror of
https://github.com/leoherzog/TorrentParts.git
synced 2026-01-23 19:58:03 -08:00
Beginning Stages of Design Implementation
This commit is contained in:
28
bundle.js
28
bundle.js
@@ -33317,11 +33317,11 @@ function display() {
|
||||
|
||||
resetProperties();
|
||||
|
||||
hash.value = parsed.infoHash;
|
||||
name.value = parsed.name || "";
|
||||
if (parsed.created) created.value = parsed.created.toISOString().slice(0, 19);
|
||||
createdBy.value = parsed.createdBy || "";
|
||||
comment.value = parsed.comment || "";
|
||||
hash.value = parsed.infoHash;
|
||||
|
||||
announce.innerHTML = "";
|
||||
if (parsed.announce && parsed.announce.length) {
|
||||
@@ -33391,7 +33391,7 @@ function display() {
|
||||
copyURL.setAttribute('data-clipboard-text', window.location.origin + "#" + parser.toMagnetURI(parsed));
|
||||
copyMagnet.setAttribute('data-clipboard-text', parser.toMagnetURI(parsed));
|
||||
|
||||
properties.style.display = 'block';
|
||||
properties.style.display = 'flex';
|
||||
|
||||
window.location.hash = parser.toMagnetURI(parsed);
|
||||
|
||||
@@ -33420,24 +33420,36 @@ function createFileRow(icon, name, size) {
|
||||
function getFontAwesomeIconForMimetype(mimetype) {
|
||||
if (!mimetype) return 'file';
|
||||
switch (true) {
|
||||
case mimetype.includes("msword"):
|
||||
case mimetype.includes("wordprocessingml"):
|
||||
case mimetype.includes("opendocument.text"):
|
||||
case mimetype.includes("abiword"):
|
||||
return 'file-word';
|
||||
case mimetype.includes("ms-excel"):
|
||||
case mimetype.includes("spreadsheet"):
|
||||
return 'file-powerpoint';
|
||||
case mimetype.includes("powerpoint"):
|
||||
case mimetype.includes("presentation"):
|
||||
return 'file-powerpoint';
|
||||
case mimetype.includes("7z-"):
|
||||
case mimetype.includes("iso9660"):
|
||||
case mimetype.includes("zip"):
|
||||
case mimetype.includes("octet-stream"):
|
||||
return 'file-archive';
|
||||
case mimetype.includes("audio"):
|
||||
return 'file-audio';
|
||||
case mimetype.includes("csv"):
|
||||
return 'file-csv';
|
||||
case mimetype.includes("font"):
|
||||
return 'file-contract';
|
||||
case mimetype.includes("image"):
|
||||
return 'file-image';
|
||||
case mimetype.includes("pdf"):
|
||||
return 'file-pdf';
|
||||
case mimetype.includes("font"):
|
||||
return 'file-contract';
|
||||
case mimetype.includes("text"):
|
||||
case mimetype.includes("subrip"):
|
||||
case mimetype.includes("vtt"):
|
||||
return 'file-alt';
|
||||
case mimetype.includes("audio"):
|
||||
return 'file-audio';
|
||||
case mimetype.includes("image"):
|
||||
return 'file-image';
|
||||
case mimetype.includes("video"):
|
||||
return 'file-video';
|
||||
default:
|
||||
|
||||
2
bundle.min.js
vendored
2
bundle.min.js
vendored
File diff suppressed because one or more lines are too long
53
index.html
53
index.html
@@ -2,49 +2,56 @@
|
||||
|
||||
<head>
|
||||
<title>Torrent Parts | Inspect and edit what's in your Torrent file or Magnet link</title>
|
||||
<link rel="stylesheet" href="style.css" />
|
||||
<link href="https://fonts.googleapis.com/css2?family=Alata&display=swap" rel="stylesheet">
|
||||
<script async src="https://kit.fontawesome.com/9ca49f101f.js"></script>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
|
||||
<h1><span class="fad fa-file-search"></span> Torrent Parts</h1>
|
||||
<header>
|
||||
<h1 id="logo">Torrent<span class="fad fa-magnet fa-fw"></span>Parts</h1>
|
||||
<iframe src="https://ghbtns.com/github-btn.html?user=leoherzog&repo=TorrentParts&type=star&count=true" frameborder="0" scrolling="0" width="150" height="20" title="GitHub"></iframe>
|
||||
</header>
|
||||
|
||||
<div class="form-group">
|
||||
<label for="magnet">URL</label>
|
||||
<input id="magnet" type="text" placeholder="magnet:?xt=urn:btih…" />
|
||||
<div>or</div>
|
||||
<label for="torrent">Upload Torrent</label>
|
||||
<div id="startButtons">
|
||||
<input id="magnet" type="text" placeholder="Enter Magnet URL" />
|
||||
<input id="torrent" type="file" />
|
||||
<label for="torrent">
|
||||
<span class="fas fa-cloud-upload"></span> Upload Torrent
|
||||
</label>
|
||||
|
||||
</div>
|
||||
|
||||
<div id="properties" style="display:none">
|
||||
|
||||
<div class="form-group">
|
||||
<label for="name"><span id="originalSourceIcon"></span>Torrent Name</label>
|
||||
<input id="name" type="text" placeholder="Unspecified" />
|
||||
<button id="reset">
|
||||
<span class="fas fa-minus-circle"></span> Reset
|
||||
</button>
|
||||
<button id="reset">
|
||||
<span class="fas fa-minus-circle"></span> Reset
|
||||
</button>
|
||||
|
||||
<div class="property">
|
||||
<label for="hash">Unique Hash</label>
|
||||
<input id="hash" type="text" placeholder="" disabled/>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<div class="property">
|
||||
<label for="name"><span id="originalSourceIcon"></span>Torrent Name</label>
|
||||
<input id="name" type="text" placeholder="Unspecified" />
|
||||
</div>
|
||||
|
||||
<div class="property">
|
||||
<label for="created">Created</label>
|
||||
<input id="created" type="datetime-local" disabled />
|
||||
<label for="createdBy">UTC with</label>
|
||||
<input id="createdBy" type="text" placeholder="Unspecified" disabled />
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<div class="property">
|
||||
<label for="comment">Comment</label>
|
||||
<input id="comment" type="text" placeholder="Unspecified" />
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label for="hash">Unique Hash</label>
|
||||
<input id="hash" type="text" placeholder="" disabled/>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<div class="property">
|
||||
<label for="announce">Tracker URLs</label>
|
||||
<button id="addTrackers">
|
||||
<span class="fa-stack fa-2x">
|
||||
@@ -61,7 +68,7 @@
|
||||
<div id="announce"></div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<div class="property">
|
||||
<label for="urlList">Webseed URLs</label>
|
||||
<button id="addWebseed" data-type="urlList">
|
||||
<span class="fas fa-plus"></span>
|
||||
@@ -72,7 +79,7 @@
|
||||
<div id="urlList"></div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<div class="property">
|
||||
<label for="files">Files</label>
|
||||
<button id="getFiles">
|
||||
<span class="fad fa-chart-network"></span>
|
||||
@@ -106,7 +113,7 @@
|
||||
</div>
|
||||
|
||||
<script src="bundle.min.js"></script>
|
||||
<script async src="https://www.googletagmanager.com/gtag/js?id=UA-172544485-1"></script>
|
||||
<script async defer src="https://www.googletagmanager.com/gtag/js?id=UA-172544485-1"></script>
|
||||
<script>
|
||||
window.dataLayer = window.dataLayer || [];
|
||||
function gtag(){dataLayer.push(arguments);}
|
||||
|
||||
28
parse.js
28
parse.js
@@ -130,11 +130,11 @@ function display() {
|
||||
|
||||
resetProperties();
|
||||
|
||||
hash.value = parsed.infoHash;
|
||||
name.value = parsed.name || "";
|
||||
if (parsed.created) created.value = parsed.created.toISOString().slice(0, 19);
|
||||
createdBy.value = parsed.createdBy || "";
|
||||
comment.value = parsed.comment || "";
|
||||
hash.value = parsed.infoHash;
|
||||
|
||||
announce.innerHTML = "";
|
||||
if (parsed.announce && parsed.announce.length) {
|
||||
@@ -204,7 +204,7 @@ function display() {
|
||||
copyURL.setAttribute('data-clipboard-text', window.location.origin + "#" + parser.toMagnetURI(parsed));
|
||||
copyMagnet.setAttribute('data-clipboard-text', parser.toMagnetURI(parsed));
|
||||
|
||||
properties.style.display = 'block';
|
||||
properties.style.display = 'flex';
|
||||
|
||||
window.location.hash = parser.toMagnetURI(parsed);
|
||||
|
||||
@@ -233,24 +233,36 @@ function createFileRow(icon, name, size) {
|
||||
function getFontAwesomeIconForMimetype(mimetype) {
|
||||
if (!mimetype) return 'file';
|
||||
switch (true) {
|
||||
case mimetype.includes("msword"):
|
||||
case mimetype.includes("wordprocessingml"):
|
||||
case mimetype.includes("opendocument.text"):
|
||||
case mimetype.includes("abiword"):
|
||||
return 'file-word';
|
||||
case mimetype.includes("ms-excel"):
|
||||
case mimetype.includes("spreadsheet"):
|
||||
return 'file-powerpoint';
|
||||
case mimetype.includes("powerpoint"):
|
||||
case mimetype.includes("presentation"):
|
||||
return 'file-powerpoint';
|
||||
case mimetype.includes("7z-"):
|
||||
case mimetype.includes("iso9660"):
|
||||
case mimetype.includes("zip"):
|
||||
case mimetype.includes("octet-stream"):
|
||||
return 'file-archive';
|
||||
case mimetype.includes("audio"):
|
||||
return 'file-audio';
|
||||
case mimetype.includes("csv"):
|
||||
return 'file-csv';
|
||||
case mimetype.includes("font"):
|
||||
return 'file-contract';
|
||||
case mimetype.includes("image"):
|
||||
return 'file-image';
|
||||
case mimetype.includes("pdf"):
|
||||
return 'file-pdf';
|
||||
case mimetype.includes("font"):
|
||||
return 'file-contract';
|
||||
case mimetype.includes("text"):
|
||||
case mimetype.includes("subrip"):
|
||||
case mimetype.includes("vtt"):
|
||||
return 'file-alt';
|
||||
case mimetype.includes("audio"):
|
||||
return 'file-audio';
|
||||
case mimetype.includes("image"):
|
||||
return 'file-image';
|
||||
case mimetype.includes("video"):
|
||||
return 'file-video';
|
||||
default:
|
||||
|
||||
126
style.css
Normal file
126
style.css
Normal file
@@ -0,0 +1,126 @@
|
||||
/*! normalize.css v8.0.1 | MIT License | github.com/necolas/normalize.css */
|
||||
html{line-height:1.15;-webkit-text-size-adjust:100%}body{margin:0}main{display:block}h1{font-size:2em;margin:.67em 0}hr{box-sizing:content-box;height:0;overflow:visible}pre{font-family:monospace,monospace;font-size:1em}a{background-color:transparent}abbr[title]{border-bottom:none;text-decoration:underline;text-decoration:underline dotted}b,strong{font-weight:bolder}code,kbd,samp{font-family:monospace,monospace;font-size:1em}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sub{bottom:-.25em}sup{top:-.5em}img{border-style:none}button,input,optgroup,select,textarea{font-family:inherit;font-size:100%;line-height:1.15;margin:0}button,input{overflow:visible}button,select{text-transform:none}[type=button],[type=reset],[type=submit],button{-webkit-appearance:button}[type=button]::-moz-focus-inner,[type=reset]::-moz-focus-inner,[type=submit]::-moz-focus-inner,button::-moz-focus-inner{border-style:none;padding:0}[type=button]:-moz-focusring,[type=reset]:-moz-focusring,[type=submit]:-moz-focusring,button:-moz-focusring{outline:1px dotted ButtonText}fieldset{padding:.35em .75em .625em}legend{box-sizing:border-box;color:inherit;display:table;max-width:100%;padding:0;white-space:normal}progress{vertical-align:baseline}textarea{overflow:auto}[type=checkbox],[type=radio]{box-sizing:border-box;padding:0}[type=number]::-webkit-inner-spin-button,[type=number]::-webkit-outer-spin-button{height:auto}[type=search]{-webkit-appearance:textfield;outline-offset:-2px}[type=search]::-webkit-search-decoration{-webkit-appearance:none}::-webkit-file-upload-button{-webkit-appearance:button;font:inherit}details{display:block}summary{display:list-item}template{display:none}[hidden]{display:none}
|
||||
|
||||
:root {
|
||||
--gradient: linear-gradient(180deg, #152332, #24384D);
|
||||
--dark-blue: #102030;
|
||||
--light-blue: #495563;
|
||||
--accent: #63A079;
|
||||
--grey: #BDBDBD;
|
||||
--white: #FFF;
|
||||
}
|
||||
|
||||
body {
|
||||
color: var(--white);
|
||||
background: var(--gradient);
|
||||
font-family: 'Alata', sans-serif;
|
||||
}
|
||||
|
||||
input {
|
||||
color: var(--white);
|
||||
background: var(--dark-blue);
|
||||
border: 1px solid var(--light-blue);
|
||||
padding: 8px;
|
||||
box-sizing: border-box;
|
||||
border-radius: 900px;
|
||||
text-overflow: ellipsis;
|
||||
}
|
||||
|
||||
input:focus {
|
||||
background: var(--light-blue);
|
||||
border: 1px solid var(--grey);
|
||||
transition: ease .2s;
|
||||
outline: none;
|
||||
}
|
||||
|
||||
input:disabled {
|
||||
color: var(--grey);
|
||||
background: transparent;
|
||||
border: 0;
|
||||
}
|
||||
|
||||
::placeholder {
|
||||
color: var(--grey);
|
||||
}
|
||||
|
||||
button {
|
||||
color: var(--white);
|
||||
background: var(--accent);
|
||||
border: 0;
|
||||
padding: 8px;
|
||||
box-sizing: border-box;
|
||||
border-radius: 900px;
|
||||
text-align: center;
|
||||
margin: auto;
|
||||
}
|
||||
|
||||
button:disabled {
|
||||
filter: brightness(0.6);
|
||||
}
|
||||
|
||||
header {
|
||||
width: 100%;
|
||||
height: 80px;
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
border-bottom: 1px solid var(--grey);
|
||||
}
|
||||
|
||||
#logo {
|
||||
margin: 0 24px;
|
||||
}
|
||||
|
||||
#startButtons {
|
||||
margin: 64px auto;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
}
|
||||
|
||||
#startButtons > * {
|
||||
width: 440px;
|
||||
}
|
||||
|
||||
#torrent {
|
||||
display: none;
|
||||
}
|
||||
|
||||
label[for="torrent"] {
|
||||
color: var(--white);
|
||||
background: var(--accent);
|
||||
border: 0;
|
||||
padding: 8px;
|
||||
box-sizing: border-box;
|
||||
border-radius: 900px;
|
||||
text-align: center;
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
#properties {
|
||||
background: var(--dark-blue);
|
||||
margin: 80px 160px;
|
||||
padding: 40px;
|
||||
border-radius: 30px;
|
||||
flex-direction: column;
|
||||
justify-content: space-evenly;
|
||||
|
||||
}
|
||||
|
||||
.property {
|
||||
width: 100%;
|
||||
margin: 20px 0px;
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
|
||||
}
|
||||
|
||||
.property > label {
|
||||
width: 40%;
|
||||
text-transform: uppercase;
|
||||
}
|
||||
|
||||
.property > input {
|
||||
width: 440px;
|
||||
}
|
||||
Reference in New Issue
Block a user