screen_rotation
Copied to Clipboard
<!DOCTYPE html> <html> <head> <meta charset="UTF-8" /> <script src="https://unpkg.com/react@17.0.2/umd/react.development.js"></script> <script src="https://unpkg.com/react-dom@17.0.2/umd/react-dom.development.js"></script> <script src="https://unpkg.com/@babel/standalone@7.14.7/babel.min.js"></script> </head> <body> <div id="app"></div> <script type="text/babel"> const kebabToCamel = (str) => { return str.replace(/-([a-z])/g, (match, letter) => letter.toUpperCase() ); }; function App() { const kebabCaseString = "my-kebab-case-string"; const camelCaseString = kebabToCamel(kebabCaseString); return ( <div className="container"> <h3 className="title">React js Kebab Case to Camelcase String</h3> <p className="kebab-case">Kebab-case string: {kebabCaseString}</p> <p className="camel-case">CamelCase string: {camelCaseString}</p> </div> ); } ReactDOM.render(<App />, document.getElementById("app")); </script> <style> /* Assuming you are using React (as indicated by the className attribute) */ .container { max-width: 400px; margin: 0 auto; padding: 20px; border-radius: 5px; box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1); font-family: Arial, sans-serif; } /* Title styles */ .title { font-size: 24px; font-weight: bold; margin-bottom: 15px; color: #007bff; } /* Kebab-case styles */ .kebab-case { font-size: 18px; margin-bottom: 5px; color: #555; } /* CamelCase styles */ .camel-case { font-size: 18px; margin-bottom: 5px; color: #555; } /* Hover effect for the entire container */ .container:hover { box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2); } /* Transition for smoother hover effect */ .container { transition: box-shadow 0.3s ease; } </style> </body> </html>