-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy paththesaurus.html
More file actions
136 lines (112 loc) · 3.66 KB
/
thesaurus.html
File metadata and controls
136 lines (112 loc) · 3.66 KB
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
133
134
135
136
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Thesaurus</title>
<script src="https://code.jquery.com/jquery-3.6.0.min.js"></script>
<link rel="preconnect" href="https://fonts.googleapis.com">
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
<link href="https://fonts.googleapis.com/css2?family=Lobster&display=swap" rel="stylesheet">
<script type="text/javascript">
$(document).ready(function() {
$('#searchForm').submit(function(event) {
console.log('Form submitted'); // Check if this message appears in the console
event.preventDefault();
var word = $('#searchWord').val();
var uid = '12902'; // Your user ID
var tokenid = 'wftVAapX8A2VkZ8E'; // Your API token
var apiUrl = 'https://www.stands4.com/services/v2/syno.php';
$.ajax({
url: apiUrl,
type: 'GET',
data: {
uid: uid,
tokenid: tokenid,
word: word,
format: 'xml'
},
success: function(data) {
console.log('API response:', data); // Check API response in console
var synonyms = $(data).find('synonyms').text();
$('#synonymsResult').html('<strong>Synonyms:</strong> ' + synonyms);
},
error: function(xhr, status, error) {
console.error('Error fetching synonyms:', error);
$('#synonymsResult').html('<div class="error">Error fetching synonyms. Please try again.</div>');
}
});
});
});
</script>
<style type="text/css">
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
img, video, canvas, svg { max-width: 100%; height: auto; }
@import url("https://fonts.googleapis.com/css2?family=IBM+Plex+Mono:ital,wght@0,400;0,700;1,400;1,700&display=swap");
@import url('https://fonts.googleapis.com/css2?family=Oswald:wght@200..700&display=swap');
h2 {
font-family: "Oswald", serif;
font-size: 1.5em;
line-height: 1.1em;
text-transform: uppercase;
letter-spacing: 0.05em;
margin-top: 0;
padding: 0.3125rem 0.625rem;
margin-bottom: 0.9375rem;
position: relative;
}
label {
font-family: "Oswald", serif;
font-size: 1.5em;
line-height: 1.1em;
text-transform: uppercase;
letter-spacing: 0.05em;
margin-top: 0;
padding: 0.3125rem 0.625rem;
margin-bottom: 0.9375rem;
position: relative;
font-weight:bold;
}
#searchWord {
width: 100%;
padding: 0.625rem;
font-size: 1rem;
border: 1px solid #ddd;
background-color: #f2f2f2;
}
input:focus {outline: none; /* Remove the default focus outline */
border-color: blue; /* Change the border color on focus */
box-shadow: 0 0 0.3125rem rgba(0, 0, 255, 0.5);}
button {
font-family: "Oswald", serif;
margin-top: 0.625rem;
width: 100%;
background: #007bff; /* Blue button */
color: #fff;
font-size: 1rem;
padding: 0.625rem;
border: none;
border-radius: 0.25rem;
cursor: pointer;
font-weight: bold;
touch-action: manipulation;
min-height: 2.75rem;
transition: background 0.3s ease;
float:left;
}
button:hover {
background: #0056b3; /* Darker blue on hover */
}
#synonymsResult {font-family: "Oswald", serif;}
</style>
</head>
<body>
<form id="searchForm">
<label for="searchWord"></label><h2>THESAURUS</h2>
<input type="text" id="searchWord" name="word"><br><br>
<button type="submit">SEARCH</button><br>
</form>
<div id="synonymsResult"></div>
</body>
</html>