-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathCard.qml
279 lines (241 loc) · 8.41 KB
/
Card.qml
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
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
import QtQuick 2.10
import QtQml 2.2
import QtGraphicalEffects 1.0
//import QtQuick.Controls 1.3
/*!
\brief MainView with a Label and Button elements.
*/
import QtQuick.LocalStorage 2.0 as Sql
import "main.js" as Scripts
import "openseed.js" as OpenSeed
import "microblogger.js" as MicroBlogger
Item {
id: cards
anchors.horizontalCenter: parent.horizontalCenter
width: passerbyGrid.width * 0.96
height: if (cardsop == 1) {
passerbyGrid.width * 0.46
} else {
passerbyGrid.width * 0.46
}
clip: true
property string w1: "" + URL1
property string w2: "" + URL2
property string w3: "" + URL3
property string w4: "" + URL4
property string mainly: "" + mainsite
property string issaved: saved
property string cardStatus: ""
property int explodereset: 0
property int lister: 0
property int deletetime: 9999999
property int collecttime: 99999
Component.onCompleted: if (name == 'undefined') {
cardslist.remove(index)
} else {
MicroBlogger.latest_log_remote(usercardNum,
cardId)
}
Timer {
id: selfdestruct
interval: 800
running: true
repeat: false
onTriggered: {
if (listget == "temp") {
if (type == 0) {
if (cardsop != 2) {
if (Scripts.temp_Elapsed(cardId) === 1) {
deletelist.push(cardId)
cardslist.remove(index)
} else {
}
}
}
if (deletelist.length > 0) {
listdeleter.start()
}
}
}
}
Item {
x: 0
height: parent.height
width: parent.width
clip: true
Rectangle {
id: thecard
width: parent.width * 0.98
height: parent.height * 0.98
color: cardcolor
radius: 2
anchors.horizontalCenter: parent.horizontalCenter
anchors.verticalCenter: parent.verticalCenter
visible: false
clip: true
Item {
width: parent.width
height: parent.height * 0.90
clip: true
CirclePic {
id: card_avatar_backing
width: parent.height * 0.9
height: parent.height * 0.9
anchors.verticalCenter: parent.verticalCenter
anchors.left: parent.left
where: listget
whichPic: cardId
}
Text {
id: nametag
visible: if (cardsop == 1) {
true
} else {
false
}
text: "<div>" + name + "</div>"
wrapMode: Text.WordWrap
font.pixelSize: cards.width * 0.063
font.bold: true
anchors.left: card_avatar_backing.right
anchors.leftMargin: parent.width * 0.008
anchors.right: parent.right
anchors.rightMargin: parent.width * 0.008
anchors.top: parent.top
anchors.topMargin: parent.height * 0.07
color: fontColor
}
Rectangle {
visible: if (cardsop == 1) {
true
} else {
false
}
anchors.top: nametag.bottom
anchors.topMargin: parent.height * 0.04
anchors.left: card_avatar_backing.right
width: parent.width * 0.57
height: 3
color: "" + spColor
}
Text {
id: position
visible: if (cardsop == 1) {
true
} else {
false
}
text: qsTr("Job Title: ") + cardposition
font.pixelSize: parent.width / 24
anchors.left: card_avatar_backing.right
anchors.leftMargin: parent.width * 0.03
anchors.top: nametag.bottom
anchors.topMargin: parent.height * 0.06
wrapMode: Text.WordWrap
width: parent.width * 0.55
color: fontColor
}
Text {
id: comp
visible: if (cardsop == 1) {
true
} else {
false
}
width: parent.width * 0.70
anchors.right: parent.right
anchors.bottom: parent.bottom
anchors.rightMargin: parent.width * 0.02
anchors.bottomMargin: parent.height * 0.02
font.pixelSize: parent.width * 0.04
text: "" + company
wrapMode: Text.WordWrap
maximumLineCount: 1
elide: Text.ElideRight
horizontalAlignment: Text.AlignRight
color: fontColor
}
}
Rectangle {
anchors.left: parent.left
anchors.bottom: parent.bottom
width: parent.width
height: parent.height * 0.1
color: Qt.rgba(0.94, 0.94, 0.94, 0.1)
Text {
anchors.left: parent.left
anchors.leftMargin: parent.width * 0.02
anchors.verticalCenter: parent.verticalCenter
font.pixelSize: parent.height * 0.8
text: "<div>" + cardStatus + "</div>"
width: parent.width * 0.9
wrapMode: Text.WordWrap
maximumLineCount: 1
elide: Text.ElideRight
color: fontColor
}
}
}
DropShadow {
anchors.fill: thecard
horizontalOffset: 0
verticalOffset: 4
radius: 8.0
samples: 17
color: "#80000000"
source: thecard
}
MouseArea {
anchors.centerIn: parent
width: parent.width * 0.80
height: parent.height * 0.80
onPressed: shade.state === "Active"
onReleased: shade.state === "InActive"
}
}
MouseArea {
x: 0
y: 0
width: if (cards.side === 1) {
0
} else {
parent.width
}
height: if (cards.side === 1) {
0
} else {
parent.height
}
onClicked: {
currentcard = index
pagelist.clear()
gc()
mainScreen.fromRequest = false
mainScreen.state = "Active"
topBar.state = "person"
currentcard_thecard = cardId
currentcard_saved = issaved
currentcard_username = name
currentcard_userphone = phone
currentcard_useremail = email
currentcard_cardposition = cardposition
currentcard_companyname = company
currentcard_motto = motto
currentcard_mainsite = mainsite
currentcard_url1 = w1
currentcard_url2 = w2
currentcard_url3 = w3
currentcard_url4 = w4
currentcard_avatarimg = imgsource
currentcard_realcardback = cardback
currentcard_cardcat = cardcat
currentcard_cardsop = cardsop
if (issaved === 1) {
Scripts.show_Sites(cardId, "saved")
} else {
Scripts.show_Sites(cardId, listget)
}
mainScreen.positionViewAtBeginning()
}
}
}