@@ -19,7 +19,7 @@ window.customStart = () => {
1919 parentStyle . display = 'flex' ;
2020 parentStyle . justifyContent = 'center' ;
2121 parentStyle . alignItems = 'center' ;
22- parentStyle . height = '100%' ;
22+ parentStyle . maxHeight = '100%' ;
2323 recentPadList . remove ( ) ;
2424 } else {
2525 /**
@@ -30,15 +30,79 @@ window.customStart = () => {
3030 /**
3131 * @param {Pad } pad
3232 */
33+
34+ const arrowIcon = '<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-arrow-right w-4 h-4 text-gray-400"><path d="M5 12h14"></path><path d="m12 5 7 7-7 7"></path></svg>' ;
35+ const clockIcon = '<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-clock w-3 h-3"><circle cx="12" cy="12" r="10"></circle><polyline points="12 6 12 12 16 14"></polyline></svg>' ;
36+ const personalIcon = '<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-users w-3 h-3"><path d="M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2"></path><circle cx="9" cy="7" r="4"></circle><path d="M22 21v-2a4 4 0 0 0-3-3.87"></path><path d="M16 3.13a4 4 0 0 1 0 7.75"></path></svg>' ;
3337 recentPadListData . forEach ( ( pad ) => {
3438 const li = document . createElement ( 'li' ) ;
39+
40+
41+ li . style . cursor = 'pointer' ;
42+
3543 li . className = 'recent-pad' ;
3644 const padPath = `${ window . location . href } p/${ pad . name } ` ;
3745 const link = document . createElement ( 'a' ) ;
46+ link . style . textDecoration = 'none' ;
47+
3848 link . href = padPath ;
39- link . innerText = pad ;
49+ link . innerText = pad . name ;
4050 li . appendChild ( link ) ;
41- //https://v0.dev/chat/etherpad-design-clone-qZnwOrVRXxH
51+
52+
53+ const arrowIconElement = document . createElement ( 'span' ) ;
54+ arrowIconElement . className = 'recent-pad-arrow' ;
55+ arrowIconElement . innerHTML = arrowIcon ;
56+ li . appendChild ( arrowIconElement ) ;
57+
58+ const nextRow = document . createElement ( 'div' ) ;
59+
60+ nextRow . style . display = 'flex' ;
61+ nextRow . style . gap = '10px' ;
62+ nextRow . style . marginTop = '10px' ;
63+
64+ const clockIconElement = document . createElement ( 'span' ) ;
65+ clockIconElement . className = 'recent-pad-clock' ;
66+ clockIconElement . innerHTML = clockIcon ;
67+
68+ nextRow . appendChild ( clockIconElement ) ;
69+
70+ const time = new Date ( pad . timestamp ) ;
71+ const userLocale = navigator . language || 'en-US' ;
72+
73+ const formattedTime = time . toLocaleDateString ( userLocale , {
74+ year : 'numeric' ,
75+ month : '2-digit' ,
76+ day : '2-digit' ,
77+ hour : '2-digit' ,
78+ minute : '2-digit' ,
79+ } ) ;
80+ const timeElement = document . createElement ( 'span' ) ;
81+ timeElement . className = 'recent-pad-time' ;
82+ timeElement . innerText = formattedTime ;
83+
84+ nextRow . appendChild ( timeElement ) ;
85+
86+ const personalIconElement = document . createElement ( 'span' ) ;
87+ personalIconElement . className = 'recent-pad-personal' ;
88+ personalIconElement . innerHTML = personalIcon ;
89+
90+ personalIconElement . style . marginLeft = '5px' ;
91+
92+ const members = document . createElement ( 'span' ) ;
93+ members . className = 'recent-pad-members' ;
94+ members . innerText = pad . members ;
95+
96+
97+ nextRow . appendChild ( personalIconElement ) ;
98+ nextRow . appendChild ( members ) ;
99+ li . appendChild ( nextRow ) ;
100+
101+ li . addEventListener ( 'click' , ( ) => {
102+ window . location . href = padPath ;
103+ } ) ;
104+
105+ // https://v0.dev/chat/etherpad-design-clone-qZnwOrVRXxH
42106 recentPadList . appendChild ( li ) ;
43107 } ) ;
44108 }
0 commit comments