投稿時間:2021-08-08 20:16:26 RSSフィード2021-08-08 20:00 分まとめ(19件)

カテゴリー等 サイト名等 記事タイトル・トレンドワード等 リンクURL 頻出ワード・要約等/検索ボリューム 登録日
Program [全てのタグ]の新着質問一覧|teratail(テラテイル) 転送参照(ユニバーサル参照)にしたくない https://teratail.com/questions/353349?rss=all 転送参照ユニバーサル参照にしたくない前提・実現したいこと次のようなテンプレート関数で、非const右辺値のみを受け取り可能にしたい。 2021-08-08 19:56:04
Program [全てのタグ]の新着質問一覧|teratail(テラテイル) awsでrailsのactiveadminという管理gemが使えない https://teratail.com/questions/353348?rss=all awsでrailsのactiveadminという管理gemが使えないrailsにactiveadminというgemがあるのですが、本番環境でのみうまくいきません。 2021-08-08 19:36:30
Program [全てのタグ]の新着質問一覧|teratail(テラテイル) マウスオーバーイベントが繰り返し実行される、カーソルが離れていないのにOnEndCursorOverイベントが実行される https://teratail.com/questions/353347?rss=all マウスオーバーイベントが繰り返し実行される、カーソルが離れていないのにOnEndCursorOverイベントが実行される前提・実現したいことUnrealEngineでブループリントを用いてマウスオーバーイベントを作成しています。 2021-08-08 19:30:55
Program [全てのタグ]の新着質問一覧|teratail(テラテイル) 動的計画法を用いたナップザック問題の穴埋め https://teratail.com/questions/353346?rss=all 動的計画法を用いたナップザック問題の穴埋め動的計画法を用いたナップザック問題と思われる大学院試験の過去問を解いているのですがうまく答えを求めることができませんもしよろしければ教えていただけると幸いです。 2021-08-08 19:24:01
AWS AWSタグが付けられた新着投稿 - Qiita [1日目]AWS Clouds Practitioner の資格勉強記録 https://qiita.com/TokoToM/items/97e92f9833cde2e756f3 日目AWSCloudsPractitionerの資格勉強記録この記事AWSCloudsPractitionerの資格勉強の記録をしていきます。 2021-08-08 19:24:12
Docker dockerタグが付けられた新着投稿 - Qiita 【Laravel/Docker】Nginxの502エラー(upstream sent too big header ) https://qiita.com/baby-0105/items/54849ce88b890e87990f 【LaravelDocker】Nginxのエラーupstreamsenttoobigheader解決法DockerのNginxコンテナの設定ファイルnginxconfに以下記載。 2021-08-08 19:43:57
Azure Azureタグが付けられた新着投稿 - Qiita Azure Key Vaultの証明書をApplication Gatewayで使用する https://qiita.com/dg4101/items/3e73ee09d707401051a3 これで、KeyVaultにアップロードした証明書をApplicationGatewayから使用することができます。 2021-08-08 19:25:51
技術ブログ Developers.IO [アップデート] AWS Cloud9 がまた少し便利になりました (CloudWatch Logs、S3、インスタンスプロファイル) https://dev.classmethod.jp/articles/aws-cloud9-introduces-features-browse-cloudwatch-logs-s3-ec2-instance-profiles/ awscloud 2021-08-08 10:44:40
海外TECH DEV Community Escape | A 2D sidescroller game (Prototype) https://dev.to/fradar/escape-a-2d-sidescroller-game-prototype-fa9 Escape A D sidescroller game Prototype Escape the underground Avoid all the enemies Use WASD to move This is just a small prototype sidescroller game so please don t expect much Before you criticize please be aware that the title screen of the game is not thought over very well Play it here Like my games Want to see more Follow me Thanks 2021-08-08 10:37:48
海外TECH DEV Community How to create netflix clone. Netflix clone with HMTL,CSS, JS. https://dev.to/kunaal438/how-to-create-netflix-clone-netflix-clone-with-hmtl-css-js-989 How to create netflix clone Netflix clone with HMTL CSS JS Hello Today we ll see how we can easily create a netflix clone using HTML CSS and JS only No other library We ll also use TMDB API to fetch real data from their database Netflix Clone we all use netflix in our day to day life And if you are just starting with web development This project can be a good practice project for you This netflix clone is a dynamic site and has everything you need for fullstack development practice It runs on a Node js server It uses TMDB API for all data FeaturesLooks similar to Netflix Dynamic site run on Node js server All data is coming from TMDB API Dedicated Dynamic Movies Info page Has movie trailers and recommendations Has smooth card slider effect To see demo or you want full coding tutorial video You can watch the tutorial below Video TutorialI appreciate if you can support me by subscribing my youtube channel So without wasting more time let s see how to code this CodeAs this is a node js web app We nee NPM and Node js in order to start with so make sure you have them installed in your system So let s start with its folder structure Folder Structure This is our folder structure NPM InitLet s start with initializing NPM So outside public folder In your root directory open Command Prompt or terminal And execute npm initIt will ask you for some details You can press enter to have default project details After executing npm init you should see a package json file Great Now install Some libraries that we need in order to create a server Installing LibrariesAfter creating package json file Run this command npm i express js nodemoni means install express js is a library we need to create server nodemon is a library which allow you to run server seamlessly even after making changes to the server After installation complete you should be able to see node modules folder in your root directory Now open package json file in your text editor And edit it a little bit Change the value on main key to server js Delete test cmd from scripts object And add new cmd called start and set it value to nodemon server js Server jsAfter editing package json create JS file server js in the root directory And write this in server js const express require express const path require path let initial path path join dirname public let app express app use express static initial path app get req res gt res sendFile path join initial path index html app listen gt console log listening on port ExplanationIn the top we are using require method to import library so that we can use it in this file We are importing two libraries express and path path library is used to track paths After done importing libraries We are setting a variable app equal to express which enable all the server related features to our app variable And we also have initial path which is holding our public folder path After that we have app use which is used as a middle ware And inside this we have express static which allow us to set our static directory path In this case we are setting our public folder as a static path because our HTML files are inside that folder app get is a listener And in this case it is listening for a GET request to our root path And whenever we get any GET request on We will serve them index html file That s what res sendFile do And the last block of our server js is app listen which is used to add a server s listening port In this case we set it to So our server will run on localhost Not any other port Now in your terminal or cmd prompt Run npm start to start the server And open your browser to localhost You ll be able to see index html file So up until now we have created our server and successfully serving our index html file to path So let s do some front end work here Now Home page So for our Home page we will use these files index html style css home js api js scroll js Let s start from index html file Start typing basic HTML structure And after that link style css file And let s create navbar first lt navbar gt lt nav class navbar gt lt img src img logo png class logo alt gt lt div class join box gt lt p class join msg gt unlimited tv shows amp movies lt p gt lt button class btn join btn gt join now lt button gt lt button class btn gt sign in lt button gt lt div gt lt nav gt Make sure your server is running if it is not then run npm start in your terminal OutputAll the CSS properties I ll use are easy to understand So i ll only explain you JS only But if you have doubt in any part Even in CSS Feel free to ask me in discussions Now style the navbar margin padding box sizing border box body width position relative background font family roboto sans serif navbar width height px position fixed top z index background padding vw display flex align items center logo height join box width fit content display flex justify content center align items center height auto margin left auto join msg color fff text transform uppercase btn border px solid fff border radius px background none color fff height px padding px margin left px text transform uppercase cursor pointer join btn background dde border color dde OutputNow create movie section lt main section gt lt header class main gt lt h class heading gt movies lt h gt lt p class info gt Movies move us like nothing else can whether they re scary funny dramatic romantic or anywhere in between So many titles so much to experience lt p gt lt header gt And style it main position relative margin top px width padding px vw color fff heading text transform capitalize font weight font size px info width font size px margin top px And we have to create a movie list element inside main element this will hold our same genres movie lt div class movie list gt lt button class pre btn gt lt img src img pre png alt gt lt button gt lt h class movie category gt Popular movie lt h gt lt div class movie container gt lt div class movie gt lt img src img poster jpg alt gt lt p class movie title gt movie name lt p gt lt div gt lt div gt lt button class nxt btn gt lt img src img nxt png alt gt lt button gt lt div gt You can see here we have pre btn and nxt btn with them we also have a movie card element Well we will create movie card and list element all with JS but for styling purpose we are creating one card here Just for the sake of CSS movie list width height px margin top px position relative movie category font size px font weight margin bottom px text transform capitalize movie container width height px display flex align items center overflow x auto overflow y hidden scroll behavior smooth movie container webkit scrollbar display none movie flex auto width height px text align center margin right px cursor pointer position relative movie img width height px object fit cover movie p text transform capitalize height px overflow hidden pre btn nxt btn position absolute height px top transform translateY width vw background border none outline none opacity pre btn left vw nxt btn right vw pre btn img nxt btn img width px height px object fit contain nxt btn hover pre btn hover opacity OutputOnce we are done styling our cards we can commit them lt header class main gt lt h class heading gt movies lt h gt lt p class info gt Movies move us like nothing else can whether they re scary funny dramatic romantic or anywhere in between So many titles so much to experience lt p gt lt movie list gt lt lt div class movie list gt lt button class pre btn gt lt img src img pre png alt gt lt button gt lt h class movie category gt Popular movie lt h gt lt div class movie container gt lt div class movie gt lt img src img poster jpg alt gt lt p class movie title gt movie name lt p gt lt div gt lt div gt lt button class nxt btn gt lt img src img nxt png alt gt lt button gt lt div gt gt lt header gt Our main section should look like this As we are done with homepage Now add all JS files in index html file As we need them now lt script src js api js gt lt script gt lt script src js scroll js gt lt script gt lt script src js home js gt lt script gt Make sure you add these files in exactly same order Now go to TMDB Official Site TO create an API key If you don t know how to create it Watch This After creating API key paste it into api js file api jslet api key your api key And after that go to TMDB Documentation And find these three HTTP links api jslet api key your api key let img url let genres list http let movie genres http img url is to fetch image Because we ll get movie image s path id For example if we got image id as then the image url will be genres list http is to fetch movie genres list so we don t have to fetch different genres movie manually movie genres http is to fetch the movie having same genres After done with these HTTPs Open home js file home jsfetch genres list http new URLSearchParams api key api key then res gt res json then data gt data genres forEach item gt fetchMoviesListByGenres item id item name ExplanationHere we are using fetch method to genres list http that we have declared in api js file And using new URLSearchParams for adding api key parameters to the link And after getting res we are converting it to JSON be res json and after converting it to JSON we got the fetched data Inside that before understanding what we are doing First see our fetched data structure So as to understood the data structure Now understand what we are doing after getting JSON data data genres forEach item gt fetchMoviesListByGenres item id item name As we have an array of genres we are looping through each and every genres using forEach method And inside that we are calling fetchMoviesListByGenres id genres which we ll create next Now fetch movies with genres const fetchMoviesListByGenres id genres gt fetch movie genres http new URLSearchParams api key api key with genres id page Math floor Math random then res gt res json then data gt makeCategoryElement genres movies data results catch err gt console log err ExplanationHere we are doing the same we are fetching data but in this case we are making request to movie genres http and adding some more parameters with genres param will give us movie with only that genres for instance if our genres id if for comedy movies then we ll only get comedy movies page param will give use what of the result we want and in this case we are using Math random to fetch some random page of movie result After getting the data we are performing the same res json to covert it into JSON And calling makeCategoryElement category data which will create our movie categories Same if you want you can console log the data structure Now create movie categories But before that select our main element from HTML const main document querySelector main const makeCategoryElement category data gt main innerHTML lt div class movie list gt lt button class pre btn gt lt img src img pre png alt gt lt button gt lt h class movie category gt category split join lt h gt lt div class movie container id category gt lt div gt lt button class nxt btn gt lt img src img nxt png alt gt lt button gt lt div gt makeCards category data ExplanationIn this function we have two arguments one is category and second is data So the first thing our function is doing is adding a movie list element to our main element using innerHTML If you remember this we created in our HTML file but at last commented copy that code and paste it here Make sure you use not because we don t want to re write its HTML lt h class movie category gt category split join lt h gt if you see this line First of all we are using JS template string if you don t use that you ll be not able to write like this So here as we had an h element we are setting it s text to our category that we got at the start of the function But we also performing some methods here Let s see them in detail for instance assume category is equal to comedy lt h class movie category gt category lt h gt Then output will be comdey movies But we don t wont that why we split it lt h class movie category gt category split lt h gt Then it will not work because now we have an array comedy movies That s why use join method to join the array lt h class movie category gt category split join lt h gt Then the output will be Comedy MoviesI hope you understood this And then we are setting up a unique id to movie container element so we can add card to it later And at the very last we are calling makeCards category data to make cards inside that movie container element Now create a cards const makeCards id data gt const movieContainer document getElementById id data forEach item i gt ExplanationInside this function we are selecting the movie container element on the start using that id we got from the above function And after that we are looping through data using forEach method Inside that We are checking some condition if item backdrop path null item backdrop path item poster path if item backdrop path null return This condition is checking if we don t have movie backdrop image path in our result set it to poster path and we don t have that too Don t make the card Sometime TMDB movie s data do not have image path in it that s why we are checking for it After that we havemovieContainer innerHTML lt div class movie onclick location href item id gt lt img src img url item backdrop path alt gt lt p class movie title gt item title lt p gt lt div gt Here we are using the innerHTML method to append the card HTML structure that we already made at the start And again here also we are using template strings If you see we have onclick event to movie card element which in that event we are using location href to redirect user to movie page that we ll create next if i data length setTimeout gt setupScrolling And this is checking for the last cast when we are done creating cards we are running setupScrolling function to setup slider effect We also have to create this After writing this much of JS Now we can see the output without any errors OutputBut we haven t created our slider effect write For that open scroll js file scroll jsconst setupScrolling gt const conainter document querySelectorAll movie container const nxtBtn document querySelectorAll nxt btn const preBtn document querySelectorAll pre btn ExplanationFirst in this function we are selecting our containers next buttons and previous buttons using querySelectorAll method After selecting them Inside the function type this conainter forEach item i gt let containerDimensions item getBoundingClientRect let containerWidth containerDimensions width Here we are looping through each container element And using getBoundingClientRect method to get container s dimensions And at last storing containerDimensions width which of course give container width to containerWidth After that inside this for loop add this nxtBtn i addEventListener click gt item scrollLeft containerWidth preBtn i addEventListener click gt item scrollLeft containerWidth Here we are selecting our nxtBtn and preBtn with container s index And adding click event to them And just performing simple maths After this we should be able to get our slider effect Our Home page is done Server jsNow for about page we need to add some more codes in server js Type this before app listen app get id req res gt res sendFile path join initial path about html app use req res gt res json Here we are adding GET request listener to id path THis means anything with a single slash in front execute the code It will work for but not for And at last we have app use which again use as a middle ware and this means that if the requesting path is not the same as above paths Execute this Means message After this you ll be able to redirect yourself to movie detail page by clicking on movie card About PageLet s create this last page For this link both about css and style css file so we don t have to write lot of CSS And copy paste the navbar here After that create movie info element about html lt movie info gt lt div class movie info gt lt div class movie detail gt lt h class movie name gt Movie Name lt h gt lt p class genres gt Comedy lt p gt lt p class des gt Lorem ipsum dolor sit amet consectetur adipisicing elit In commodi incidunt odit inventore suscipit debitis officia modi exercitationem animi nemo lt p gt lt p class starring gt lt span gt Starring lt span gt lt p gt lt div gt lt div gt And style it movie info width height calc vh px margin top px background size cover background repeat no repeat movie detail width height background rgb background linear gradient deg rgba rgba padding vw display flex flex direction column justify content flex end color fff movie name font size px font weight genres opacity margin px des width line height px margin bottom px starring span opacity Output Once CSS is complete you can remove all the text from the info elements making them totally empty lt h class movie name gt lt h gt lt p class genres gt lt p gt lt p class des gt lt p gt lt p class starring gt lt span gt Starring lt span gt lt p gt Like this Now create video recommendation lt div class trailer container gt lt h class heading gt Video Clip lt h gt lt iframe src title YouTube video player frameborder allow accelerometer autoplay clipboard write encrypted media gyroscope picture in picture allowfullscreen gt lt iframe gt lt div gt You can notice we have iframe here And this is little hard to understand so I suggest you watch this to understand video trailer better Style It trailer container recommendations color fff padding vw vw heading font size px font weight margin bottom px iframe width px height px In output we ll see nothing except our movie info element and a video clip text Because our iframe source is empty Now create recommendation container lt div class recommendations gt lt h class heading gt More Like This lt h gt lt div class recommendations container gt lt div class movie gt lt img src img poster jpg alt gt lt p class movie title gt movie name lt p gt lt div gt lt div gt lt div gt CSS recommendations container width display flex flex wrap wrap movie p position absolute bottom px width height px line height px background rgba text align center opacity movie hover p opacity OutputAs we have done styling You can comment movie element This is the same element that we have created in home page Add scripts to this page also And remeber to add this is same exact order lt script src js api js gt lt script gt lt script src js about js gt lt script gt Now open api js file And add this let original img url let movie detail http You can find these HTTPs from TMDB documentation original img url This is to fetch movie image in original resolution movie detail http This is to fetch details of a particular movie Now open about js And write this let movie id location pathname by location pathname you will be able to extract movie id from the URL For example if the URL is localhost then this will return which is our movie id After that fetch movie details using the same fetch method and pass the fetched data to a function called setupMovieInfo data fetching movie detailsfetch movie detail http movie id new URLSearchParams api key api key then res gt res json then data gt setupMovieInfo data Let s create setupMovieInfo const setupMovieInfo data gt const movieName document querySelector movie name const genres document querySelector genres const des document querySelector des const title document querySelector title const backdrop document querySelector movie info title innerHTML movieName innerHTML data title genres innerHTML data release date split for let i i lt data genres length i genres innerHTML data genres i name formatString i data genres length if data adult true genres innerHTML if data backdrop path null data backdrop path data poster path des innerHTML data overview substring backdrop style backgroundImage url original img url data backdrop path ExplanationThis function is very simple at start it is selecting all elements like movie name title tag des genres And after selecting all the elements We are setting the value using innerHTML method But for genres we have some conditions like at first we are adding only released year by doing some formatting And after that we are loopin through all the genres movie s data have and adding them to the genres with some formatting And yes you can see formatString function let s create this const formatString currentIndex maxIndex gt return currentIndex maxIndex After genres we are checking for backdrop path as we checked it before in homepage And setting up the image as a background image Then as we don t get the cast info with the movies detail We have to fetch it seperately fetching cast infofetch movie detail http movie id credits new URLSearchParams api key api key then res gt res json then data gt const cast document querySelector starring for let i i lt i cast innerHTML data cast i name formatString i And I think this is very easy to understand But if you have a doubt ask me in discussions Now if we see the output OutputNow let s fetch video clips fetching video clipsfetch movie detail http movie id videos new URLSearchParams api key api key then res gt res json then data gt let trailerContainer document querySelector trailer container let maxClips data results length gt data results length for let i i lt maxClips i trailerContainer innerHTML lt iframe src data results i key title YouTube video player frameborder allow accelerometer autoplay clipboard write encrypted media gyroscope picture in picture allowfullscreen gt lt iframe gt Here we are fetching videos detail related to movies And after getting results we are checking a condition to set maxClips because we want clips at most And after that we are looping maxClips time And creating an Iframe this is the same structure that we have in our HTML file Copy that from there to here But notice it s src attribute carefully OutputNow the last thing create recommendations fetch recommendationsfetch movie detail http movie id recommendations new URLSearchParams api key api key then res gt res json then data gt let container document querySelector recommendations container for let i i lt i if data results i backdrop path null i container innerHTML lt div class movie onclick location href data results i id gt lt img src img url data results i backdrop path alt gt lt p class movie title gt data results i title lt p gt lt div gt And at the last step of the project We are fetching similar movies like that from TMDB And after getting the data we are making only cards This is very similar to what we did for creating card in home js OutputWe are done So that s it I hope you understood each and everything If you have doubt or I missed some thing let me know in the comments Articles you may found UsefulInfinte CSS loaderBest CSS EffectWave Button Hover EffectYoutube API Youtube CloneGradient CheckboxI really appreciate if you can subscribe my youtube channel I create awesome web contents SubscribeSource CodeThanks For reading 2021-08-08 10:17:48
ニュース BBC News - Home North Korea: Kim Jong-un calls for relief in flood-hit areas https://www.bbc.co.uk/news/world-asia-58135753 calls 2021-08-08 10:02:08
ニュース BBC News - Home England v India: Rain delays start as tourists chase 209 to win https://www.bbc.co.uk/sport/cricket/58137389 bridge 2021-08-08 10:38:42
ニュース BBC News - Home Ireland's Harrington wins Olympic boxing gold https://www.bbc.co.uk/sport/olympics/58130534 lightweight 2021-08-08 10:07:13
サブカルネタ ラーブロ TOKYO UNDERGROUND RAMEN 頑者@池袋 http://feedproxy.google.com/~r/rablo/~3/8J7DZvQHvIU/single_feed.php 2021-08-08 11:00:47
北海道 北海道新聞 埼玉で1364人がコロナ感染 過去2番目の多さ https://www.hokkaido-np.co.jp/article/576402/ 新型コロナウイルス 2021-08-08 19:17:00
北海道 北海道新聞 海上からも五輪選手に感謝 巡視船が電光メッセージ https://www.hokkaido-np.co.jp/article/576401/ 海上保安庁 2021-08-08 19:17:00
北海道 北海道新聞 中仏、コロナ禍と五輪の共存模索 自国開催控え、東京大会を注視 https://www.hokkaido-np.co.jp/article/576400/ 新型コロナウイルス 2021-08-08 19:17:00
北海道 北海道新聞 道南在住19人感染確認 新型コロナ 函館の福祉施設でクラスター https://www.hokkaido-np.co.jp/article/576369/ 新型コロナウイルス 2021-08-08 19:10:35
北海道 北海道新聞 J1神戸、代表FWの大迫を獲得 ドイツ2部ブレーメンから https://www.hokkaido-np.co.jp/article/576399/ 日本代表 2021-08-08 19:07:00

コメント

このブログの人気の投稿

投稿時間:2021-06-17 05:05:34 RSSフィード2021-06-17 05:00 分まとめ(1274件)

投稿時間:2021-06-20 02:06:12 RSSフィード2021-06-20 02:00 分まとめ(3871件)

投稿時間:2020-12-01 09:41:49 RSSフィード2020-12-01 09:00 分まとめ(69件)