-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
218 lines (204 loc) · 7.17 KB
/
index.html
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
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Image Generator</title>
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/bulma/0.3.0/css/bulma.min.css">
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/font-awesome/4.6.3/css/font-awesome.min.css">
<style>
.generated {
position: relative;
}
.first {
position: absolute;
}
</style>
</head>
<body>
<div id="app">
<top></top>
<section class="section">
<div class="container">
<a href="https://hh.ru/search/vacancy?text=laravel&clusters=true&enable_snippets=true&salary=100000&only_with_salary=true&from=cluster_compensation"
target="_blank">Список
вакансий</a>
</div>
</section>
<section class="section">
<div class="container">
<form action="image.php" v-on:submit.prevent="onSubmit">
<div class="control has-addons">
<span class="select">
<select name="image" v-model="config.selected">
<option v-for="option in config.options" v-bind:value="option.value">
{{ option.text }}
</option>
</select>
</span>
<input class="input is-expanded" type="text" name="id" placeholder="HeadHunter Id"
v-model="config.id">
<a class="button is-primary" v-on:click="generate">
Get Info
</a>
</div>
<div class="control">
<label>Отступ сверху:</label>
<input class="input" type="text" v-model="config.start">
</div>
<div class="control">
<label>Отступ между словами:</label>
<input class="input" type="text" v-model="config.step">
</div>
<div class="control">
<label>Размер шрифта:</label>
<input class="input" type="text" v-model="config.size">
</div>
<div class="control">
<label>Строка №1:</label>
<input class="input" type="text" v-model="generated.texts.vacancy">
</div>
<div class="control">
<label>Строка №2:</label>
<input class="input" type="text" v-model="generated.texts.salary">
</div>
<div class="control">
<label>Строка №3:</label>
<input class="input" type="text" v-model="generated.texts.town">
</div>
<div class="control">
<label>Строка №4:</label>
<input class="input" type="text" v-model="generated.texts.exp">
</div>
<p class="control">
<a class="button is-primary" v-on:click="getImage">Submit</a>
</p>
</form>
</div>
</section>
<section class="section">
<div class="container">
<div class="columns">
<img :src="imageUrl">
</div>
</div>
</div>
</section>
</div>
<script src="https://unpkg.com/[email protected]/dist/vue.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/axios/0.15.3/axios.js"></script>
<script>
Vue.component('top', {
template: `<section class="hero is-primary">
<div class="hero-body">
<div class="container">
<h1 class="title">
Image Posts Generator for HeadHunter
</h1>
<h2 class="subtitle">
Work In Progress
</h2>
</div>
</div>
</section>`
});
let app = new Vue({
el: '#app',
data: {
imageUrl: '',
image: '',
template: '',
config: {
id: 19341594,
start: 250,
step: 50,
size: 40,
selected: 'larajobs1',
options: [
{text: "Larajobs #1", value: "larajobs1"},
{text: "Larajobs #2", value: "larajobs2"},
{text: "Larajobs #3", value: "larajobs3"},
{text: "Larajobs #4", value: "larajobs4"},
{text: "Larajobs #5", value: "larajobs5"}
]
},
styleObject: {
color: '#fff',
fontSize: '40px',
top: '250px',
position: 'absolute'
},
generated: {
texts: {
vacancy: '',
salary: '',
town: '',
exp: ''
}
}
},
methods: {
generate: function () {
axios.get('getTemplate.php', {
params: {
id: this.config.id
}
})
.then(response => {
this.generated = response.data;
})
.catch(function (error) {
console.log(error);
});
},
getImage: function () {
this.imageUrl = '';
let url = 'image.php?start=' + this.config.start +
'&step=' + this.config.step +
'&size=' + this.config.size +
'&image=' + this.config.selected +
'&vacancy=' + this.generated.texts.vacancy +
'&salary=' + this.generated.texts.salary +
'&town=' + this.generated.texts.town +
'&exp=' + this.generated.texts.exp;
console.log(url);
this.imageUrl = url;
}
}
});
</script>
<!-- Yandex.Metrika counter -->
<script type="text/javascript">
(function (d, w, c) {
(w[c] = w[c] || []).push(function () {
try {
w.yaCounter42100719 = new Ya.Metrika({
id: 42100719,
clickmap: true,
trackLinks: true,
accurateTrackBounce: true,
webvisor: true
});
} catch (e) {
}
});
var n = d.getElementsByTagName("script")[0],
s = d.createElement("script"),
f = function () {
n.parentNode.insertBefore(s, n);
};
s.type = "text/javascript";
s.async = true;
s.src = "https://mc.yandex.ru/metrika/watch.js";
if (w.opera == "[object Opera]") {
d.addEventListener("DOMContentLoaded", f, false);
} else {
f();
}
})(document, window, "yandex_metrika_callbacks");
</script>
<noscript>
<div><img src="https://mc.yandex.ru/watch/42100719" style="position:absolute; left:-9999px;" alt=""/></div>
</noscript>
<!-- /Yandex.Metrika counter -->
</body>
</html>