File tree 1 file changed +9
-3
lines changed
1 file changed +9
-3
lines changed Original file line number Diff line number Diff line change @@ -4,6 +4,7 @@ let userInfo = document.querySelector('.user-info .card');
4
4
let reposInfoDiv = document . querySelector ( '.reposInfo' )
5
5
let theme = document . querySelector ( '.dark' ) ;
6
6
let body = document . querySelector ( 'body' ) ;
7
+ let card = document . createElement ( 'card' ) ;
7
8
// let card = document.querySelector('.');
8
9
9
10
@@ -48,8 +49,13 @@ async function showReposInfo(userName) {
48
49
const projects = await res . json ( ) ;
49
50
50
51
console . log ( projects ) ;
52
+
53
+ reposInfoDiv . append ( card ) ;
54
+
55
+ // card.setAttribute('class','card');
56
+ card . classList . add ( 'card' ) ;
51
57
for ( let i = 0 ; i < projects . length ; i ++ ) {
52
- reposInfoDiv . innerHTML += `<div class="card">
58
+ card . innerHTML += `
53
59
<div class="card-body">
54
60
<div class="card-title">${ projects [ i ] . name } </div>
55
61
<div class="card-subHeading">${ projects [ i ] . language } </div>
@@ -61,14 +67,14 @@ async function showReposInfo(userName) {
61
67
</button>
62
68
</div>
63
69
</div>
64
- </div> `
70
+ `
65
71
}
66
72
}
67
73
68
74
69
75
theme . addEventListener ( 'click' , ( ) => {
70
76
userInfo . classList . toggle ( 'hide' ) ;
71
- // reposInfoDiv .classList.toggle('show ');
77
+ card . classList . toggle ( 'hide ' ) ;
72
78
// body.style.background='#fff';
73
79
// card.style.background='#fff';
74
80
} )
You can’t perform that action at this time.
0 commit comments