Skip to content

Commit a9540c4

Browse files
Refactoring. Renamed 'data' and 'methods' of current date and current time
- Renamed 'method': 'getCurrentDateFormat' to 'createCurrentDateFormat' - Renamed 'method': 'getCurrentTimeFormat' to 'createCurrentTimeFormat' - Renamed 'data': 'current' to 'currentDateTime' - Renamed image of background: 'bg-currentdate' to 'bg-current-date-time'
1 parent 757fe67 commit a9540c4

File tree

4 files changed

+18
-18
lines changed

4 files changed

+18
-18
lines changed

assets/css/styles.css

+4-4
Original file line numberDiff line numberDiff line change
@@ -280,10 +280,10 @@ https://github.com/animate-css/animate.css/blob/main/source/attention_seekers/sh
280280

281281

282282

283-
/*** CURRENT DATE ***/
283+
/*** CURRENT DATE TIME ***/
284284
/**************************/
285285

286-
.current-date {
286+
.current-date-time {
287287
padding: 1.5rem 2rem;
288288
display: flex;
289289
flex-direction: column;
@@ -296,7 +296,7 @@ https://github.com/animate-css/animate.css/blob/main/source/attention_seekers/sh
296296
color: var(--color-pokemon-3);
297297
}
298298

299-
.current-date:after {
299+
.current-date-time:after {
300300
width: 17rem;
301301
height: 8.5rem;
302302
content: '';
@@ -305,7 +305,7 @@ https://github.com/animate-css/animate.css/blob/main/source/attention_seekers/sh
305305
top: -0.1rem;
306306
right: -0.1rem;
307307
z-index: -1;
308-
background-image: url('../images/bg-currentdate.svg');
308+
background-image: url('../images/bg-current-date-time.svg');
309309
background-position: top right;
310310
background-size: contain;
311311
background-repeat: no-repeat;
File renamed without changes.

assets/js/main.js

+9-9
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ const app = new Vue({
3434
lose: false,
3535
},
3636
gameReset: false,
37-
current: {
37+
currentDateTime: {
3838
time: "00:00:00",
3939
date: "DD/MM/YYYY",
4040
},
@@ -84,16 +84,16 @@ const app = new Vue({
8484
this.resetGame();
8585
},
8686
},
87-
"current.date": {
87+
"currentDateTime.date": {
8888
immediate: true,
8989
handler() {
90-
this.getCurrentDateFormat();
90+
this.createCurrentDateFormat();
9191
},
9292
},
93-
"current.time": {
93+
"currentDateTime.time": {
9494
immediate: true,
9595
handler() {
96-
this.getCurrentTimeFormat();
96+
this.createCurrentTimeFormat();
9797
},
9898
},
9999
"counter.init": {
@@ -318,22 +318,22 @@ const app = new Vue({
318318
? 0 + number.toString()
319319
: number.toString();
320320
},
321-
getCurrentDateFormat() {
321+
createCurrentDateFormat() {
322322
setInterval(() => {
323323
const day = this.checkDigits(this.getCurrentDay());
324324
const month = this.checkDigits(this.getCurrentMonth());
325325
const year = this.checkDigits(this.getCurrentYear());
326326

327-
this.current.date = `${day}/${month}/${year}`;
327+
this.currentDateTime.date = `${day}/${month}/${year}`;
328328
}, 1000);
329329
},
330-
getCurrentTimeFormat() {
330+
createCurrentTimeFormat() {
331331
setInterval(() => {
332332
const hours = this.checkDigits(this.getCurrentHours());
333333
const minutes = this.checkDigits(this.getCurrentMinutes());
334334
const seconds = this.checkDigits(this.getCurrentSeconds());
335335

336-
this.current.time = `${hours}:${minutes}:${seconds}`;
336+
this.currentDateTime.time = `${hours}:${minutes}:${seconds}`;
337337
}, 1000);
338338
},
339339
setCounter() {

index.html

+5-5
Original file line numberDiff line numberDiff line change
@@ -18,12 +18,12 @@
1818
<body>
1919
<div id="app" v-cloak>
2020
<div class="page-content">
21-
<div class="current-date">
22-
<time :datetime="`${current.date}`">
23-
{{ current.date }}
21+
<div class="current-date-time">
22+
<time :datetime="`${currentDateTime.date}`">
23+
{{ currentDateTime.date }}
2424
</time>
25-
<time :datetime="`${current.time}`">
26-
{{ current.time }}
25+
<time :datetime="`${currentDateTime.time}`">
26+
{{ currentDateTime.time }}
2727
</time>
2828
</div>
2929

0 commit comments

Comments
 (0)