-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.php
132 lines (108 loc) · 4.65 KB
/
index.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
<?php require('./assets/php/header.php'); ?>
<div class="pt-4 text-base leading-6 space-y-4 text-gray-300 sm:text-lg sm:leading-7">
<p>
XIV SealGil is a FFXIV tool to get market prices from
<a href="https://universalis.app" class="underline">universalis</a>
and tell you the grand company seal-purchasable item that
is being actively sold for the most gil.
</p>
<ul class="list-disc space-y-2">
<li class="flex items-start">
<span class="h-6 flex items-center sm:h-7">
<svg class="flex-shrink-0 h-5 w-5 text-yellow-500" viewBox="0 0 20 20" fill="currentColor">
<path fill-rule="evenodd" d="M10 18a8 8 0 100-16 8 8 0 000 16zm3.707-9.293a1 1 0 00-1.414-1.414L9 10.586 7.707 9.293a1 1 0 00-1.414 1.414l2 2a1 1 0 001.414 0l4-4z" clip-rule="evenodd" />
</svg>
</span>
<p class="ml-2">
Searchable selection of worlds to find yours in
</p>
</li>
<li class="flex items-start">
<span class="h-6 flex items-center sm:h-7">
<svg class="flex-shrink-0 h-5 w-5 text-yellow-500" viewBox="0 0 20 20" fill="currentColor">
<path fill-rule="evenodd" d="M10 18a8 8 0 100-16 8 8 0 000 16zm3.707-9.293a1 1 0 00-1.414-1.414L9 10.586 7.707 9.293a1 1 0 00-1.414 1.414l2 2a1 1 0 001.414 0l4-4z" clip-rule="evenodd" />
</svg>
</span>
<p class="ml-2">
Live market data to determine the highest-gil item that is actively getting sold
</p>
</li>
<li class="flex items-start">
<span class="h-6 flex items-center sm:h-7">
<svg class="flex-shrink-0 h-5 w-5 text-yellow-500" viewBox="0 0 20 20" fill="currentColor">
<path fill-rule="evenodd" d="M10 18a8 8 0 100-16 8 8 0 000 16zm3.707-9.293a1 1 0 00-1.414-1.414L9 10.586 7.707 9.293a1 1 0 00-1.414 1.414l2 2a1 1 0 001.414 0l4-4z" clip-rule="evenodd" />
</svg>
</span>
<p class="ml-2">
Sorts items by their sell-price versus seal-cost separated by whether they're selling, recommends what to spend seals on
</p>
</li>
</ul>
<p>
Perfect for making some spare gil when you have extra company seals.
</p>
<div class="pt-6 text-base leading-6 font-bold sm:text-lg sm:leading-7">
<hr class="border-gray-600"><br>
<b>Search for your world:</b><br>
<div class="flex mx-auto items-center justify-center">
<input type="text" id="worldSearch"
class="focus:ring-gray-600 ring ring-gray-600 bg-gray-500 flex-1 block h-12 rounded-lg text-sm px-6 mx-2 text-gray-300" placeholder="Goblin, Hades, etc.">
</div>
<div class="mx-auto place-items-center justify-center bg-gray-800 rounded-lg mt-5 border-4 border-gray-600 box-border hidden" id="searchResults"></div>
</div>
<p class="text-sm">
<i>This works better if you contribute to universalis</i>. If you use ACT,
<a href="https://universalis.app/contribute" class="underline">click here to start contributing</a>. (ACT plugin is the simplest, Quick Launcher has it built-in)
</p>
<script src="/assets/js/worldList.js"></script>
<script src="https://cdn.jsdelivr.net/npm/[email protected]"></script>
<script>
let x = 0;
//Load search results jQuery element
let searchResults = $("#searchResults");
//Search only world names and order by score
const options = {
keys: [
"world"
],
includeScore: true,
};
//Load the fuzzy searcher
const fuse = new Fuse(serverList, options);
//When someone types in the world search
$("#worldSearch").keyup(function(e) {
x = 0;
//Fuzzy search the list of worlds
let results = fuse.search($(this).val());
//Clear out search results
searchResults.empty();
//Hide search results with no value
if ($(this).val() == "") {
return searchResults.hide();
}
//If there are search results, render them
if (results.length > 0) {
searchResults.show();
for (let result of results) {
if (x > 1) continue;
searchResults.append("<div class='worldSearchResult flex mx-auto px-5 hover:bg-gray-700 py-2 px-5 cursor-pointer' data-world='" + result.item.world
+ "'><div class='w-1/3 text-gray-300'>" + result.item.world
+ "</div><div class='w-2/3 text-gray-400 text-right'>(" + result.item.group + ", " + result.item.region + ")</div></div>");
x++;
}
searchResults.append("<span class='text-xs block mx-auto text-right px-2'>(press enter to select the top server, or click one)</span>");
}
//Hide search results with no results
else {
return searchResults.hide();
}
//Select the first world if enter was hit
if (e.key === "Enter") {
$("#searchResults div").first().click();
}
});
$(document).on('click', '.worldSearchResult', function(){
document.location.href = 'https://xiv-sealgil.herokuapp.com/results?world=' + $(this).data("world");
});
</script>
<?php require('./assets/php/footer.php'); ?>