create script to replace svg icons

This commit is contained in:
Stefan Melmuk 2024-03-09 07:58:25 +01:00
parent 3f796d0503
commit 21ffad4495
No known key found for this signature in database
GPG Key ID: 817020C608FE9C09
6 changed files with 44 additions and 34 deletions

File diff suppressed because one or more lines are too long

View File

@ -0,0 +1,7 @@
<svg version="1.1" viewBox="0 0 800 200" xmlns="http://www.w3.org/2000/svg">
<path class="tw-fill-text-alt2" d="m457.16 129.39-11.407-36.49q-1.0783-3.3482-4.0292-15.209h-.454q-2.27 9.9313-3.9725 15.322l-11.747 36.377h-10.896l-16.968-62.197h9.8744q6.0158 23.438 9.137 35.696 3.178 12.258 3.632 16.514h.454q.62424-3.2347 1.9863-8.342 1.4188-5.1642 2.4402-8.1717l11.407-35.696h10.215l11.123 35.696q3.178 9.7611 4.313 16.401h.454q.227-2.043 1.1918-6.2993 1.0215-4.2562 11.861-45.797h9.7611l-17.195 62.197zm77.858 0-1.8727-8.8528h-.454q-4.6535 5.8455-9.3072 7.9451-4.5968 2.043-11.52 2.043-9.2503 0-14.528-4.767-5.221-4.767-5.221-13.563 0-18.841 30.134-19.749l10.555-.3405v-3.859q0-7.3209-3.178-10.783-3.1212-3.5185-10.045-3.5185-7.7748 0-17.592 4.767l-2.8943-7.207q4.5968-2.497 10.045-3.9158 5.5048-1.4187 11.009-1.4187 11.123 0 16.457 4.9373 5.3912 4.9373 5.3912 15.833v42.449zm-21.281-6.6399q8.7964 0 13.79-4.8238 5.0508-4.8238 5.0508-13.506v-5.6183l-9.4205.39725q-11.237.39725-16.231 3.5185-4.9372 3.0645-4.9372 9.5908 0 5.1075 3.0645 7.7748 3.1212 2.6672 8.6825 2.6672zm76.045-56.693q4.1428 0 7.4343.68101l-1.3053 8.7395q-3.859-.85122-6.8101-.85122-7.5476 0-12.939 6.1291-5.3345 6.1291-5.3345 15.266v33.369h-9.4205v-62.197h7.7748l1.0783 11.52h.454q3.4617-6.0721 8.3425-9.3636 4.8805-3.2915 10.726-3.2915zm59.077 54.991h-.51081q-6.526 9.4775-19.522 9.4775-12.201 0-19.011-8.342-6.7532-8.342-6.7532-23.721t6.8102-23.892q6.8101-8.5122 18.954-8.5122 12.655 0 19.408 9.1933h.73779l-.39725-4.4832-.22704-4.3697v-25.311h9.4205v88.301h-7.6615zm-18.841 1.589q9.6478 0 13.96-5.221 4.3697-5.2777 4.3697-16.968v-1.9863q0-13.223-4.4264-18.841-4.3698-5.675-14.017-5.675-8.2856 0-12.712 6.4696-4.3698 6.4127-4.3698 18.16 0 11.918 4.3698 17.99 4.3697 6.0721 12.825 6.0721zm74 7.8881q-13.79 0-21.792-8.3989-7.9451-8.3989-7.9451-23.324 0-15.039 7.3773-23.892 7.4343-8.8528 19.919-8.8528 11.69 0 18.501 7.7179 6.8101 7.6615 6.8101 20.26v5.9588h-42.846q.28376 10.953 5.5048 16.628 5.2777 5.675 14.812 5.675 10.045 0 19.863-4.1995v8.3989q-4.994 2.1565-9.4775 3.0645-4.4265.96478-10.726.96478zm-2.5537-56.58q-7.4912 0-11.975 4.8805-4.4265 4.8805-5.221 13.506h32.518q0-8.9097-3.9725-13.62-3.9725-4.767-11.35-4.767zm84.047 55.445v-40.236q0-7.6045-3.4617-11.35-3.4618-3.7455-10.839-3.7455-9.7611 0-14.301 5.2777t-4.54 17.422v32.631h-9.4205v-62.197h7.6615l1.5322 8.5122h.45403q2.8942-4.5968 8.1153-7.0937 5.221-2.5537 11.634-2.5537 11.237 0 16.912 5.448 5.675 5.3912 5.675 17.309v40.576z"/>
<path class="tw-fill-text-alt2" d="m213.24 129.39-3.3482-8.6261h-.454q-4.3697 5.5048-9.023 7.6615-4.5968 2.0998-12.031 2.0998-9.137 0-14.415-5.221-5.221-5.221-5.221-14.869 0-10.102 7.0368-14.869 7.0937-4.8238 21.338-5.3345l11.009-.3405v-2.7808q0-9.6478-9.8744-9.6478-7.6045 0-17.876 4.5968l-5.7318-11.69q10.953-5.7318 24.289-5.7318 12.769 0 19.579 5.5615 6.8102 5.5615 6.8102 16.912v42.279zm-5.1075-29.397-6.6962.227q-7.5476.227-11.237 2.724-3.6888 2.497-3.6888 7.6045 0 7.321 8.3989 7.321 6.0158 0 9.5908-3.4617 3.632-3.4617 3.632-9.1933zm79.962 29.397-2.3268-8.1153h-.908q-2.7808 4.4265-7.8881 6.8665-5.1075 2.3835-11.634 2.3835-11.18 0-16.855-5.9588-5.675-6.0158-5.675-17.252v-41.371h17.309v37.058q0 6.8665 2.4402 10.328 2.4402 3.405 7.7748 3.405 7.264 0 10.499-4.8238 3.2348-4.8805 3.2348-16.117v-29.85h17.309v63.447zm48.748 0h-17.309v-88.301h17.309zm44.889-12.655q4.54 0 10.896-1.9863v12.882q-6.4696 2.8943-15.89 2.8943-10.385 0-15.152-5.221-4.7103-5.2777-4.7103-15.776v-30.588h-8.2856v-7.321l9.5338-5.7885 4.994-13.393h11.066v13.506h17.763v12.996h-17.763v30.588q0 3.6887 2.043 5.448 2.0998 1.7592 5.5047 1.7592z"/>
<path class="tw-fill-text-alt2" d="m51.982 33.947-15.322.002 41.131 115.17h14.518l41.131-115.17h-15.162l-25.971 73.872c-1.7205 4.7315-3.1706 9.1927-4.3535 13.387-1.1829 4.086-2.1516 8.0119-2.9043 11.775-.75272-3.7636-1.7195-7.7417-2.9023-11.936-1.1829-4.1938-2.635-8.7098-4.3555-13.549l-25.809-73.552z"/>
<path class="tw-fill-text-alt2" d="m84.264 5.0749a2.3288 2.3288 0 00-1.2122.99654l-4.145 6.9077c-.72599.06029-1.4502.12529-2.1701.20657l-5.406-5.9599a2.3288 2.3288 0 00-3.9203.77975l-2.7161 7.5796c-.7008.20184-1.4008.40458-2.0929.62653l-6.4616-4.7875a2.3288 2.3288 0 00-3.691 1.53l-1.1884 7.9871c-.63834.33084-1.2749.66363-1.9023 1.0124l-7.297-3.4482a2.3288 2.3288 0 00-3.3222 2.2201l.39272 8.0937c-.55229.44111-1.0997.8874-1.639 1.3438l-7.8588-1.9647a2.3288 2.3288 0 00-2.825 2.825l1.9647 7.8588c-.45646.53923-.90273 1.0867-1.3439 1.639l-8.0937-.39271a2.3288 2.3288 0 00-2.2201 3.3222l3.4482 7.297c-.3488.62737-.68158 1.2639-1.0124 1.9023l-7.9871 1.1884a2.3288 2.3288 0 00-1.53 3.6911l4.7875 6.4616c-.22196.69217-.4247 1.3921-.62653 2.093l-7.5796 2.7161a2.3288 2.3288 0 00-.77976 3.9203l5.9599 5.4061c-.08128.71995-.14628 1.4442-.20657 2.1701l-6.9077 4.1451a2.3288 2.3288 0 000 3.9952l6.9077 4.1439c.06028.72636.12524 1.451.20657 2.1713l-5.9599 5.4061a2.3288 2.3288 0 00.77976 3.9192l7.5796 2.7161c.20188.70099.4045 1.4017.62653 2.0941l-4.7875 6.4605a2.3288 2.3288 0 001.53 3.6922l7.9871 1.1884c.33079.63822.6637 1.275 1.0124 1.9023l-3.4482 7.297a2.3288 2.3288 0 002.2201 3.3222l8.0937-.39272c.44117.55235.88734 1.0997 1.3439 1.639l-1.9647 7.8588a2.3288 2.3288 0 002.825 2.825l7.8588-1.9647c.53923.45647 1.0867.90273 1.639 1.3438l-.39272 8.0926a2.3288 2.3288 0 003.3222 2.2201l7.297-3.447c.62736.34881 1.2639.68158 1.9023 1.0124l1.1884 7.987a2.3288 2.3288 0 003.691 1.5289l6.4616-4.7864c.69217.22197 1.3921.4247 2.0929.62654l2.7161 7.5796a2.3288 2.3288 0 003.9203.7786l5.4049-5.9588c.72031.0813 1.4449.14624 2.1713.20656l4.145 6.9077a2.3288 2.3288 0 003.9952 0l4.1439-6.9077c.72674-.0603 1.4517-.12518 2.1724-.20656l5.4049 5.9588a2.3288 2.3288 0 003.9192-.7786l2.7161-7.5796c.70103-.20189 1.4017-.4045 2.0941-.62654l6.4605 4.7864a2.3288 2.3288 0 003.6922-1.5289l1.1884-7.987c.63823-.33079 1.275-.6637 1.9023-1.0124l7.297 3.447a2.3288 2.3288 0 003.3222-2.2201l-.39271-8.0926c.55234-.44117 1.0997-.88734 1.639-1.3438l7.8588 1.9647a2.3288 2.3288 0 002.825-2.825l-1.9647-7.8588c.4565-.53928.90269-1.0866 1.3438-1.639l8.0926.39272a2.3288 2.3288 0 002.2201-3.3222l-3.447-7.297c.34872-.62723.68163-1.264 1.0124-1.9023l7.987-1.1884a2.3288 2.3288 0 001.5289-3.6922l-4.7863-6.4605c.22202-.69235.42462-1.3931.62652-2.0941l7.5796-2.7161a2.3288 2.3288 0 00.77862-3.9192l-5.9588-5.4049c.0814-.72069.14623-1.4457.20658-2.1724l6.9077-4.1439a2.3288 2.3288 0 000-3.9952l-6.9077-4.1451c-.0603-.72635-.12524-1.451-.20658-2.1713l5.9588-5.4049a2.3288 2.3288 0 00-.77862-3.9203l-7.5796-2.7161c-.20184-.70082-.40457-1.4008-.62652-2.093l4.7863-6.4616a2.3288 2.3288 0 00-1.5289-3.6911l-7.987-1.1884c-.33084-.63836-.66362-1.2749-1.0124-1.9023l3.447-7.297a2.3288 2.3288 0 00-2.2201-3.3222l-8.0926.39271c-.44112-.55229-.8874-1.0997-1.3438-1.639l1.9647-7.8588a2.3288 2.3288 0 00-2.825-2.825l-7.8588 1.9647c-.53927-.4565-1.0866-.9027-1.639-1.3438l.39271-8.0937a2.3288 2.3288 0 00-3.3222-2.2201l-7.297 3.4482c-.62726-.34873-1.264-.68165-1.9023-1.0124l-1.1884-7.9871a2.3288 2.3288 0 00-3.6922-1.53l-6.4605 4.7875c-.69236-.22201-1.3931-.42463-2.0941-.62653l-2.7161-7.5796a2.3288 2.3288 0 00-3.9192-.77975l-5.406 5.9599c-.72032-.08133-1.4449-.14626-2.1713-.20657l-4.1439-6.9077a2.3288 2.3288 0 00-2.783-.99654zm.78543 14.613a4.657 4.657 0 014.6569 4.6569 4.657 4.657 0 01-4.6569 4.6569 4.657 4.657 0 01-4.6569-4.6569 4.657 4.657 0 014.6569-4.6569zm-10.998 8.0064 7.7056 7.7056a4.6575 4.6575 0 006.5853 0l7.7056-7.7056c17.959 3.3214 33.023 14.65 41.468 30.141l-4.943 9.6998a4.6575 4.6575 0 002.0351 6.263l9.7123 4.9486c.32157 2.5182.49487 5.0839.49487 7.692 0 15.934-6.1974 30.369-16.306 41.066l-10.796-1.7093a4.6575 4.6575 0 00-5.3277 3.8704l-1.7116 10.804c-7.7603 3.6739-16.443 5.734-25.624 5.734-9.1812 0-17.864-2.0608-25.625-5.7352l-1.7116-10.803a4.6575 4.6575 0 00-5.3277-3.8715l-10.795 1.7105c-10.108-10.697-16.306-25.132-16.306-41.066 0-2.608.1733-5.1738.49487-7.692l9.7111-4.9486a4.6575 4.6575 0 002.0351-6.263l-4.9418-9.6986c8.4449-15.492 23.508-26.821 41.468-30.142zm-47.923 34.902a4.657 4.657 0 011.3064.22587 4.657 4.657 0 012.9896 5.868 4.657 4.657 0 01-5.868 2.9907 4.657 4.657 0 01-2.9907-5.8691 4.657 4.657 0 014.5627-3.2155zm117.84 0a4.657 4.657 0 014.5616 3.2155 4.657 4.657 0 01-2.9896 5.8691 4.657 4.657 0 01-5.868-2.9907 4.657 4.657 0 012.9896-5.868 4.657 4.657 0 011.3064-.22587zm-95.153 69.428a4.657 4.657 0 012.4709.88189 4.657 4.657 0 011.0306 6.5047 4.657 4.657 0 01-6.5047 1.0306 4.657 4.657 0 01-1.0306-6.5047 4.657 4.657 0 014.0338-1.9125zm72.463 0a4.657 4.657 0 014.0338 1.9125 4.657 4.657 0 01-1.0306 6.5047 4.657 4.657 0 01-6.5047-1.0306 4.657 4.657 0 011.0306-6.5047 4.657 4.657 0 012.4709-.88189z"/>
<path class="tw-fill-text-alt2" d="m406.1 185.44-4.8026-12.342h-15.803l-4.7468 12.342h-5.0817l15.58-40.04h4.5232l15.524 40.04zm-10.778-28.871q-.16753-.44674-.55844-1.6194-.3909-1.1727-.7818-2.4012-.33505-1.2844-.55843-1.9545-.39091 1.7312-.89345 3.4064-.50261 1.6194-.83768 2.5687l-4.5233 12.062h12.62zm31.384 29.429q-5.5844 0-8.9346-3.8532-3.3506-3.9091-3.3506-11.615t3.3506-11.615q3.4064-3.9649 8.9905-3.9649 3.4623 0 5.6402 1.2844 2.2338 1.2844 3.6298 3.1271h.33506q-.0559-.72595-.22337-2.122-.11169-1.4518-.11169-2.2895v-11.951h4.9142v42.441h-3.9649l-.72593-4.0207h-.22339q-1.3403 1.8987-3.574 3.2389-2.2338 1.3402-5.7519 1.3402zm.7818-4.0765q4.7468 0 6.6452-2.5687 1.9545-2.6246 1.9545-7.8738v-.89347q0-5.5844-1.8428-8.544-1.8428-3.0155-6.8127-3.0155-3.9649 0-5.975 3.1831-1.9545 3.1272-1.9545 8.4322 0 5.3609 1.9545 8.3206 2.0103 2.9597 6.0309 2.9597zm55.788-26.972q5.0817 0 7.5946 2.6246 2.5129 2.5687 2.5129 8.3764v19.489h-4.8584v-19.266q0-7.092-6.0867-7.092-4.3558 0-6.2542 2.5129-1.8428 2.5129-1.8428 7.3154v16.529h-4.8584v-19.266q0-7.092-6.1426-7.092-4.5232 0-6.2542 2.7922-1.7312 2.7922-1.7312 8.0414v15.524h-4.9142v-29.933h3.9649l.72595 4.0766h.27922q1.3961-2.3454 3.7416-3.4623 2.4012-1.1727 5.0817-1.1727 7.0362 0 9.1582 5.0258h.27921q1.5078-2.5687 4.0766-3.7974 2.6246-1.2286 5.5284-1.2286zm21.891-10.666q1.1169 0 1.9545.78178.89355.72598.89355 2.3454 0 1.5636-.89355 2.3454-.83765.78179-1.9545.78179-1.2286 0-2.0662-.78179-.83766-.7818-.83766-2.3454 0-1.6194.83766-2.3454.83763-.78178 2.0662-.78178zm2.4012 11.225v29.933h-4.9141v-29.933zm23.901-.55843q5.3609 0 8.0972 2.6246 2.7363 2.5687 2.7363 8.3765v19.489h-4.8584v-19.154q0-7.2037-6.701-7.2037-4.97 0-6.8686 2.7922-1.8987 2.7922-1.8987 8.0414v15.524h-4.9142v-29.933h3.9649l.72596 4.0766h.27921q1.4519-2.3454 4.0207-3.4623 2.5687-1.1727 5.4167-1.1727zm52.381-5.5285q-6.4218 0-10.108 4.3-3.6857 4.3-3.6857 11.783 0 7.4271 3.4064 11.783 3.4623 4.3 10.331 4.3 2.6246 0 4.97-.44675 2.3454-.44675 4.5792-1.1169v4.3558q-2.2337.83766-4.635 1.2286-2.3454.3909-5.6402.3909-6.0867 0-10.163-2.5129-4.0768-2.5129-6.1426-7.1479-2.0103-4.635-2.0103-10.889 0-6.0309 2.1778-10.61 2.2337-4.6351 6.5335-7.2037 4.3-2.6246 10.443-2.6246 6.3101 0 11.001 2.3454l-2.0103 4.2441q-1.8428-.83766-4.1325-1.5078-2.2337-.67011-4.9141-.67011zm43.558 20.997q0 7.4271-3.7974 11.503-3.7416 4.0765-10.163 4.0765-3.9649 0-7.092-1.787-3.0713-1.8428-4.8584-5.3051-1.787-3.5181-1.787-8.4881 0-7.4271 3.7416-11.448 3.7416-4.0207 10.163-4.0207 4.0765 0 7.1479 1.8428 3.1271 1.787 4.8584 5.2492 1.787 3.4064 1.787 8.3764zm-22.617 0q0 5.3051 2.0662 8.4322 2.122 3.0714 6.701 3.0714 4.5233 0 6.6452-3.0714 2.122-3.1271 2.122-8.4322t-2.122-8.3206q-2.122-3.0155-6.701-3.0155-4.5792 0-6.6452 3.0155-2.0662 3.0155-2.0662 8.3206zm44.786-15.468q5.361 0 8.0973 2.6246 2.7363 2.5687 2.7363 8.3765v19.489h-4.8584v-19.154q0-7.2037-6.701-7.2037-4.97 0-6.8685 2.7922-1.8987 2.7922-1.8987 8.0414v15.524h-4.9142v-29.933h3.9649l.72597 4.0765h.2792q1.4519-2.3454 4.0207-3.4623 2.5687-1.1727 5.4168-1.1727zm39.593 22.225q0 4.3558-3.2389 6.5894-3.2389 2.2338-8.7119 2.2338-3.1271 0-5.4168-.5026-2.2338-.50258-3.9649-1.396v-4.4675q1.787.89346 4.3 1.6753 2.5687.72594 5.1934.72594 3.7416 0 5.4168-1.1727 1.6752-1.2286 1.6752-3.2389 0-1.1169-.61424-2.0103-.61426-.89347-2.2337-1.787-1.5636-.89346-4.5233-2.0103-2.9039-1.1169-4.97-2.2337-2.0662-1.1169-3.1831-2.6805-1.1169-1.5636-1.1169-4.0208 0-3.7974 3.0714-5.8635 3.1272-2.0662 8.153-2.0662 2.7363 0 5.0818.55842 2.4012.50259 4.4675 1.4519l-1.6752 3.9091q-1.8987-.78179-3.9649-1.3403-2.0662-.55842-4.2441-.55842-3.0155 0-4.6351 1.0052-1.5636.94937-1.5636 2.6246 0 1.2286.72596 2.122.72595.83764 2.4012 1.6753 1.7311.78179 4.5792 1.8987 2.848 1.061 4.8584 2.1779 2.0104 1.1169 3.0713 2.7363 1.0611 1.5636 1.0611 3.9649zm33.283-6.7569q0 7.4271-3.7974 11.503-3.7416 4.0766-10.163 4.0766-3.9649 0-7.092-1.787-3.0714-1.8428-4.8583-5.3051-1.787-3.5181-1.787-8.4881 0-7.4271 3.7416-11.448 3.7416-4.0207 10.163-4.0207 4.0766 0 7.1479 1.8428 3.1271 1.787 4.8584 5.2492 1.787 3.4064 1.787 8.3764zm-22.617 0q0 5.3051 2.0662 8.4322 2.122 3.0714 6.701 3.0714 4.5233 0 6.6452-3.0714 2.122-3.1271 2.122-8.4322 0-5.3051-2.122-8.3206-2.122-3.0155-6.701-3.0155t-6.6452 3.0155q-2.0662 3.0155-2.0662 8.3206zm35.293 15.022h-4.9142v-42.441h4.9142zm21.053-30.491q3.8532 0 6.5894 1.6753 2.7922 1.6754 4.2441 4.7468 1.5078 3.0155 1.5078 7.092v2.9597h-20.494q.11169 5.0818 2.5687 7.7621 2.5129 2.6246 6.9803 2.6246 2.848 0 5.0259-.50258 2.2337-.55844 4.5792-1.5636v4.3q-2.2895 1.0052-4.5233 1.4519-2.2337.5026-5.3051.5026-4.2441 0-7.5388-1.7312-3.2389-1.7312-5.0817-5.1376-1.787-3.4623-1.787-8.4322 0-4.9142 1.6194-8.4322 1.6754-3.5181 4.635-5.4168 3.0155-1.8986 6.9803-1.8986zm-.0559 4.0207q-3.5181 0-5.5844 2.2895-2.0103 2.2337-2.4012 6.2543h15.245q-.0559-3.7974-1.787-6.1426-1.7311-2.4012-5.4726-2.4012z" stroke-width=".93783"/>
</svg>

After

Width:  |  Height:  |  Size: 13 KiB

File diff suppressed because one or more lines are too long

After

Width:  |  Height:  |  Size: 16 KiB

View File

@ -29,6 +29,14 @@ fi
echo "Patching images" echo "Patching images"
cp -vfR ../resources/src/* ./apps/web/src/ cp -vfR ../resources/src/* ./apps/web/src/
echo "Patching logos"
../scripts/replace-embedded-svg-icons.sh \
../resources/vaultwarden-admin-console-logo.svg \
./apps/web/src/app/admin-console/icons/admin-console-logo.ts
../scripts/replace-embedded-svg-icons.sh \
../resources/vaultwarden-password-manager-logo.svg \
./apps/web/src/app/layouts/password-manager-logo.ts
echo "Using patch: ${PATCH_NAME}" echo "Using patch: ${PATCH_NAME}"
git apply "../patches/${PATCH_NAME}" --reject git apply "../patches/${PATCH_NAME}" --reject

View File

@ -36,6 +36,8 @@ if [ "$(git status --porcelain | wc -l)" -ge 1 ]; then
':!apps/web/src/images/icons/favicon-32x32.png' \ ':!apps/web/src/images/icons/favicon-32x32.png' \
':!apps/web/src/images/icons/mstile-150x150.png' \ ':!apps/web/src/images/icons/mstile-150x150.png' \
':!apps/web/src/images/icons/safari-pinned-tab.svg' \ ':!apps/web/src/images/icons/safari-pinned-tab.svg' \
':!apps/web/src/app/admin-console/icons/admin-console-logo.ts' \
':!apps/web/src/app/layouts/password-manager-logo.ts' \
> "../patches/${PATCH_FILENAME}" > "../patches/${PATCH_FILENAME}"
echo "Patch has been created here: patches/${PATCH_FILENAME}" echo "Patch has been created here: patches/${PATCH_FILENAME}"
else else

View File

@ -0,0 +1,20 @@
#!/bin/bash
if [ ! -f $1 ]
then
echo "$1 does not exist"
exit -1
fi
if [ ! -f $2 ]
then
echo "$2 does not exist"
exit -1
fi
echo "'$1' -> '$2'"
first='`$'
last='^`'
sed -i "/$first/,/$last/{ /$first/{p; r $1
}; /$last/p; d }" $2