File tree 10 files changed +67
-9
lines changed
10 files changed +67
-9
lines changed Original file line number Diff line number Diff line change 21
21
"sirv-cli" : " ^1.0.12" ,
22
22
"svelte" : " ^3.0.0" ,
23
23
"svelte-bootstrap-icons" : " 1.5.0" ,
24
+ "svelte-emoji" : " ^1.0.2" ,
24
25
"svelte-file-dropzone" : " ^0.0.15" ,
25
26
"svelte-loader" : " ^3.1.2" ,
26
27
"util" : " ^0.12.4" ,
Original file line number Diff line number Diff line change 1
1
<script >
2
+ import GoToMainContent from ' ./components/GoToMainContent.svelte'
2
3
import Navbar from ' ./components/Navbar.svelte'
3
4
import Header from ' ./components/Header.svelte'
4
5
import Footer from ' ./components/Footer.svelte'
7
8
import Textarea from ' ./components/Textarea.svelte'
8
9
</script >
9
10
11
+ <GoToMainContent />
10
12
<Navbar />
11
13
<Header />
12
- <main class =" d-flex flex-column justify-content-center align-items-center px-2 px-sm-5" >
14
+ <main id = " mainContent " class =" d-flex flex-column justify-content-center align-items-center px-2 px-sm-5" >
13
15
<Settings />
14
16
<Textarea />
15
17
<FileDropzone />
Original file line number Diff line number Diff line change 8
8
export let onSave
9
9
10
10
const VALIDATION_ANIMATION_DURATION = 700
11
+ const DOWNLOAD_MINIFIED_CSS = ' Download minified css'
12
+ const COPY_MINIFIED_CSS = ' Copy minified css to clipboard'
13
+
11
14
let isSavedToClipboard = false
12
15
let isSaved = false
13
16
31
34
</script >
32
35
33
36
<div class ={` d-flex ${className } copy-save-actions ` }>
34
- <button class ="btn btn-link p-1" on:click ={saveToClipboard }>
37
+ <button
38
+ class =" btn btn-link p-1"
39
+ title ={COPY_MINIFIED_CSS }
40
+ aria-label ={COPY_MINIFIED_CSS }
41
+ on:click ={saveToClipboard }
42
+ >
35
43
<Icon name ={isSavedToClipboard ? ' check' : ' clipboard' }/>
36
44
</button >
37
- <button class ="btn btn-link p-1 ms-1" on:click ={save }>
45
+ <button
46
+ class =" btn btn-link p-1 ms-1"
47
+ title ={DOWNLOAD_MINIFIED_CSS }
48
+ aria-label ={DOWNLOAD_MINIFIED_CSS }
49
+ on:click ={save }
50
+ >
38
51
<Icon name ={isSaved ? ' check' : ' download' }/>
39
52
</button >
40
53
</div >
Original file line number Diff line number Diff line change
1
+ <script >
2
+ import Emoji from ' svelte-emoji'
3
+ </script >
4
+
1
5
<footer class =" text-center mt-5 mb-2" >
2
- Hosted with <span >β€οΈ </ span > on <a href =" //pages.github.com/" >GitHub Pages</a >.
6
+ Hosted with <Emoji symbol = " β€οΈ " label = " love " / > on <a href =" //pages.github.com/" >GitHub Pages</a >.
3
7
</footer >
4
8
5
9
<style >
Original file line number Diff line number Diff line change
1
+ <a
2
+ href =" #mainContent"
3
+ class =" position-absolute top-0 start-0 btn btn-outline-secondary bg-light text-primary m-2 visually-hidden-focusable"
4
+ >
5
+ Go to main content
6
+ </a >
7
+
8
+ <style >
9
+ a {
10
+ z-index : 5 ;
11
+ }
12
+ </style >
Original file line number Diff line number Diff line change 35
35
}
36
36
</style >
37
37
38
- <img src ={icons [name ]} class ={` icon ${className } ` } alt ={ ` Icon ${ name } ` } />
38
+ <img src ={icons [name ]} class ={` icon ${className } ` } alt =" " />
Original file line number Diff line number Diff line change 4
4
export { className as class }
5
5
</script >
6
6
7
- <span class ={` fw-lighter fst-italic ${className } ` }> - saved {size / 1000 } kB</span >
7
+ <span
8
+ class ={` fw-lighter fst-italic ${className } ` }
9
+ aria-live =" polite"
10
+ >
11
+ - saved {size / 1000 } kB
12
+ </span >
Original file line number Diff line number Diff line change 11
11
12
12
<div class =" settings" >
13
13
<div class =" d-flex justify-content-end" >
14
- <button class ="btn mb-2" on:click ={toggleOpen }>
14
+ <button class ="btn btn-outline-secondary mb-2 d-flex bg-light text-dark " on:click ={toggleOpen }>
15
15
<Icon name ={open ? ' gear-highlighted' : ' gear' }/>
16
+ <p class =" m-0 ms-1" >Settings</p >
16
17
</button >
17
18
</div >
18
19
Original file line number Diff line number Diff line change 1
1
<script >
2
2
import { saveAs } from ' file-saver'
3
3
import * as CleanCSS from ' clean-css'
4
+ import Emoji from ' svelte-emoji'
5
+
4
6
import CopySaveActions from ' ./CopySaveActions.svelte'
5
7
import SavedSizeBadge from ' ./SavedSizeBadge.svelte'
6
8
34
36
35
37
<textarea bind:value ={input } class =" form-control" rows =" 6" placeholder =" enter your raw css here to optimize it..." ></textarea >
36
38
<div class =" row mt-2" >
37
- <button class ="btn btn-primary d-inline" style ="background-color: #27AAE1;" on:click ={optimize }>optimize β</button >
39
+ <button
40
+ class =" btn btn-primary d-inline"
41
+ style =" background-color: #27AAE1;"
42
+ on:click ={optimize }
43
+ >
44
+ optimize
45
+ <Emoji symbol =" β" />
46
+ </button >
38
47
39
48
<div id =" result" class =" position-relative ms-2 flex-grow-1 d-flex p-0 align-items-center" style =" width: 0;" >
40
- <input class ="form-control" type ="text" disabled ={optimizedInput === undefined } bind:value ={optimizedInput }>
49
+ <input
50
+ type =" text"
51
+ class =" form-control"
52
+ aria-hidden ={true }
53
+ disabled ={optimizedInput === undefined }
54
+ bind:value ={optimizedInput }
55
+ >
41
56
{#if optimizedInput !== undefined }
42
57
<SavedSizeBadge size ={savedSize } class =" text-nowrap ms-2" />
43
58
<CopySaveActions
Original file line number Diff line number Diff line change @@ -3730,6 +3730,11 @@ svelte-dev-helper@^1.1.9:
3730
3730
resolved "https://registry.yarnpkg.com/svelte-dev-helper/-/svelte-dev-helper-1.1.9.tgz#7d187db5c6cdbbd64d75a32f91b8998bde3273c3"
3731
3731
integrity sha1-fRh9tcbNu9ZNdaMvkbiZi94yc8M=
3732
3732
3733
+ svelte-emoji@^1.0.2 :
3734
+ version "1.0.2"
3735
+ resolved "https://registry.yarnpkg.com/svelte-emoji/-/svelte-emoji-1.0.2.tgz#43212210bc77fcd766cc846022a98c787a2a6cbd"
3736
+ integrity sha512-vJCBsgrSKZONxBn7ICZxCKzDRaJk7Bi3dALwa3PrIiPS8DP8Fw64N38EuuY90eKNuLmOm4DLNRM+hSeH0V2G5g==
3737
+
3733
3738
svelte-file-dropzone@^0.0.15 :
3734
3739
version "0.0.15"
3735
3740
resolved "https://registry.yarnpkg.com/svelte-file-dropzone/-/svelte-file-dropzone-0.0.15.tgz#6145fbafc448ea47ec803303641246efdb31cae6"
You canβt perform that action at this time.
0 commit comments