Skip to content

Commit 1f587b3

Browse files
committed
clean
1 parent 43d7f15 commit 1f587b3

File tree

6 files changed

+43
-19
lines changed

6 files changed

+43
-19
lines changed

blocks/card/CardAbstract.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -106,6 +106,11 @@ export default class cardAbstract {
106106
this._cm.mousemoveEventShadow();
107107
}
108108

109+
/**
110+
* runs doEvent on both CardTransformable and CardMouseShadowed
111+
* @todo that's a bad description. change
112+
* @param {event} event
113+
*/
109114
doEvent(event) {
110115
this._ct.doEvent(event);
111116
this._cm.doEvent(event);

blocks/card/card.css

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,8 +36,8 @@
3636
}
3737

3838
.card:hover {
39-
transition: transform 0.5s;
4039
transform: scale(var(--_hover-scale));
40+
transition: transform 0.5s;
4141
z-index: 100;
4242
}
4343

blocks/card/card.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,10 @@ window.addEventListener('load', () => {
1212
CP.mousemoveEvent();
1313
CM.mousemoveEvent();
1414
C.mousemoveEvent();
15-
15+
1616
window.addEventListener('mousemove', (e) => {
1717
CP.doEvent(e);
1818
CM.doEvent(e);
1919
C.doEvent(e);
20-
})
20+
});
2121
});

index.html

Lines changed: 1 addition & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -33,20 +33,6 @@ <h1 class="card__title card--main__title">
3333
<span class="card__title main-card__birth">
3434
01.01.1999
3535
</span>
36-
<script>
37-
function toMail(encrypted) {
38-
let decrypted = "";
39-
for(let i = 0; i < encrypted.length; i++) {
40-
if(encrypted.charCodeAt(i) > 122) {
41-
decrypted += String.fromCharCode(encrypted.charCodeAt(i+1) - 56561);
42-
i++;
43-
} else {
44-
decrypted += encrypted.charAt(i);
45-
}
46-
}
47-
window.open("mailto:" + decrypted, "_self");
48-
}
49-
</script>
5036
<div class="card--main__social-links">
5137
<a href="https://github.com/goldst" class="card--main__social-link card--main__social-link--github main-card__button main-card__button--github button button--s">
5238
GitHub
@@ -218,5 +204,6 @@ <h3 class="card__title project-card__title">
218204
</ul>
219205
</footer>
220206
<script src="blocks/index.js" type="module"></script>
207+
<script src="js/safety/safety.js"></script>
221208
</body>
222209
</html>

js/eventControl/EventController.js

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -214,10 +214,15 @@ export default class EventController {
214214
this.eventControlElements
215215
.filter(ece => ece.domElement.matches(additionalFilter))
216216
.forEach(ece => {
217+
/**
218+
* Function that will be run on events, when calling
219+
* doEvent or on events of eventType
220+
* @param {event} event
221+
*/
217222
const run = (event) => {
218223
this._modify(event, ece, modificationFunction);
219224
postFunction.call(this, event, ece);
220-
}
225+
};
221226

222227
if(eventType !== null) {
223228
document.addEventListener(eventType, run);
@@ -227,11 +232,18 @@ export default class EventController {
227232
});
228233
}
229234

235+
/**
236+
* runs modification functions and postfunctions for all
237+
* EventControlElements, if they have previously been passed via
238+
* listenToChangeCss
239+
* @param {event} event
240+
* @returns {void}
241+
*/
230242
doEvent(event) {
231243
this.eventControlElements
232244
.forEach(ece => {
233245
// only if doEvent was set by listenToChangeCss
234-
if(ece.doEvent !== undefined) {
246+
if(ece.doEvent !== undefined) {
235247
ece.doEvent(event);
236248
}
237249
});

js/safety/safety.js

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
/**
2+
* takes an encrypted mail address, written in lower-case mathematical
3+
* double struck letters (𝕒-𝕫) and "normal" characters (all characters
4+
* with character codes under 122), converts it to a real mail address
5+
* and opens the mailto link if possible
6+
* @param {string} encrypted
7+
* @returns {void}
8+
*/
9+
function toMail(encrypted) {
10+
let decrypted = "";
11+
for(let i = 0; i < encrypted.length; i++) {
12+
if(encrypted.charCodeAt(i) > 122) {
13+
decrypted += String.fromCharCode(encrypted.charCodeAt(i+1) - 56561);
14+
i++;
15+
} else {
16+
decrypted += encrypted.charAt(i);
17+
}
18+
}
19+
window.open("mailto:" + decrypted, "_self");
20+
}

0 commit comments

Comments
 (0)